News for hackers. Stuff that matters.
Re:A new release for GNU Octave by billfruit on Wednesday December 16, 2020 @10:43AM (#25443888)
MATLAB seems ill condusive for structuring and organising code in a sane manner. It tends to give its users bad habits with respect to structuring code is what I observe. 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.

Re:A new release for GNU Octave by bee_rider on Wednesday December 16, 2020 @12:00PM (#25444902)
This makes sense, though, because it isn't really a general purpose language for creating standalone programs. I mean, you can try that, but it is a bit awkward. The usecase is mostly "I've got some matrices and I want to try some things with them before writing a couple thousand lines of FORTRAN with a bunch of ugly BLAS calls."

Most programming languages are tools for making tools. Matlab is the tool itself.

I've seen scripts where you have to set up your matrices, manually put them in particular named variables, and run them through a script that was basically a bunch of matlab shell commands listed one after another. That's not scalable of course, but if elderly professors were willing to mess around with makefiles, dependencies, interfaces, and importing stuff then grad students would all find themselves unemployed.

Re:A new release for GNU Octave by billfruit on Wednesday December 16, 2020 @12:13PM (#25445118)
That Ok, but when more elegant and refined tools are available shouldn't they be preferably selected to be used.
Re:A new release for GNU Octave by bee_rider on Wednesday December 16, 2020 @12:21PM (#25445257)
Yes, if that tool were created, I bet it would be really popular. But it hasn't been. Python+Numpy+Scipy isn't it by virtue of the fact that we have to specify three different software packages, haha.

I've done tiny prototypes that I later turned into a nice little Python+Numpy+Scipy scripts, and the final Python version was much nicer, but writing it was still more like a couple hour project, compared to the real-time process of figuring out what I wanted, done in Octave.

Re:A new release for GNU Octave by valarauko on Wednesday December 16, 2020 @12:58PM (#25445833)
How does Julia compare to Python+Numpy+scipy and Octave?
Re:A new release for GNU Octave by UncleOxidant on Wednesday December 16, 2020 @02:02PM (#25446867)
It compares quite favorably. The nice thing is that most of Numpy and Octave functionality is already builtin to Julia (multidimensional matrices are first class as they are in Matlab/Octave). Julia performance is quite good and multiple dispatch is great for composing packages (once you get used to it).

Check out SciML, Julia's answer to scipy (https://sciml.ai/) and Flux Julia's answer to PyTorch/Tensorflow (https://fluxml.ai/). Are these projects as mature as their Python counterparts? To be honest, no they're not, but they are making pretty rapid progress.

Re:A new release for GNU Octave by bee_rider on Wednesday December 16, 2020 @01:03PM (#25445906)
I haven't tried it out. It seems really interesting, though. A guy in my group loved it, but he graduated. I haven't yet so I guess we can put at least one point on the board for Julia!
Re:A new release for GNU Octave by enriquto on Wednesday December 16, 2020 @12:18PM (#25445192)
Sure, and in that specific case octave is the elegant and refined choice!
Re:A new release for GNU Octave by 908B64B197 on Wednesday December 16, 2020 @01:00PM (#25445868)
The argument for MATLAB is the IDE.

It's pretty much already decently configured out of the box, so you spend little time playing with build and project configuration and there's a debugger built-in. Syntax is straightforward and the language is pretty optimized so it doesn't take long to get a working simulation for an engineering major.

It breaks down horribly for larger projects however.

Re:A new release for GNU Octave by ljosifov on Wednesday December 16, 2020 @01:23PM (#25446195)
Agreed it is mostly used interactively in the IDE. FWIW one can compile into p-code (=underlying virtual machine), package the p-code files of the application with the matlab standalone engine+libraries (MCR), and deploy using standard shell tools (e.g make with Makefile).
Re:A new release for GNU Octave by f6v on Wednesday December 16, 2020 @01:38PM (#25446445)
Matlab also has toolboxes, I guess they aren’t all available in Octave?
Re:A new release for GNU Octave by 908B64B197 on Wednesday December 16, 2020 @02:02PM (#25446863)
I don't think so.

Yeah, the commercial plugins are also an interesting feature. The engineering focus of the platform makes it easier to do commercial development.

Re:A new release for GNU Octave by enriquto on Wednesday December 16, 2020 @02:52PM (#25447631)
> I don't think so.

Octave has "toolboxes", they are called packages: https://octave.sourceforge.io/

I don't have extensive experience with Matlab's toolboxes, but my impression is that most toolboxes without graphical interface (e.g., optimization, signal processing) have an octave equivalent with the same function names and mostly compatible. What is missing are the "gui" toolkits like simulink, the circuit stuff, etc.

Re:A new release for GNU Octave by raoulvolfoni on Thursday December 17, 2020 @10:00AM (#25456123)
> It tends to give its users bad habits with respect to structuring code is what I observe.

MATLAB is _approachable_ to engineers who don't give crap about programming, which often results in horrendous codebases (to be fair, I've observed the same, if not worse, with non-programmer's made Python)

> It seems to lack data structures that are quite pervasive in modern programming practise.

This however, is simply not true. MATLAB has many constructs to manipulate tabular and timeseries data in a very efficient way. It also has perfectly capable OOP, which allows building very large applications while staying sane.

MATLAB has evolved tremendously in the last 15 years, and most critics I read, while valid if you compared a circa 2005 version to current Python + numpy + pandas + scipy, are usually just uninformed.

Re:A new release for GNU Octave by enriquto on Wednesday December 16, 2020 @11:03AM (#25444155)
> It seems to lack data structures that are quite pervasive in modern programming practise.

At least it has multi-dimensional arrays of floats, that is all I need and are sorely lacking in Python. On the other hand, Python has dictionaries and strings, but those are completely useless in a numerical setting.

I agree that the M language is not a good general-purpose programming language. But for expressing linear algebra manipulations is probably the best in town.

Re:A new release for GNU Octave by leephillips on Wednesday December 16, 2020 @11:09AM (#25444222)
Except for APL!
Re:A new release for GNU Octave by ljosifov on Wednesday December 16, 2020 @01:04PM (#25445913)
In the opposite direction, being away from matlab, I notice an upside to "vectorise everything" seems to have been "code shrinkage". Looks like ~3-5x times compared to "code with loops". I often find myself ill disposed towards my (and other's) code, it looks complex and verbose. I guess one can't easily un-see/forget how much simpler things can be.