29 ms·
GNU Octave
- wwfn 4y agoOpen science depends on open tools! Octave is such a good resource for otherwise walled off code (that doesn't use newer matlab features). But I'm curious where octave is popular. Does anyone pick it over julia or python when starting a new project/research? I also wish the state of science/engineering software shook out differently. There's plenty of money to pay Mathworks. Is there some kind of license like pay us if you're doing commercial work or publishing research on grants worth over $XXX, otherwise consider it open source?
- rhodysurf 4y agoI use it when I’m given a model by a scientist they wrote in matlab and I need to port it somewhere else to integrate with an actual system. Octave is great for testing to make sure port matches etc. I also use Octave to learn how matlab algos work because octave is open source and reimplements most if matlab a standard library
- fluidcruft 4y agoI used to use it a lot, but the python libraries are much further ahead at this point. For my uses (essentially image processing and statistics) Octave is always playing catchup with Matlab but python is mostly at par or ahead of Matlab. With the exception of the parallel stuff... but that wasn't anything Octave had either. Eventually when I need performance again I'll see about figuring out how to migrate parts to Julia. One thing I like about the python things is there are some hints of IDL in there (I'm a masochist and liked IDL... Matlab frustrates me at times). Matlab was great for slapping quick UIs together and making little tools, but Jupyter works well enough for that. The 0 indexing in python does really and truly suck sometimes though.
- dr_zoidberg 4y ago> The 0 indexing in python does really and truly suck sometimes though. Now that's something you usually don't hear. At my university I heard a bit of "urban legend" about how back in the day (think early 1990's) a couple of professors got a peer-reviewed article published because they found out that Matlabs 1-indexed implementation of some algorithm resulted in numerical errors, which they measured and corrected. Don't really remember the details, and most of those involved have already retired.
- ogogmad 4y agoWhat you've said isn't surprising. The problem isn't whether 0 or 1 are "right" or not, it's the inconsistency. It makes transcribing something from a textbook harder, because the indexing logic in a textbook algorithm can get quite intricate. It's even worse if they use slices like M[i:j,m:n]. Indexing from 1 is the standard in many areas, going back many decades. SWEs have adopted a different convention.
- enriquto 4y agobut this depends a lot on the particular formula. For example, if you use discrete Furier transforms, all formulas are natural with 0-indexing, but weird with 1-indexing. In general, when the indices of an array are to be interpreted as modulo N, you want them to be 0, 1, ..., N-1 It is inevitable to have to use both conventions if you do varied math stuff. Thus, you will never be happy.
- ethbr0 4y ago(Obligatory) There are only 2 hard problems in computer science: cache invalidation, naming things, and off-by-one errors
- tmtvl 4y agomay You concurrency forgotten have.
- abdullahkhalids 4y agoThe 0 indexing is something one can get used to. On the other hand the fact that range(k,n) goes from k,...,n-1 is the most annoying part.
- whatshisface 4y agoThat's so that range(10) has 10 items in it.
- abdullahkhalids 4y agoYes. But when I use invoke range(k,n) or list[k:n] I intend to do operations on some specific items, not repeat some operations 10 times. So every time I see `for i in range(10)`, I have to do the mental computation: I am repeating this operation on numbers from 0,...,9. I would rather write `for i in range(9)` and know that I am operating on 0,..,9.
- hgomersall 4y agoFor anyone that spends significant time using these languages, those mental mappings are as natural as the one you seem to think is obvious - then the additional advantages of the approach become apparent. Exclusive upper bounds mean slices work neatly: a[0:10], a[10:20], a[20:30] etc. That's very neatly represented in a loop from zero in steps of ten. That pattern turns up all over the place when accessing arrays. I've spent enough time in MATLAB to have been scarred by that kind of array slicing and off-by-one errors.
- xigoi 4y agoThis has the nice advantage that range(k,n) + range(n,m) == range(k,m).
- twangist 4y agoThe 1-based indexing in Matlab does truly suck, all the time.
- sandpaper26 4y agoI used it in grad school a lot, especially when I was running/editing someone else's Matlab code. But if I were to build something on my own, Python would be the way to go.
- rightbyte 4y ago> But I'm curious where octave is popular. Does anyone pick it over julia or python when starting a new project/research? In many non-CS engineering disciplines Octave (and Matlab) is quite common. For doing everyday numerical calculations. Python and Julia do not compete with the simplicity of using GNU Octave.
- npalli 4y ago>> Python and Julia do not compete with the simplicity of using GNU Octave. Python I understand. The numpy notation sucks big time for translating straighforward notation of engineering disciplines and is a huge step backwards in readability; but Julia? That's a surprise. In fact the opening code in the Octave page can be copied almost exactly into Julia and it works.
- tkuraku 4y agoThe big simplicity is that you install octave and you have a gui development environment ready to go. Julia and vscode are great, but setting up a project with all dependencies is a little more work for university students with no programing experience .
- hgomersall 4y agoI actively despise how MATLAB code looks, despite spending years using it. I spent 6 months translating a library to python and it was so difficult to understand what it was trying to do because of how it was represented. I find numpy notation much easier to grok. For sure, you can do interesting indexing that makes it hard to understand, but that isn't even possible in MATLAB.
- signaru 4y agoIn my past engineering university Matlab is popular. Students and staff get access to a network license and courses (non CS) are built around it. It is what older professors are used to and I don't see them shifting to a new language given how busy university professors are, and that Matlab just works. So outside the university, Octave is the path of least resistance for those not planning to purchase Matlab or get it by "other means".
- pfortuny 4y agoI guess Mathworks is pushing very very hard to get Matlab into Universities at the teacuing level, with campus licenses, which honestly for students are great (until they stop being students and realize they have been sucked into an abyss of cost). It is really costly for a dept. to switch to Julia, say, as you would need all your colleagues (I teach applied maths and use matlab/octave) to make the switch lest you annoy the students (because ones learn one thing, others other).
- actinium226 4y agoIt's also difficult to learn the new paradigm of a language, especially since MATLAB is so tightly coupled with the IDE and every other programming languages is usually run on the command line. You can use an IDE for those languages, but it usually requires some setup and sometimes that breaks. I recently found Spyder IDE for Python which feels a lot like MATLAB. Despite my hate for MATLAB, I did at times appreciate the layout of the IDE and the way variables are still available after running a script. Spyder fortunately has a similar interface, except even better since you can restart the interpreter without restarting the IDE. I highly recommend it as a MATLAB replacement!
- cycomanic 4y agoI agree with you, but times are changing. In my experience quite a few departments are moving to python now. This is largely driven by new students who choose or push for python based subjects, because of the much broader applicability. Typically that's a slowish process, starting at the first year level and transitioning to later levels. It's not like it hasn't been done before, when I was a student we would be taught in c or java.
- eggy 4y agoAutodesk did the same with AutoCAD with student licenses, and they unofficially allowed the pirating and use of AutoCAD knowing it would then win market share when people went to work for a company that needed to secure licenses.
- DrNosferatu 4y agoIndeed, despite the tale in university that Matalab is what “the industry uses”, never found an established business willing to pay the license fee. The single only shop using Matlab I encountered was venture capital funded. But truth be said, nothing so far quite managed to replicate Matlab syntax succinctness and ease - even if it’s a (unstated?) design goal of Julia.
- nxpnsv 4y agoI used it a bunch when studying physics at uni, it was perfect for making plots for lab exercises...
- fransje26 4y ago"Perfect" to describe a plotting syntax inherited from Matlab (and unfortunately also "passed-down" to matplotlib) is stretching it...
- the__alchemist 4y agoAnother take: There's value in using a compiled language here. I'm an amateur dabbling in computational chemistry, and my weapon of choice is Rust. (After starting using Python). Why: - Fast, in an area where speed is important - Can be made faster for repetitive tasks by communicating with a GPU using Vulkan, CUDA etc - Can incorporate a GUI, and 3D graphics, which helps for exploring things visually, tweaking parameters, doing time simulations etc. - Can share. Ie, I showed my brother yesterday by sharing a 10Mb executable. Matlab has license complications and you need it installed. Sharing Python programs is a disaster. (Docker? Pip? Pyenv? Poetry? Virtualenv? System Python? System dependencies for the C and Fortran dependencies?)
- wodenokoto 4y agoMaybe it is not part of computational chemistry, but how do you do explorative analysis? More than half my time working with data is spend grouping and summarising data, typically in Pandas and drawing interactive graphs in plotly.
- the__alchemist 4y agoPlots and visualizations in 3D. (Vulkan / WGPU) For example, to compare wave function solutions, I use surface plots of a 2D slice. I have a UI that can change the slice of the non-mapped axis. Plots of psi'', the potential etc too. Or for simulating molecular motion, draw it out in 3D, with 6DOF FPS-style camera controls etc. I imagine Pandas would be OOM too slow for this. Compared to Numpy, Pandas is, in my experience far too slow. Another speed limitation is Matplotlib's 3D plots make my computer crawl when rotating them etc; and they're not very interactive, at least on their own. When dealing with these systems, a particular computational challenge is that they're 3D, so computation scales with precision^3. (This also adds complications to visualization, as I alluded to above)
- legerdemain 4y agoDid you write your own visualizations using wgpu? I don't think its goals include providing visualization out of the box.
- jwuphysics 4y agoI found it really useful when I got started in numerical computing and machine learning. Now I use the Jax/Numpy stack and Pytorch, but octave still has a special place in my heart due to Andrew Ng's canonical intro to ML Coursera course.
- slavik81 4y agoI write all my code in C++, but when debugging, I format my printed data so that I can examine it in octave.
- kkylin 4y agoI use Octave when I teach linear algebra, but it is missing some things even for that, e.g., lasso was missing the last time I tried it. So back to Matlab it was. When I have time (not in the middle of an academic year) I might try to contribute some code.
- antegamisou 4y agoIts use is mostly limited to STEM undergrads that for some reason have trouble installing/running MATLAB. Especially in Engineering (Mechanical/Electrical/Civil) Octave is not a substitute to MATLAB for the simple fact the former does not feature the various toolboxes useful to practicing engineers.
- spookie 4y ago> for some reason have trouble installing/running MATLAB The reason is perhaps the biggest argument against its use in an academic setting, so I'm quite happy that they are the biggest customer
- bee_rider 4y agoMATLAB isn’t difficult to install or run, you just have a license or you don’t.
- antegamisou 4y agoYou'd be surprised at the computer illiteracy of some of the non-CS STEM majors.
- happyjack 4y agoI'm an engineer who does a lot of "applied research" projects. I've used (still do some) octave quite a bit. There's nothing like octave (or MATLAB) for scripting to "get shit done." There is a plethora of packages and tools to do whatever you need. Need to import excel data and graph it? Octave is great. Need to connect to an sql database, pull data and export it? Octave. Linear algebra. Nuff said. It's a great tool for engineers / scientists who don't want to "program" (although you can!) and want readable syntax to just git r dun. Also, there's a shit ton of m code floating out there on the internet and in engineering schools / university research groups. Octave isn't 100% m compatible but if you don't have a special tool boxes & functions you can get them to run in octave with a little debugging. I love octave. It's gotten me out of a lot of binds.
- phkahler 4y agoOpen Matrix Language https://www.openmatrix.org/ https://www.openmatrix.org/
- mark_l_watson 4y agoI used Octave both times I took Andrew Ng’s Stanford Machine Learning class. Initially I hated the language but grew to like it. Octave is an amazing open source/free software project.
- rightbyte 4y ago> Initially I hated the language but grew to like it. Ye in the end I started to like it too. I mean, as long as you don't try to do string manipulations and mainly do numerical stuff it is a very nice language all the quirks be damned.
- zelphirkalt 4y agoI also started doing that MOOC, when it was hyped. I got to the first Octave exercises. Immediately I felt uncomfortable with the code base presented. It seemed really badly structured. It felt like I was just hacking something into a mess. I knew I was side-tracking, but still I tried to refactor it a bit, to make it more acceptable. Modularization felt somehow shoehorned into the language though. Then the grader did not work any longer. Not sure it was because of my "refactoring" or because of the course platform. More likely my modifications, or that the grader checks the integrity of files one is not supposed to change. After that experience I threw the course and did 2 other MOOCs, which taught with the up-to-date (back then) Python stack, which I found much more useful for real applications. However, in those 2 MOOCs I could already use the knowledge learned from the Andrew Ng MOOC, so at least in that aspect of teaching the actual theory, he did a very good job.
- sporedro 4y agoOctave seems great since it’s open and let’s you run Matlab scripts. A bit offf topic, but is Matlab relevant still? I’ve heard it’s still in use a lot, but what’s the benefit of going with a walled off proprietary $$$ tool when you can use something like this? Python and R also seem like they’re growing so much and are very open. I just remember taking a class on Matlab and being pretty disappointed in it with how closed it felt. Will totally check out octave tho!
- jrumbut 4y agoIt seems to be more relevant in some electrical engineering subfields.
- gdevenyi 4y agoSadly yes, it dominates MRI Physics, and still has a substantial footprint in neuroimaging.
- eddsh1994 4y agoMy wife has been using primarily Python in her latest postdoc in those fields so there is hope! Admittedly that might just be on the ML side of the field though
- besnn00 4y agoIt dominates among engineers too, mainly because of Simulink and the toolboxes it offers.
- yonz 4y agoYou are right Python, R and Julia are good enough for Data Science and Ml. But the Matlab ecosystem is deeply intertwined for a variety of fields, including ones that don't require coders. Take a look at this for example https://www.mathworks.com/matlabcentral/fileexchange/49683-light-field-toolbox-v0-4-deprecated-v0-5-available-now https://www.mathworks.com/matlabcentral/fileexchange/49683-l...
- tkuraku 4y agoIt has some add-ons (tool-boxes) that aren't as complete or don't exist in the open source world and would be a big lift to reimplements. If you are just writing all your own code there isn't any advantage over python, Julia, etc.
- smartmic 4y agoThe GNU universe is wide and deep, and although each program is developed independently by different people with different backgrounds, the name still stands for something special. For me, it's a quality attribute, among others; I'm less hesitant to install and try GNU applications than other, more free-floating ones. And I have never been really disappointed. Furthermore, the software philosophical aspect should not be underestimated. The more you realize what software can do and what powerful influence it has on our society in many ways, the value of a GNU Public License has increased for me.
- MayeulC 4y agoI'm just going to point out that GNU netcat has nothing to do with the GNU project, which confused me a lot :)
- haolez 4y agoGnuplot is the same.
- neilv 4y agoBranding has never been the Free Software Foundation's strong suit. (Even the FSF's name is unfortunate, IMHO. It's not an opportunity to tell the person you actually mean "free as in freedom", like some imagine. It's just starting people off with the wrong idea of what your mission is. And the result sure looks like most people went with the wrong idea, for whatever reason.)
- yonz 4y agoI used Octave when my educational license for Matlab expired. We need OSS competitors to keep Matlab in check, already at $1k/year https://www.mathworks.com/pricing-licensing.html https://www.mathworks.com/pricing-licensing.html
- Tijdreiziger 4y agoThey have a home license for €120 and an academic license for €500 though. Of course, Octave is still cheaper.
- tmtvl 4y agoOctave is a great project though since it is Free (in both senses of the word) it would be nice if people who end up saving €120/year on ML could consider passing a portion of those savings on in the form of a donation.
- Tijdreiziger 4y agoYes, the fact that Octave is FOSS is definitely awesome too, I didn’t mean to diminish that :)
- IshKebab 4y agoYeah the home MATLAB license is the most expensive software I've actually bought. Octave is... okish. But Matlab is like 80% plotting and Octave's plotting support is pretty terrible. In my opinion there isn't really anything that competes with MATLAB for the things it is really good at. Numpy is shit. If you really can't afford £120 for MATLAB then I would say the next best option is Scilab. Now we just need SOLIDWORKS to introduce a decent hobby license. They added one recently but it's subscription only so screw that.
- Tijdreiziger 4y ago> Yeah the home MATLAB license is the most expensive software I've actually bought. Are you sure? The standalone version of Microsoft Office is more expensive at €150. Windows is even more expensive, but of course most people get that bundled with their computer.
- aprdm 4y agoI used it instead of matlab when working on power systems calculations, it worked pretty well!
- kqr 4y agoIs someone able to briefly compare Octave to numpy and R?
- highfreq 4y agoCompared to numpy, octave has a nicer syntax for matrix math, but a bit idiosyncratic as a general language. It doesn't have anywhere near the ecosystem of Python/NumPy/SciPy. It is also nice in that there is a standard development shell with REPL plotting, debugging and text editor. Like numpy it is pretty slow if you have to actually use for loops over large data sets. Don't know about R.
- Max-Limelihood 4y agoNicer syntax for mathematical operations, but it's very slow (even slower than Python, similar to R) and it doesn't always work with Matlab code like it's supposed to. Julia is just a straightforward improvement (substantially faster, but it has the nicest mathematical syntax of anything I've seen).
- timonovici 4y agohehe, I used in my college classes, at Technical University of Moldova, my teacher was a bit on the fence about it (he was demanding Matlab, but the uni wasn't providing any licenses), but he reluctantly agreed to it. Worked pretty fine, I could use my linux laptop, and didn't need to crack matlab.
- AlbertCory 4y agoThis is from 2008-2011, so adjust accordingly for evolution: For people who did Google stats, R was the unchallenged leader. Almost no one used Octave. I think they did have a site license for Matlab, if memory serves. (this is not a defense of R. I hate it, myself.)
- acomjean 4y agoI disliked R until I took a bio statistics course. It then made a lot of sense. For graphing and analysis it's great, as a general computing language it's wanting.
- Max-Limelihood 4y agoIn that case I'd suggest Julia; it's got syntax pretty much identical to R, and is just as easy to pick up, but it's much, much faster, and it works as a general-ish computing language. (It's still definitely math/science/research-oriented, but it's not like R, which is only really usable for statistics scripts.)
- AlbertCory 4y agoI found that the "learning curve" was more a "learning straight line." Even after you've attained some basic competence and you've been using it for a while, it's still confounding.
- atum47 4y agoDid all my projects in octave during image processing class. It's awesome.
- abhayhegde 4y agoOctave has been an excellent alternative to MatLab. I don't see, for a grad student, what you cannot do in Octave but can in MatLab. Not like MatLab is any cheap either.
- markkitti 4y agoOctave is nice, but I never found it very compelling as an open source but lesser version of MATLAB. In part, this is because I have been privileged to have someone else cover the costs for me. Numpy and Julia are alternative open source projects that cover some of the same use cases, but also add some additonal value. Numpy works with the Python ecosystem and its API has been emulated for distinct applications. Julia shares some of MATLAB and Octave's syntax, adds an advanced algebraic type system, and has expanding native code generating capabilities.
- bee_rider 4y agoI’ve only used Octave extensively, so maybe this is a dumb question, but how well does Matlab run on the terminal? With Octave you just need to chmod and set the shebang.
- college_physics 4y agoThere is a vast amount of talent that has created all the powerful open source numerical platforms we have today but if it could somehow coordinate we'd significantly accelerate these projects to maturity. Octave is playing in a crowded orchestra, with the python scipy stack, the R and julia ecosystems, not to mention libraries in c++ like armadillo and eigen or even new projects in rust. The funny thing is that in individual projects we like to apply DRY but we thinking more broadly, when solving numerical / computational problems there seem to be (too) many open source alternatives with significant overlap and duplication No doubt all them have their pros and cons and optimal niches or historically strong points. Ultimately though it might be an idea to somehow consolidate and coalesce around fewer and more mature stacks that have large use and development communities and which dont compete against each other for attention
- JulianMorrison 4y agoThey're tools for different tasks, consolidating them would make a less helpful mishmash
- hgsgm 4y agoOctave is open source Matlab. If you need Matlab, nothing else helps.
- college_physics 4y agoThis simply means that there is a need for an open source api that emulates the matlab api. But other components, e.g. IDE, compute engines etc could (theoretically) be shared between various stacks. To some degree this happens already, eg when they link underlying linear algebra libraries written in c++ or even fortran.
- musicale 4y agoI quit Matlab years ago but find Octave to be useful whenever I have to run old code. However at this point I've definitively switched to Python/numpy/scipy/jupyter/etc.. Basically no reason to go back to Octave or Matlab. I still use Mathematica on occasion though. I haven't found an alternative that is as convenient.
- nmfisher 4y agoA couple of years ago I came across a paper on Gaussian Mixture Models. Googled the author, downloaded their MATLAB code from their University homepage (with a timestamp more than 25 years ago), and installed the most recent version of GNU Octave. Everything ran absolutely flawlessly the first time. By comparison, whenever I encounter Python code just a few years old, half the time it's (almost irreparably) broken.
- BlueTemplar 4y agoGrowing pains going from Python 2 to 3 ? (Are you sure Octave didn't have simular ones when it was as young ? Not to mention that they are kind of forced to follow behind Matlab : for instance IIRC they only recently started to think about adding Unicode support ?)
- tmtvl 4y agoWhen GNU Octave was as young as Python? Python is two years older.
- BlueTemplar 4y agoWhoops, that's a surprise, I guess I should have checked it first... XD
- skedaddle 4y agoOctave is wonderful. It's one of those free software projects whose success and necessity inspire the entire movement. In one of my first jobs I saved a bunch of money for the company just by porting stuff out of Matlab. It wasn't just that the licenses were pricey, it's that they were a pain in the butt, plus the program was slow and very difficult to orchestrate. At least at the time. It wasn't always easy or possible to replace a client's Matlab analyses with an Octave script, but we at least confined it to just one license on one server, stashed inside a utility closet. While meanwhile all other data analysis work flows had been automated and moved into EC2, where they ran for free on Octave.
- DrNosferatu 4y agoI wonder if Russia’s invasion of Ukraine related sanctions - and - the simultaneous restrictions to China using western technology (namely Matlab) will have an effect on Octave progress and development?
- DrNosferatu 4y agoThe problem with Octave seems to be that, even if you put in the time to dig, you eventually hit some insurmountable roadblock because there’s no library that does what you need, IMHO.
- DrNosferatu 4y agoA great way to counter this would be a series of online tutorials showing how to do common and popular tasks, projects & applications with Octave’s existing libraries. Surely people versed with it (or the developers) would be able to show how to work around its limitations vs. Matlab toolboxes’ über-completeness. Call Python libraries if you must from within Octave. But show how to accomplish a popular application from beginning to the very end.
- DrNosferatu 4y ago…or is it that Matlab’s strength, more than the actual language, are in fact the plentiful proprietary toolboxes?
- sbrorson 4y agoThis is a very good point, and is likely one of Matlab's pillars of strength. As an open-source guy I find it painful to say it, but the fact that the Mathworks is a commercial organization means they have lots of revenues which they use to hire people to implement new features. They have loads of very smart engineers building new toolboxes and other new features all the time since they have a money fountain (revenues) to fund it. The toolboxes are important to paying customers with advanced requirements, and they are willing to pay for them. It's a virtuous circle. Octave has some volunteer hackers who poke at the code base for fun. I recall that about ten years ago development of Octave had a crisis -- the primary developer John Eaton lost his funding from the University of Wisconson. Many people who followed Octave feared the project would die. Fortunately, that did not happen, and I am not sure how the whole kerfluffle worked itself out. However, it illuminates the shaky foundations of the volunteer-project software development model (Octave) compared to having a cash fountain from real revenues (Matlab). The cash fountain means you can fund development of features desired by your users.
- ChrisRR 4y agoI wish people would stop just posting links to projects with no explanation. It's not linked to a new release or any news, just here's the name of the project, go find out for yourself what it is. At the very least add some blurb to explain what you're linking to