Live data from Hacker News

A new release for GNU Octave

lwn.net

11–20 of 99 posts

Re: A new release for GNU Octave

#11

I’m curious, are there any Octave users on HN? What are your use cases, in particular different to just an open-source Matlab-like clone? Why Octave not Python? I’m curious, not saying either option is bad.

I'll say one option is bad :-)

I don't use Octave, but I have a little in the past, and I have to teach students to use Matlab (2021 should be the last year of that before we switch to Python though), and I've done a lot of numerical and other programming in Python and Matlab, in each for ~20 years.

In my opinion Matlab is a terribly designed language that has haphazardly grown features by accretion. Anything other than matrices and vectors is far more difficult than it needs to be. Therefore I consider Octave a bit of a lost cause; I think aiming for compatibility with terrible won't lead anywhere good.

Actually Octave has one useful feature Matlab is missing, operators +=, -=, etc., so perfect compatibility is not exactly the goal.

It seems to me the only reason to use Octave is if you happen to have a large legacy Matlab code base that doesn't depend on any of Matlab's proprietary toolboxes (unlikely, as those toolboxes are one of the main reasons people use Matlab).

I believe Python is superior to Matlab/Octave in almost every way. I think Matlab/Octave has two or three very small advantages over Python, and one larger but very niche one:

1) Matlab/Octave's matrix literal syntax is nicer and less verbose ([1 2; 3 4] vs. np.array([[1, 2], [3, 4]])). Irrelevant in most cases, as most substantive programs will have few literals in them. Note that those missing commas are a frequent source of bugs, too, e.g. [1 -2; 1 - 2] is an error, so really the Matlab/Octave is better written as [1, 2; 3, 4].

2) Because Matlab/Octave is primarily for numerical calculations, you don't need to import libraries to get started. Not a big deal as I always have a Jupyter QtConsole running with Python, Numpy and Sympy ready to use.

3) Basic 3D plotting in Matlab is still a little easier (Python is better for complex 3D plotting though). Not sure what Octave's story is for 3D plots.

4) The aforementioned proprietary Matlab toolboxes, if you happen to be working in one of the narrow niches they're good for. Python has similar large library advantages in other (and more) areas. Octave has some equivalent open source library bindings, but that's the biggest incompatibility with Matlab.

20 years ago Matlab was pretty good, but it's barely changed since then, and Python has long overtaken it in most areas. Octave seems to have caught up with Matlab on the GUI front (but Jupyter Notebooks are much nicer for many things (Octave can do Jupyter too), and Python has a selection of mostly equivalent IDEs, e.g. Spyder). Python, being a general purpose programming language, can do all the non-maths things surrounding the maths much easier. Data input/output, data processing, string processing, network access, etc., as well as UI things like Jupyter Notebooks. In my opinion Python's also better at quite a lot of maths stuff, like large integers, arbitrary precision, symbolic algebra, higher dimensional arrays, or dataframes with Pandas. I also much prefer 0-based indexing and half-open ranges.

Matlab's licensing is quite problematic. Licenses for business/research use are incredibly expensive, and licenses for student use are relatively cheap. I consider it unethical to teach students to use a proprietary language that will cost their future employers thousands, but that's been Matlab's sales strategy for decades. Switching to Octave is an option for teaching and some business/research use, but switching to Python, with its much bigger ecosystem, seems more sensible to me (unless you have a big existing Matlab code base).

Re: A new release for GNU Octave

#12

I’m curious, are there any Octave users on HN? What are your use cases, in particular different to just an open-source Matlab-like clone? Why Octave not Python? I’m curious, not saying either option is bad.

I have always used Octave and never Matlab. The professor who introduced me to Octave some 15 years ago was quite the free software activist and did not even tell us that it was a clone.

Today, I am a heavy user of Octave's linear algebra algorithms for large sparse matrices. I also use Python/numpy for other things, and sometimes for linear algebra too (due to the insistence of my coworkers), but it is much less pleasurable and quite annoying. Also, the linear solvers in scipy are sub-par compared to the state of the art solvers in Octave. Once, we found a well-conditioned 6x6 system that linalg.solve failed to solve!

As an aside, I have never used Octave for plotting, and I hate the gui interface; my use case is 100% non-interactive, using scripts.

Re: A new release for GNU Octave

#13

I’m curious, are there any Octave users on HN? What are your use cases, in particular different to just an open-source Matlab-like clone? Why Octave not Python? I’m curious, not saying either option is bad.

