5 ms·
What benefit does Octave have over the Python ecosystem? Esp as a clone of proprietary software? The only thing I can see is as a way of running Matlab codes i
by sitkack 8y ago
What benefit does Octave have over the Python ecosystem? Esp as a clone of proprietary software?
The only thing I can see is as a way of running Matlab codes in clusters on cloud w/o having to also run the license servers.
- 4thaccount 8y agoMatlab and Octave are both easier to do some basic numeric work for people (frequently engineering and science students) with only rudimentary programming experience. In undergrad you write very little code, but do a lot of plotting and it is helpful that the Matlab IDE has all of that natively builtin. I prefer Python & Julia now, but getting something like Matplotlib working with Python would've been more difficult for me in college. Also, Matlab has native support for matrices and numeric operations (inversion, transpose, solve) that students need without having to learn how to use something like Numpy. My preference depends a lot on whether I'm doing exploratory work or trying to craft high quality software to run in production.
- kxyvr 8y agoI work as an applied mathematician writing numerical codes and I prefer to prototype in MATLAB/Octave for a number of reasons: 1. I believe it to be far easier to debug an algorithm in MATLAB/Octave than Python. When I drop into the debugger, I can immediately check things like the eigenvalues of a matrix with a simple "eig(A)" or look at the sparsity visually with "spy(A)". Though this is possible in Python, I believe it to be far easier in MATLAB/Octave because the core mathematical functions are immediately available. 2. MATLAB/Octave link into the good factorization codes directly and provide license coverage in different ways. For example, both codes link into things like SuiteSparse, which gives access to fast Choleski and QR factorizations. These routines have different licenses, but the good ones are dual licensed GPL/Commercial. Octave links into the code under GPL licensing. MATLAB provides a commercial license. This means that I can give a customer MATLAB/Octave code and they can choose whether or not they want license coverage using MATLAB or to release the code under GPL and we don't run afoul with the licenses. Candidly, not having to go off and obtain a second license for SuiteSparse is nice. 3. In my opinion, the C-API in MATLAB/Octave is more sane than Python. It's not great, but the matrices are laid out in a rational method in MATLAB/Octave, so it's really, really easy to link into an old C/C++ or Fortran codes. Often, I've used this trick to debug the C/C++ code because I can more quickly visualize the matrices in MATLAB/Octave than I can using the native language. As for the difference between MATLAB and Octave, I prefer Octave over MATLAB since: 1. Octave is more sane when dealing with the C-API. MATLAB is not bad, but it can be finicky sometimes and I don't feel like I should have to manually set dbmex on. 2. Octave uses the system version of GCC and does not package it's own. MATLAB does and for many years since MATLAB slow played their GCC version, this was a major annoyance when linking to codes that used C++11/14. MATLAB has done a good job in the last few years of catching up, but I still prefer to use the system compiler. 3. There are bugs in some of the Octave packages. MATLAB tends to have fewer such bugs. Most of the time, it doesn't matter till it does. Just file the bug with Octave. They can be slow, but there are a lot of people who volunteer their time and filing such bugs or helping to fix this is just the cost of this kind of software. And, look, if you like Python, great. I also work with Python. However, again, for prototyping a technical algorithm, I prefer Octave.
- GlenTheMachine 8y agoThat’s a well thought out argument and I appreciate it. I also use MATLAB/Octave quite a bit for numerical algorithm prototyping, and mostly hate it. The language has a shallow learning curve, true, but for complex software it gets ugly very fast. It’s just not a well designed language, and if you have any CS background that becomes very limiting. The thing that MATLAB brings to the table is the incredibly high quality numerics toolboxes. Octave gets a few of those but far from all of them, making it in my experience a poor runner up. Whenever I have a choice I now go first to Julia. The language just makes me happy and the numeric infrastructure is almost complete enough. Except for something like Simulink. When you need Simulink, there’s nothing else out there that’s a valid alternative.
- kxyvr 8y agoFor sure and I agree with many of the difficulties associated with MATLAB/Octave. When I want to put together a more complete piece of software that does things like: have a GUI, interact with a database, network conductivity, or parse files, I think that MATLAB/Octave is a poor choice. A language like Julia tries to bridge that gap. My problem with Julia is that we don't get license coverage for things like SuiteSparse even with a JuliaPro license. MATLAB has done a fantastic job of dealing with this and is well worth my license fee every year, so that my customers and I don't have to deal with it. Till this changes, it's a nonstarter for me. As far as the differences in packages between MATLAB and Octave, I'll contend that it depends. For their lower level routines, they often use the exact same codes. Both use ARPACK for iterate eigenvalue solving. Both use various forms of SparseSuite, UMFPACK, LAPACK, and the like for their algebra. For me, I tend to only use these lower level routines, so there's little or no difference in performance or efficacy between the two. For the toolbox arena, I know there are differences and I agree that can be frustrating. I suppose my point is that it really depends where on the spectrum of lower level to higher level mathematical abstractions that we need. For low level abstractions, I feel that Octave works great and it's been a critical tool for me.
- GlenTheMachine 8y ago
- tzhenghao 8y agoThe argument for a language like Octave/Matlab is analogous to why GUI software coexist with CLI alternatives. The Octave/Matlab audience may not be as technical and require a tool that has built in modules/libraries for advanced plots (without a lot of technical pain) etc.
- kkylin 8y agoI work in an academic setting. If I had the choice I'd prefer Python (or even Julia), but frequently Matlab is what's appropriate in a lower-division STEM (non-CS) course because it's what many engineers are used to and teach or expect their students to know. I'd rather use Octave than Matlab in such settings, and encourage students to do the same. Also, Matlab is still much more common (at least in undergrad engineering courses, not so sure about actual usage in the industry) than Python or other similar tools, and it's good to have a free software alternative. That said, I sometimes feel Octave is too much a clone of Matlab, warts and all, and I'd rather give up some compatibility for genuine improvement. (Same way I feel about LibreOffice or OpenOffice sometimes.)
- dongping 8y agoFor those who also use Matlab/Simulink for simulation, Modelica could be a nice alternative with an open implementation, which also has serious industrial application like controlling power plants.
- sampo 8y agoMatlab: exp(-i*pi*[0 0.5 1]) Python: import cmath import numpy as np np.exp(-1j*cmath.pi*np.array([0, 0.5, 1])) Note that you can't use math.exp for complex numbers, and neither math.exp nor cmath.exp works for arrays, you need the separate np.exp. Also, while np.exp actually works on lists, the multiplication doesn't, so you need to keep in mind which variables are python lists (that you mostly cannot do arithmetic on) and which are numpy arrays. When you are experienced in Python, you know these differences by heart. But if you are a domain specialist and want to test an idea quickly, you will see lots of TypeError messages from Python, you need to google manuals to sort it out, and it will slow you down 10x.
- kryptk 8y agoNone of what you said is wrong, but: 1) there is no need to import anything but numpy to get at pi or e (see constant section of numpy docs). 2) if you wrap all your things you expect to behave like vectors/matrices with np.array() and only use np methods to operate on them you will suffer from shape mismatches instead of TypeErrors, a slightly better fate.
- bassman9000 8y agoFor simple stuff, just open the GUI+REPL, and start plotting in Matlab. Great for quick documentation graphics.