Live data from Hacker News

GNU Octave: A high-level interactive language for numerical computations [pdf]

octave.org

51–60 of 70 posts

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#51

Earlier quoted context omitted.

Well written Julia should definitely be faster in most cases unless Matlab is using a specific well performing algorithm that Julia doesn't have built-in. With that being said, there are a lot of Julia posts on the subreddit or stack overflow that go like "Why is this Julia code 10x slower than my Python code"? One issue is that getting good performance out of Julia isn't always obvious without a pretty good understa…

They should be similar if they both rely on standard LLVM optimizations. I assume both have their own optimization passes on some mid-level IR but I personally don’t know whether one or the other has any particular language features that dramatically improve performance over the other. I’d like to hear more!

I was just saying that getting really good performance out of LLVM with Julia isn't always obvious. This isn't just a Julia thing. People starting with Python + Numpy have issues with speed when they don't take advantage of the vector primitives and drop into regular Python loops for part of the code. First time Haskell users are frequently confused when it is significantly slower to parse text than Perl as one of the default string libraries is really slow and not recommended even though it is what a new user would think should be the first choice.

Overall I'm excited for Julia, but have a lot to learn. As far as Octave/Scilab type applications go, I find them useful for small systems where I need to make sure the math of what I'm doing is correct before writing it in something like Julia or Python + Numpy. Excel is also surprisingly good for the really simple stuff (Ex: inverting a small matrix and doing some matrix multiplications).

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#52
It's worth noting that the popular Coursera course "Machine Learning" taught by Andrew Ng uses Octave as its tool. This is mentioned in the Octave book's preface; see https://www.coursera.org/learn/machine-learning if you're interested in the course itself. It is possible to use MATLAB instead, but there's often no real reason to do so. I think a lot of people have already decided to use Octave instead, because it solves their problems just fine.

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#53
post #10

Earlier quoted context omitted.

> It's very hard to recommend that students and colleagues grow invested in toolchains involving proprietary software that they may not reliably be able to afford/activate/use in the future, particularly when some students may end up working in developing nations. The future is here. As a research student in a developed nation, it's very annoying to deal with MATLAB projects. Our lab has a fairly strict no-new-code-w…

What do you use instead though? Octave is very slow, Julia is even slower and Numpy has an annoyingly verbose syntax because it has to be valid Python. Additionally I've not found a plotting solution that is as robust and fast as MATLAB. MATLAB seems to me to be one of those commercial programs that has no good FOSS alternatives. Maybe it's just too niche, like CAD and EDA.

R is nice for stats stuff, even if performance can be iffy for certain tasks. The existing libraries for basic ML tasks are largely fantastic. The syntax rubs many people (including me) the wrong way. But I don't like the paradigm for basic ML tasks in scikit-learn (python) much better.

Anything involving matrix computation is great to do in python because of existing libraries (numpy). I think most people who are actually writing code (i.e. grad students) don't mind the syntax because they learned it in school starting in undergrad.

Octave's main appeal to me (and most people I work with) is being able to run existing MATLAB code. However, making it work for nontrivial MATLAB projects, is, well, nontrivial. It's also very slow.

Julia is the language I'm most excited about. It's fast [1] even though it has a slow startup time, and that's improving quickly. It's got a nice grammar-of-graphics-based plotting library [2] that's quickly catching up to R's ggplot2. I think it has potential to be the language of choice for non-neural-network stats/ML (that's python for the foreseeable future). I like the syntax a lot, too. The data types take some getting used to, not unlike R. I also think if Julia moves away from JIT compilation, it has potential to be the language of choice for deployed NN models (right now, that's C++).

As for plotting, R's ggplot2 beats MATLAB any day of the week for me. To each his own.

[1] https://julialang.org/benchmarks/

[2] https://github.com/GiovineItalia/Gadfly.jl

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#54
post #49

Earlier quoted context omitted.