I use it often. Even after 20 years of using numeric/numarray/numpy, I still feel more productive in Octave and Matlab. Mostly time series analysis, signal processing, image analysis. Occasional modeling and simulation work. I think for me it’s that octave does it’s job well and doesn’t try to do other things. Python grates on me occasionally since it’s libraries seem to lack focus and try to be too much for too broad of an audience. I like focused, simple tools. I do use Python, but not as my sole tool. I don’t understand he mindset that one tool/language should do everything. Easier for me to learn many languages than one language and have to learn many independently designed libraries.

Re: A new release for GNU Octave

#14

I’m curious, are there any Octave users on HN? What are your use cases, in particular different to just an open-source Matlab-like clone? Why Octave not Python? I’m curious, not saying either option is bad.

MATLAB/Octave's main advantage over Python is that the syntax for manipulating matrices is way way way nicer. They also have a lot of toolboxes and maths related functions that would really take a long time to find/implement in Python.

MATLAB had another significant advantage over Python. Its plotting support is really really really good. Given how much time scientists spend making graphs it's hard to understate how important that is, or how much better MATLAB is at plotting than Python or Octave (or Julia).

Re: A new release for GNU Octave

#15

I’m curious, are there any Octave users on HN? What are your use cases, in particular different to just an open-source Matlab-like clone? Why Octave not Python? I’m curious, not saying either option is bad.

I use Matlab-likes (actually Scilab rather than Octave) for one offs and interactive use. That’s usually playing with a dataset, test some analysis techniques, quick regressions, solving linear equations systems, this sort of things. I hate having to set up the whole machinery when doing this in Python. Also, the general-purpose nature of Python gets in the way, whereas the Matlab-like syntax is very focused and much…

> I really dislike Matplotlib, so rendering is done in something else, usually gnuplot.

This! My biggest gripe against Python numerical stuff was matplotlib, until I realized that it is an entirely optional component of the stack, and you can plot by other, much saner means.

Re: A new release for GNU Octave

#16

I’m curious, are there any Octave users on HN? What are your use cases, in particular different to just an open-source Matlab-like clone? Why Octave not Python? I’m curious, not saying either option is bad.

I would say "Why Octave not Julia?" since Julia is specifically designed for the scientific notations and speed, unlike Python.

Re: A new release for GNU Octave

#17

I’m curious, are there any Octave users on HN? What are your use cases, in particular different to just an open-source Matlab-like clone? Why Octave not Python? I’m curious, not saying either option is bad.

MATLAB/Octave's main advantage over Python is that the syntax for manipulating matrices is way way way nicer. They also have a lot of toolboxes and maths related functions that would really take a long time to find/implement in Python. MATLAB had another significant advantage over Python. Its plotting support is really really really good. Given how much time scientists spend making graphs it's hard to understate how…

> how much better MATLAB is at plotting than Python or Octave (or Julia).

To make sure I’m understanding you correctly, you’re saying Matlab is much better at plotting than Octave? I’ve only ever used the latter, so I guess that would be one reason to consider switching to the former.

Re: A new release for GNU Octave

#19

Earlier quoted context omitted.

I use Matlab-likes (actually Scilab rather than Octave) for one offs and interactive use. That’s usually playing with a dataset, test some analysis techniques, quick regressions, solving linear equations systems, this sort of things. I hate having to set up the whole machinery when doing this in Python. Also, the general-purpose nature of Python gets in the way, whereas the Matlab-like syntax is very focused and much…

> I really dislike Matplotlib, so rendering is done in something else, usually gnuplot. This! My biggest gripe against Python numerical stuff was matplotlib, until I realized that it is an entirely optional component of the stack, and you can plot by other, much saner means.

Yes, there are many good alternatives. Seaborn, Plotly, and many more. I still use Matplotlib for most things (with the OO API), as I can control its fine details and it's more versatile. For non-graph visual things that I could use Matplotlib for, I've been generating SVGs and displaying them directly in Jupyter notebooks (with Cairo is one option, but just directly is pretty easy too).

Re: A new release for GNU Octave

#20
post #19

Earlier quoted context omitted.

> I really dislike Matplotlib, so rendering is done in something else, usually gnuplot. This! My biggest gripe against Python numerical stuff was matplotlib, until I realized that it is an entirely optional component of the stack, and you can plot by other, much saner means.

Yes, there are many good alternatives. Seaborn, Plotly, and many more. I still use Matplotlib for most things (with the OO API), as I can control its fine details and it's more versatile. For non-graph visual things that I could use Matplotlib for, I've been generating SVGs and displaying them directly in Jupyter notebooks (with Cairo is one option, but just directly is pretty easy too).

Sure, but none of these beats gnuplot's uber-elegant "plot sin(x)" syntax :)
Post reply on HN