Hacker News new | ask | show | jobs
by watwatinthewat 2200 days ago
Graduate educational background in math here and working in software engineering and machine learning. Like your coworker said, I do my work in Python and libraries like Sympy/pandas/numpy, not Sage. Sage never made more sense than Python since Python covers everything I need to do, including what Sage does that I need.

I've never met anyone who uses Sage and work at large research center. If your college background is math, you used Matlab in school. If your background is in computer science, you go with Python or another programming language. Sage seems like the middle ground between those two, but who is that?

The cases posted here seem to be like yours where there is occasional need for workers or students whose employer or school doesn't or won't supply a Matlab license. Matlab is in most college math departments and offers keys directly to students for like $50-100, so there are few of those cases. An employer with math researchers isn't going blink at the $2k for a perpetual license, so anyone doing the work regularly gets Matlab who wants it.

I do think Sage is good software and it is important to have a free alternative to Matlab. The audience is pretty limited, though.

4 comments

Sage is primarily written and developed to support pure mathematics research, and you're describing applied/numerical mathematics. They are completely different things. Look at the chapters and sections in the Sage reference manual to begin to get a sense of what Sage is about: https://doc.sagemath.org/html/en/reference/index.html Sage has basically no overlap at all with Matlab in terms of new interesting code, but does have around a million lines of new code written by over 600 people: https://trac.sagemath.org/#AccountNamesMappedtoRealNames That code is mostly about the world of pure mathematics research, which has almost nothing to do with Matlab.
My background is pure math; sorry if that wasn't clear. Even in that environment I have not seen someone use Sage over Matlab.
In my experience, the math community is a very lumpy peanut butter... People use matlab, mathematica or sage depending largely on what was easily available and usable when they were in grad school, and or what their colleagues and collaborators were using. So some areas end up with lots of Matlab plugins, and other freedom-loving folks work in sage, slowly winning others to the cause with the promise of open source.
- The total available functionality of Matlab is dramatically different than that of SageMath. It's apples to oranges. I've never once even heard of a single research in arithmetic geometry (my area) using Matlab for research. For example, look at the top google hit for matlab and "elliptic curve": https://www.mathworks.com/matlabcentral/answers/282367-may-i... Compare that with what you find for Sage: https://doc.sagemath.org/html/en/constructions/elliptic_curv...

- Research mathematicians often use Sage not just because they are "freedom-loving folks", but because their research fundamentally demands that they can see, modify and extend the source code of the software they are using to do computations, and in many cases this simply isn't possible with commercial options.

> Research mathematicians often use Sage not just because they are "freedom-loving folks", but because their research fundamentally demands that they can see, modify and extend the source code of the software they are using to do computations, and in many cases this simply isn't possible with commercial options.

First of all IANAL not an expert on free software nor is any of this legal advice. Also this post is a bit tangential to the OP topic as it talks mostly about free software. Seeing modifying and extending the source code is exactly what free software is about. If you need or want that then you would often appreciate the free software movement. Free software can be commercial it just usually comes with some form of support or more looser licensing options that you would pay for in order to use it in a closed source product. Really I mainly say this to mention that free software is not free as in price but free as in freedom to see, change, and modify as you see fit. (I assume the parent poster already knew most of this and what I’m about to say by his use of ‘just, but I wanted to make this point more clear to anyone else who may not understand the purpose of free software.) It has taken me a while to understand the ethos, pathos, and logos of the whole free software movement and I’m sure there’s a whole lot more I could learn about it, but I am convinced it is a very necessary and good thing. It has troubled me that I can’t just throw in a GPL licensed software into a commercial product willy-nilly, but I appreciate what free software has accomplished due to it’s principles towards that freedom mentioned above and that is why I think it has accomplished them. I couldn’t imagine a world without Linux and other nice free softwares. I think without the principle of freedom that free software sticks to and has mandated in its licensing has freed a lot of developers that buy into that message a lot less fear that their work will be taken over by some who don’t value that freedom to see, change, and modify the software. I think in that sense those scientists who want the ability for those and themselves in the future to see modify and extend software are very much “freedom-loving folks”.

I very strongly disagree with your suggestion. Matlab is mostly for numerical work (e.g. what NumPy/SciPy/R/Octave are usually used for). Almost universally, this is not research mathematics (although it is certainly useful for many cutting edge engineering research topics and plenty of applied math work).

Sage can deal with these tasks as well as Matlab, simply by virtue of having interfaces to NumPy/SciPy/Octave/others, but this is not where Sage shines. Sage is indispensable for research math (some examples I understand: group theory, cryptography, abstract algebras; but there are many others that are far beyond my level of math education).

In short, I think you are misrepresenting or missing who Sage is really useful for. Matlab simply does not have these features. The competitors would be Mathematica/Maple/Magma.

Applied math can still be research and often is.
You are right. Bad phrasing on my part. Research applied math and research "pure" math even overlap, and the distinction is fuzzy. I do try to distinguish them from engineering research.
> An employer with math researchers isn't going blink at the $2k for a perpetual license, so anyone doing the work regularly gets Matlab who wants it.

Not all employers can splash for matlab. You might be right about a simple license, but in my experience most matlab developers rely on toolkits which ratchet that price up through the roof.

For one example, somebody I worked with rewrote the parfor functionality as a c extension, because we couldn't justify the expense of that addon for every seat. Not a great use of that math researcher's time, but it got the job done, I guess.

I and a couple others at my company showed that Python / Cython could be meet and beat matlab's performance, and we built up an open source stack that our customers love and contribute to -- good luck doing that with matlab.

Our physicists found that the only feature they needed of matlab was its plotting functionality -- so they rewrote that in their native lisp and moved on with their lives.

Today, we only need a few seats for some researchers with seniority. I can't say how much we're saving, obviously, but we eliminated a significant cost in two departments' budgets and our finance folks are quite pleased.

My regret in this is that I used to be a Sage developer, but I've only got so much sway at the company and GPL'd code is a no-go.

With GNU Octave[1] you can run your existing MATLAB code with minimal changes. And since 5.x versions it's now way faster than ever.

[1] https://www.gnu.org/software/octave/

Matlab is very strong for controls, well beyond anything I've seen in Python, but for general numerical work and plotting I feel its advantages over numpy+scipy+matplotlib (if any) cannot justify the cost and loss of freedom.
> If your college background is math, you used Matlab in school.

This is as misinformed as you can get. Matlab is not meant for math - it's meant for computation and the target is science/engineering. Sage likely does a lot that Matlab doesn't do well.

> I've never met anyone who uses Sage and work at large research center.

My company has licenses for MATLAB and Maple. Still, quite a few employees prefer to use Sage over those two.