Its funny to me because for a lot of R users programming has very little to do with their use of R i.e. hypothesis testing using libraries like lme4 for mixed models.

If the language doesn't matter, why do you use R and not GLIMMIX in SAS?

Figuring out how to use R is straight forward. It is much like any interpreted scripting language and there is a huge amount of blog posts, stack overflow questions, books, YouTube videos, and courses on how to do things. It is free. SAS is expensive, the training is a joke, figuring out how to use it is bizzare. I could go on and on. I did a training at work on how to use R to a group using SAS to get them off of it and save us a significant amount of money. SAS seemed to be installed on the server and getting the client side to work on my computer took lots of effort between me and IT. SAS does have easy access to the databases we use, but it was really easy to get R database access with ODBC. In my opinion the gulf between Matlab and Python is much smaller than SAS and R. Granted, I'm not a statistician or expert in either R or SAS. I'm sure SAS does have some use cases where it shines (maybe where you need a really clear audit trail), but overall it seemed to be more confusing than it is worth.

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#55
post #44

Earlier quoted context omitted.

It is a better language indeed. Too bad that their IDE options are not par with it. Julia REPL is just that — a REPL. Julia IDEs are just editors for writing code. MATLAB integrated environment, where you can see all variables immediately, is what makes it popular; why not imitate it?

For what it's worth, the Spyder IDE for python imitates many features of MATLAB and I don't find myself missing much. The data viewer in particular is great.

I haven't used Julia's Juno yet, but have used Python's Spyder and found the combination of editor, REPL, variable inspector, and documentation pane to be great. I can't remember if Spyder can also show charts or if that has to come from the code itself if that makes sense.

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#56

As somebody in an academic field where many scripts exist for MATLAB (mostly digital signal processing focused), there are few projects I want to succeed more than Octave. It's very hard to recommend that students and colleagues grow invested in toolchains involving proprietary software that they may not reliably be able to afford/activate/use in the future, particularly when some students may end up working in devel…

Just curious, what's your opinion on simulink

I haven't used Simulink since my control systems classes in college.

With that being said, certain tasks (control systems is a big one) naturally map really well to Simulink because the graphical block-diagrams in Simulink are identical to how your teacher draws out the system on the blackboard.

To use an example, power systems texts might use Matlab to show the algorithms for transmission level powerflows (Newton-Raphson, Gauss-Seidel, Fast-Decoupled, DC), but they use Simulink to show how the control systems on a generator are modeled and you can easily inject an oscillation and plot out how it would impact the generator. You could of course model the control systems of the generator with regular code, but I think it would be far harder to reason about. I know Scilab has something called "xcos" or something like that which is the beginnings of a free Simulink competitor, but I haven't seen anything in Julia or Python that can do what Simulink can do. If someone knows how to best do controls work in Python or Julia, please let me know how.

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#57
post #4

Earlier quoted context omitted.

I 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 belie…

As someone who is still annoyed that their degree program (a non-CS engineering) had them use Matlab instead of Python, I find it hard to disagree with those points. I will say that I definitely enjoy the 1 based array indexing.

This is a difficult argument in my opinion.

Should a university use something like Matlab/Octave or Python to teach numerical methods and related classes?

Matlab is usually only ~$20 for an engineering student and the language itself is mostly imperative with matrices as the default data type. Also, plotting and variable inspection are available as part of the default install.

