by enriquto · 3y ago · 0 comments
I use Octave daily, for many numerical tasks (and also python and julia). It has some advantages with respect to Python:
1. The sparse linear solvers in octave are considerably more performant than those available in a default scipy install.
2. No need to import external libraries written in other languages just to multiply two matrices.
3. Translating a formula from the blackboard to octave is really straightforward. This is often not the case for numpy.
As for julia, the base language is even better than octave. However, it is not as useful for one-off scripts due to the slow startup time. You can use octave as a calculator for your shell scripts. For instance, one day I had to warp a collection of images by a collection of affine maps; the affine maps were the product of two matrices stored in individual files. Thus I wrote a three-line shell loop that called octave for each file and did the deed. The loop processed 200 files in five seconds (even without parallelism). In julia this would take a few minutes.
I suppose I maybe get the "no need to import external libraries" thing, 'pip3 install numpy' is technically an extra step that wouldn't have been necessary if the standard library contained a decent matrix module.
But why do you care about the "written in other languages" part? That has literally never caused issues for me with Python. Especially something as popular as numpy just works across all platforms I've tried (x86_64 Windows, Linux and macOS, aarch64 Linux and macOS). Do you frequently encounter issues which are caused by the Fortran portion of Numpy's source code?
No practical issues at all. The problem is not the pip install numpy that only happens once, but the import numpy that must appear on every single one of your programs. I interpret it as a permanent reminder that numerical computation is not natively supported in the language, and that we will always be foreigners in there.