20 ms·
Open 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
by wwfn 4y ago
Open 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.