Dew Research has a library for Firemonkey on Windows called MtxVec that provides vector mathematical and statistical functions that are really fast. According to the feature list a version which supports Android and IOS is coming soon. In any event MtxVec supports most versions of Delphi and it has an optimized linear algebra numerical library (LAPACK the de-facto standard for linear algebra). It is also optimized to utilize the following CPU instruction sets for greater speed: SSE2, SSE3, SSE4.2, AVX v1.0 and AVX v2.0. It supports single and double precision within the same project in addition to muli-core support for many vector and matrix functions including matrix multiply, FFT’s, sparse matrix solvers, SVD, and EIG to name some. It comes with a Debugger Visualizer and an expression evaluator/scripter for vectorized math expression. According to their benchmarks this is what they have to say about the speed of MtxVec “How Fast is it Really? Most users observe typical performance improvements of 2x to 3x for vector functions, but speed increases up to 10x are often obtained. The matrix multiplication, for example, is up to 20x faster.” Sounds pretty good. This library is a commercial product but here is a free trial available. If you are doing any kind of expensive float point operations in your Delphi XE6 Firemonkey apps on Windows I would definitely take a look at this library to augment the performance of your app. This is what is to great about Delphi is being able to drop in a third party component or library and be up and running with the new functionality very quickly.
>This is what is to great about Delphi is being able to drop in a third party component or library and be up and
>running with the new functionality very quickly.
Honestly, what language do you imagine doesn’t have the ability to use third party libraries?
Most major languages today have “package management”. There’s a central repository of third party libraries with an API to allow one to search, install, uninstall and update libraries through a CLI or via the IDE. Perl’s CPAN has over 134K modules (!!!), Python’s PyPi has over 45K libraries, R has CRAN, .NET has NuGet (https://www.nuget.org/), etc. Package managers generally have the ability to install dependencies, so if library A needs B and C to function attempting to install A will also download and install B and C.
As such, Delphi is rather behind, not ahead, of other languages in regards to 3rd party library management. When trying out the python-baed PyCharm IDE from JetBrains, on startup it was able to use the package manager to gather a list of all the 3rd party libraries I’d already installed on the system along with their version numbers, indicate which ones were out of date and offer to update them for me! This type of functionality goes hand in hand with “virtual environments”, in which each project has its own environment of 3rd party libraries – great if a project needs to use version X of a library while another must have version Y. Now package managers can export a list of all the libraries used for a project and someone else with the list file can use the package manager to install all the dependencies of a project in one single step!
Dew’s libraries are very nice and indeed I looked at them when considering using Delphi for a new project that was going to involve data analysis and machine learning. The problem is that much of the 3rd party libraries that remain for Delphi cost significant sums of money. Dew’s math, statistics and machine learning libraries with source were available as a package deal for $1500, which equals the cost of Delphi Professional. Meanwhile, with Python I could download Numpy, SciPy and scikit-learn with source for free and get support for LAPACK, BLAS and ATLAS along with much more comprehensive machine learning for free. In fact some Python distributions designed for math/scientific work bundle these libraries and many more. Heck, in Delphi even a decent HTML parser runs $75 (the standard library today simply lacks a lot of functions built-in in other languages). By the time I added up the cost Delphi simply wasn’t going to be cost-effective for the project (in fact, at least so far into the project 100% of the dev tools and libraries used have been open source).
None of this takes away from the fine libraries put out by Dew Research. If one needs to use Delphi for a project that involves significant numerical work it’s really the only choice. Sadly, though, if one has a choice, the Delphi platform simply isn’t competitive. MATLAB runs about $2500 (plus additional “toolkits” are usually $1000 each). Delphi Pro and two Dew libraries with source can end up being slightly more expensive than MATLAB. This is without factoring in languages like R and Python and the vast collection of free and open source mathematics and statistics libraries available for them. Delphi lacks out-of-the-box support for arbitrary precision integer arithmetic, an arbitrary precision decimal type, a usable complex number type, even a fraction type. There was recently an EMBT forum post imploring them to cater towards those using Delphi for scientific/mathematical work, but that appears to be a tiny minority compared to those who use it for database work (when I brought Delphi into a start-up I worked at from ’95-’03 I even referred to it as “my Access killer”).
Dew’s great for what it does, but if you try using Delphi for math-heavy work you’re going to find little support either in the scientific or mathematics community (as opposed to MATLAB, R, Python, SPSS, Stata) or from EMBT itself. 🙁
I pretty much agree 100% that Embarcadero should have a “component/package manager” application and site. They have the technology to do it already (AppWave). Of coarse most languages have third party libraries. For me, libraries aren’t quite the same or as easy to use as the component system that Delphi uses. It probably has to do with the visual development nature of Delphi. Libraries always feel bolted on while components feel like an integrated part of the same system to me.
I view Delphi component purchases as offsetting the cost and time of a developer. If the costs of the components and the IDE are more than the project’s budget then it isn’t a workable solution. If time is more valuable than the cost of the components then the component is a win.
However, the current ability to have one codebase and deploy to Android, IOS, Windows, and OSX is pretty compelling and the only reason I’m currently using Delphi. Depending on the project I use other cross platform solutions like Javascript, PHP, HTML5, and Adobe AIR as well. Whatever tool is going to provide the fastest time to market is what I’m using.