GNU Octave 6.1.0
gnu.org
gnu.org
The biggest issue with Octave for me is the slowness of its plotting compared to MATLAB. A major use case for me is visualizing large data sets. I can generate data using any backend (Python, C++, MATLAB, etc.) and want the ability to plot it, zoom in/out to a rectangle, filter to a subset / go back to the full dataset. Simple 2D plotting, no 3D or hard rendering stuff.
In such plotting I find Octave (and to a lesser degree Python's matplotlib) super slow compared to MATLAB. To see it, make a scatterplot of 1-5 million points (say, with x and y random, uniformly distributed in [0, 1]). Zoom to a portion a couple of times. MATLAB response is instant, Octave takes seconds. Do the same for 20 million points (which is still a very small dataset by today's standards) and forget about interactive plotting with Octave :(.
As I said, I still wish Octave the best and hope it succeeds, but with my student days behind me I prefer to just buy an individual license of MATLAB every 5 years or so for my hobby projects.
I will try Julia's visualization tools sometime, but if MATLAB is significantly faster will stick to it for now. Just a single user's data point, not claiming that this is a universal view.
Definitely not for me. As a matter of principle, I try to keep my computation and visualization tools strictly separate. Even, "artificially" separate, if you may. I would actually like octave more if it didn't provide a plot function. It would be closer to the spirit of the unix philosophy.
If your benchmark is plotting 2 million points, it may also be slow. However, I find its ability to rapidly prototype tons of different visualizations useful. I try to avoid needing to plot 2 million points anyway.
Having technical representatives from each team (each sure that his team has nothing to do with it; can they please go back to their offices now) in a room looking at the same instrumentation data with ability to quickly dig into various features and subsets is a huge help for such problem isolation. At least in my experience it depends on fast interactive plotting and filtering of large datasets.
But it is just so good for visualization that I am willing to suffer its other problems. For example, try the below and zoom in / out / resize in both MATLAB and Octave:
n = 2000000; x = rand(1, n); y = rand(1, n); plot(x, y, '.')
That said, Matlab had great tech support and the sales rep was always super helpful. They were much nicer to work with than say National Instruments.
It's been some time since I had to use Octave because I didn't want to pay for a Matlab license, but I recall remez() didn't properly implement the Parks-McClellan algorithm and would return suboptimal results (which is a problem, when the algorithm is intended to find the optimal solution).
Also, Simulink.
I was going to say exactly the same thing. The language implementation is mostly fine-ish. But plotting (which is like half the point of MATLAB) is unusable slow.
It's not just Octave though. All of Julia's plotting libraries are similarly slow. MATLAB still has a monopoly on fast scientific plotting.
Matlab's hobby license is sufficiently cheap that I really would recommend getting that unless you absolutely can't afford it.
Is it due to the fact that few people really care or is there some inherent set of hard problems that Mathworks figured out how to handle?
Probably in Octave's case it is just really ancient code that uses X11 or something. They probably need to rewrite it to use Skia or similar, or even OpenGL. Maybe something like MathGL: http://mathgl.sourceforge.net/doc_en/plot-sample.html#plot-s...
I've never tried that though.
Doing this (C++, CPU) takes ~0.21 seconds for 2 million points, and ~2.06 seconds for 20 million points. The result is a solid blue rectangle, but that's beside the point.
Doing the same on a trivial GPU implementation using CUDA, where I cheated by not even using atomic operations (so this only works because the dots are solid), takes ~0.23 seconds for 2 million points and ~2.3 seconds for 20 million points. Apparently the (my? (GTX 1050 mobile)) GPU doesn't help here.
For comparison, with matplotlib (`plt.scatter(x, y); plt.show()`): for 2 million points, plt.scatter() takes ~10 seconds, and plt.show() takes about 3 seconds fill first image. Zooms/resizes etc. seem to be the same time, or if less points show, proportional to the number of visible points.
So unsurprisingly my cheap C++ code is faster than matplotlib (it doesn't even anti-alias), but is it faster than Matlab? I have neither Octave nor Matlab, perhaps you can compare with matplotlib?
EDIT: my code here https://gist.github.com/tomsmeding/1631090df10ab5ac98403304e...
What I suspect is taking place with Octave/Python/Julia-based tools is the additional information that needs to be handled for each plot. You need to draw axes and ticks, keep tracks of which points are displayed and obscured at at the current axes limits and update all that information every time any of those things change (reset/move/zoom, etc.). It is certainly possible to make abstraction layers that are convenient for software engineers but would not scale well with respect to the number of points that need to be plotted. Or, instead of carefully tracking each state change one could regenerate a large portion of it to make it simpler (and slower). Just a guess though.
I think this because in the end, after all the axis settings and such have been determined (and drawing the axes themselves is surely not the bottleneck), all that remains is just drawing the dots in the rectangular area set out for it. My benchmark does only that part, and as I said, I'm about 50x faster than matplotlib. (C++ and not Python, so I'm not picking on matplotlib, just observing.)
But anyway, if this issue is to be solved it is to be done by contributing to Octave/matplotlib etc, not by throwing around proof-of-concepts on HN. :)
It doesn't need to be flashy. Just a nice font, a header, centre justification, some spacing, a paragraph explaining what the thing is, a nice logo, maybe some screenshots or a link to the docs and a download link.
It's not about aiming for an ugly UI, it's about getting out of the way and presenting a clean, simple, fast, functional page.
The designation brutalist web design has gained some traction. (I would have linked to an article on this, but ironically the page I found was offensively spam-ridden.)
I thought Octave will be a valuable skill when I enter the industry but I could not have been more wrong. Does anyone still use Octave? Is it worth learning?
What tools or languages would you recommend as alternatives to someone graduating from university today?
Also, while perhaps this example is overplayed, Andrew Ng's hugely successful coursera nanodegree on Machine Learning is taught on octave. Andrew Ng explains the reasons for this beautifully in his course, and I agree.
As for "I thought it would be a valuable skill; I could not have been more wrong", it depends. To remove the obvious comment, there is octave, matlab, and octave/matlab. Matlab is still 100% huge in the industry, and getting into this path through octave is at least equivalent, if not better (given you also have to learn more under-the-hood concepts than you might have to in matlab).
However, I will assume here that you are referring specifically to the whole "investing in the octave ecosystem on top of already knowing the matlab language" issue. I would argue that octave tends to be more used in teaching and academia, so you're partly right. But at the same time, I would argue that as an open source project, the opportunities for participation and the transferable skills you can get from that are extremely relevant in any resume.
I personally recommend Python (using NumPy, SciPy, MatPlotLib/Seaborn, Pandas, Keras/PyTorch, Gensim, etc). There’s a lot more that you’ll need to bolt together yourself, but there are packages for pretty much anything you’ll likely need to do in terms of math/science/analysis/ML.
That’s not to say that you shouldn’t advocate for Octave, though! I haven’t used it other than to poke around, but it seems like a great package.
If your skill with Octave makes you more effective in a role, then it's still valuable even if your employer doesn't specifically require experience with it.
I started using Octave after a coworker showed me how he used Matlab as a DSP prototype workbench. At the time I couldn't justify asking the boss for my own Matlab subscription, so I applied what I learned using Octave instead. At this point in my career, Matlab is available to me but Octave does what I need.
One use for it could definitely be running older MATLAB scripts that have deprecated language features. Those were a real pain to make work again.
The improvements from 3 to 4 were massive. The improvements from 4 to 5 equally so. I can't wait to try 6.
In any case, it is definitely not just a tool for running 'old matlab scripts'. It is a beautiful language and environment in its own right, and if academia manages to wake up at some point they would invest in it for the open source environment that it is, in a way similar to python, and help it get even more amazing.
For quick and dirty scientific PoC or obtaining ground truth, Octave/MATLAB is much better since it handles all the quirks of numerical programming with generally slow but with proven solutions.
During development phase of my Ph.D., my professor would scribble something in MATLAB and send it to me with a note "for the given inputs, you should obtain this and that. Attached is the crude math". It was up to me to clean the math, convert it to C++ and make it blazingly fast while solving any attached small but hard problems.
I still have a MATLAB license to test these ground truth scripts against my code.
Add a minimum, if the MATLAB folks would at least consider moving over to Octave we could illuminate some of the licensing fees, but... once performance matters, you’re still going to have to pay a full-time software engineer to port Octave code to make it performant.
Unless it's freelance work you pick up in your excess time, or as a student job.
It seems to lack data structures that are quite pervasive in modern programming practise.
Also python being a general purpose system brings its own benefits, one can easily hook up ones code to fetch or push data to databases and even easily scrape data of the web or extract/reparse/rectify/reformat poorly/complexly structured data before processing.
And I find MATLAB not feature rich in terms of being able to manipulate tabular data in a relational DB like manner, that is querying/projecting/selecting rows/colums to find interesting facts.
You write a function, using nice linear algebra syntax. Already python is worse: you do a bit of import boilerplate and write linear algebra in a gimped notation. You call the function. Not so in python, where you have to import it first. You change the function definition, next call will be redefined function. In python you can try to do an interactive reload via third party software but chances are it won't work right since Guido apparently never considered this something worth designing properly (apart from matlab lots of "real" programming languages are much better at this, including erlang, common lisp and smalltalk).
Your function runs too slow. You press a button and you see a color coded version of the code in your editor window and see instantly where the bottleneck is. In python you break out one of several crappy profilers. You want to save your results from your interactive exploration "save results.mat" -- done. In python there are various ways of saving stuff, which are either not general or slow or don't work between different versions.
I haven't used matlab in years, but as an interactive environment for linear algebra it blew python out of the water and likely still does, even if it has a number of big shortcomings as a general purpose programming language (and probably a worse selection of libraries in quite a few numerical domains these days as well). This is particularly true if the people using it are not trained programmers.
Er, no you don't, if you are using it in the same notebook, module, or REPL session where you defined it. And if you aren't doing the equivalent in MATLAB, you also would have to load the definition.
Have you actually used both matlab and python?
Octave doesn't even come close to MATLAB performance especially when dealing with large datasets and plots.
It grieves me to see how much money squander on MATLAB (and they're apparently not allowed to compare notes, which says something). The ones I'm familiar with pay around (or more than) enough to fund a full-time support post, so there could instead be a significantly-sized sustainable research support team working in that area, just in the UK.
On top of that, Octave isn't even in competition with MATLAB. The much higher performance and capabilities offered by MATLAB that aren't available in Octave (like C++ export including support for GPU acceleration) along with professional support are enough to keep the target audience from considering Octave over MATLAB.
Octave isn't encroaching on MATLAB sales, so I don't think such ruling would be an issue as I doubt that Mathworks would even consider legal action.
Even if they would for whatever bizarre reason, it'd be sufficient to just change the names and parameters of some functions - lots of work, sure but ultimately not too big an issue.
A script could be used to translate between the dialects and people using Octave over MATLAB would continue to do so, since their motivation for choosing Octave wouldn't change due to this.
At least that's what I think.
If you're in a Mathematical Research or Engineering context then you will likely have some models or systems that someone else has written in MATLAB.
If you're writing your own code and you have freedom over your environment then you should pick the best language for your use case.
The use of a zero is admittedly a relatively new concept, and it may not catch on.
Relatively terse syntax for array/matrix operations.
For me the main thing is that math is "native", I don't need to import anything to start doing linear algebra. In python, doing math seems like an afterthought. For example, python offers you strings and dictionaries out of the box, but not ndarrays. In Octave, it is exactly the opposite, and it just feels right.
Additionally compared to python's matplotlib, Octave / Matlab's plotting syntax is much simpler. Not faster but its functional.
In short, its a great educational tool, prototyping mathematical / engineering models. Bad for production use where you are using the code base to actually solve an engineering / science problem.