Python is Object Oriented. While that is certainly better (well ...most would argue so) from a software engineering perspective, it is a bit of a hurdle for an engineering student with a little bit of C background. I can still remember most of my numerical methods homework assignments. Build this matrix, invert it, implement Simpson's method...blah blah. This is definitely possible in Python, but I would've had to figure out which libraries to import, which Python distribution to use (if you don't use Anaconda or WinPython, getting certain libraries to work is difficult), and a myriad of other problems.

In short, even though I like Python better, Matlab might have been a better choice by my teacher at the time which allowed us to focus on numerical methods and control systems rather than getting lost in the rich Python ecosystem which has a higher learning curve.

Does that mean Python couldn't have worked at all? No I don't buy that either, but think it requires a different approach. If I was the engineering Dean I would require a course called intro to scientific Python which is all about getting a good Anaconda distribution setup with the Spyder IDE and Jupyter Notebooks with some basic Python coding. Then, when it is time to take your numerical methods, digital signal processing, control systems...etc, the teacher can host Jupyter Notebooks that interactively explore the subject with LaTex, code-snippets, and graphs. There is a university somewhere where the professor has a full DSP book done via Jupyter Notebooks and it seems glorious.

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#58

Earlier quoted context omitted.

As someone who is still annoyed that their degree program (a non-CS engineering) had them use Matlab instead of Python, I find it hard to disagree with those points. I will say that I definitely enjoy the 1 based array indexing.

This is a difficult argument in my opinion. Should a university use something like Matlab/Octave or Python to teach numerical methods and related classes? Matlab is usually only ~$20 for an engineering student and the language itself is mostly imperative with matrices as the default data type. Also, plotting and variable inspection are available as part of the default install. Python is Object Oriented. While that is…

> Matlab is usually only ~$20 for an engineering student

Guess what, apparently the first hit is not always free. There are people posting in this thread who have to pay as much as 20k per year for a fully licensed Matlab.

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#59

Earlier quoted context omitted.

This is a difficult argument in my opinion. Should a university use something like Matlab/Octave or Python to teach numerical methods and related classes? Matlab is usually only ~$20 for an engineering student and the language itself is mostly imperative with matrices as the default data type. Also, plotting and variable inspection are available as part of the default install. Python is Object Oriented. While that is…

> Matlab is usually only ~$20 for an engineering student Guess what, apparently the first hit is not always free. There are people posting in this thread who have to pay as much as 20k per year for a fully licensed Matlab.

1.) I'm not sure why you appear to be taking an aggressive tone :)

2.) I've posted several comments on here including one showing that the cost can be up to $20k, so I'm well aware of that fact, but it is irrelevant to the above comment as the $20k is for working professionals and not poor engineering students where the cost is indeed ~$20 as I've paid it. Note that $20k is insane by some standards, but engineering software frequently gets much much higher than that. Yearly licenses in the 0.5 million range are common in my industry, so $20k is not considered unreasonable based on cost alone. It is unreasonable to me when they have free alternatives.

3.) I have said multiple times on here that I prefer Python and Julia as they are deeper and don't cost an arm and a leg. However, my above point still stands that Matlab isn't a bad solution for a student. There is some lock-in of course, but it isn't too bad to migrate away after you graduate and can no longer get the student rate.

Re: GNU Octave: A high-level interactive language for numerical computations [pdf]

#60

Earlier quoted context omitted.

This is a difficult argument in my opinion. Should a university use something like Matlab/Octave or Python to teach numerical methods and related classes? Matlab is usually only ~$20 for an engineering student and the language itself is mostly imperative with matrices as the default data type. Also, plotting and variable inspection are available as part of the default install. Python is Object Oriented. While that is…

> Matlab is usually only ~$20 for an engineering student Guess what, apparently the first hit is not always free. There are people posting in this thread who have to pay as much as 20k per year for a fully licensed Matlab.

There was a little bit more information about that above. I'm a professional and my initial cost was around $2k and my yearly cost is around $400. I don't have to pay the yearly, but I like the updates and I like getting a response when something breaks and I'm on a tight deadline.

I can't stress enough that what you buy with MATLAB is license coverage. Octave and Julia hook into many of the exact same libraries, but they have not negotiated a commercial license for things like linear system solvers. That means that distributed binaries may be subject to things like the GPL. If that's what you want, great. I like the GPL for a certain kind of software delivered to a certain kind of clientele. However, it's a nonstarter for most of my clients, so they buy MATLAB.

Post reply on HN