Hacker News new | comments | show | ask | jobs | submit login
Open source is now ready to compete with Mathematica for use in the classroom (sagemath.blogspot.com)
225 points by williamstein 410 days ago | hide | past | web | 62 comments | favorite

Tools for solving differential equations in SageMath: http://doc.sagemath.org/html/en/reference/calculus/sage/calc...

Differential equation solving in Mathematica: https://reference.wolfram.com/language/ref/DSolve.html

I feel that the difference between the two tools when it comes to this problem really illustrates their core differences.

To be fair to Sage they have a more beginner friendly tutorial for solving differential equations: http://doc.sagemath.org/html/en/tutorial/tour_algebra.html#s...

Not being a user of either program (but having an interest in maths) the most immediate difference looks like Sage's insistence on declaring variables, wouldn't allowing use without declaration be more appropriate ... what's the rationale for that choice that I'm missing?

Instead of creating a new programming language, SageMath uses the extremely popular programming language Python (with some optional minimal preparsing). Thus the language design decisions were mostly made by software engineers, rather than mathematicians. That said, the only sense in which you have to declare variables is that you can't just write x + y without any further thought (you have to write "y=something" first). This avoids some mistakes due to typos, which are common in Mathematica. It also makes it easier to endow variables with more precise structure (e.g., make y a polynomial over a finite field).

Sounds like it would be relatively easy to then optionally pre-parse and automate the variable declaration cutting input considerably (for those who wished it) ... I'm sure that's been done already in such a long lived and popular project.

Thanks for you response and insight. Must give sage a try again.

Yes, I did implement that once. It's in the Sage Notebook (see here http://doc.sagemath.org/html/en/reference/notebook/sagenb/mi...), but nobody implemented it for the command line, and I haven't reimplemented in SageMathCloud worksheets yet. I've opened a ticket: https://github.com/sagemathinc/smc/issues/419

Can you elaborate on the difference? Those APIs look very comparable to me, except that Sage documents lots of minutiae on the same page where it appears Mathematica must have it hidden somewhere else. Are you making a point about the documentation or the software?

I don't think those APIs are comparable at all. Mathematics exposes two functions for solving differential equations, DSolve and NDSolve, for symbolic and numeric solutions. In contrast, sage exposes a melange of different functions based on what methods they use internally. This is hugely different in terms of usability. A high school kid doing a physics project might come up with a differential equation without knowing how to solve it manually, but she can expect to simply use the correct syntax to invoke DSolve/NDSolve to get what she wants. You can't do that in sage without learning a lot about differential equations themselves.

By the way, Mathematica's documentation contains lots of detailed examples hidden beneath those little disclosure triangles.

So, one could read your comment as being in favor of Sage for education then. Specifically in cases where an instructor is available to augment the documentation.

This is precisely the core difference I was talking about. If you want someone to learn about the details of their differential equation solving, then you could probably construct an argument for Sage. But that is not always the educational goal. Indeed, for everyone but college level STEM people in a "Diffeq solution methods" class, it will most likely not be the goal.

Mathematica says: You shouldn't have to know the minutiae about differential equations in order to solve them; we'll figure out the details for you!

SageMath says: We'll give you a buffet of solvers with different internals so you can pick the one that's right for your problem!

Both approaches have merit, and drawbacks. But if you asked me which approach I support, I'd have to go with Mathematica. Theirs is more ambitious, and far more powerful if they are able to "get it right."

I have a lot of bones to pick with Mathematica, but calling it "clunky" seems like a stretch; my experience suggests that mathematica is the exact opposite of clunky; it has so much silky chrome that I feel like it's completely lost touch with its declarative core (if it ever had one).

My experience with mathematica is that it becomes unwieldy as soon as you try to build something non-trivial. But I don't have more that a few semesters of use here-and-there during undergraduate studies.

I feel the same way about MATLAB too, though. For better or worse, I was attracted to a Python scientific computing stack pretty early on.

I'm not sure that you are supposed to use Mathematica to "build" things. It's not that kind of programming language. Its designed-for use case is as a cognitive/computational aid in attacking a specific problem one time, and then having a record of your work. Not so much building software for repeated execution.

A large part of Mathematica is written in the Wolfram Language so I'm reasonably confident that it is intended to be used for building real things.

You have to be able to think in Mathematica, which takes some getting used to. If know what you're doing, you can write extremely expressive (and compact) code. I've seen demos by my lecturers and it's amazing what you can do in a few lines.

It suffers a little from the same sort of thing as Python: there is almost certainly a canonical, beautiful way of doing what you want to do, but you're going to have to sift through documentation to find it.

Yah, Mathematica is pretty much a write-only language...

This is a fantastic project which I've used since leaving university, where Maple and Matlab had reigned supreme. Many thanks for starting it.

As a software engineer, I was drawn to the Python foundations and extensible, open source stack. Sage can be used for 'Programming in the large' where its closed-source rivals cannot.

However, in a classroom environment, where one need only be 'Programming in the small', teachers will not be concerned with this advantage. Sage suffers from a competitive disadvantage to the marketing and UX/UI polish that Mathematica and others provide.

As it stands, Sage's use-case would be for adept developers, working on Unix systems, potentially building complex software. Mathematica/Maple/Matlab arguably better fulfil the plug-and-play use-case of the classroom.

Hopefully we can help redress this imbalance in the open source community with time.

SageMath: http://www.sagemath.org/

I think this is a cool open source project. My sister is a teacher. I wouldn't recommend this over Mathmatica to her. It's level of polish would require attention that could better be focused on here students.

It builds on top of many existing open-source packages: NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT, R and many more.

Is just noise that doesn't solve her problems or help her students.

This announcement is for https://cloud.sagemath.com which seems to be fairly easy to use.

My third year high school math class used Sage and it worked well. You only need one person to mess with the insides of Sage to run the server that everyone can use. However, my class was CS-focused for an Algebra 3 class edit: and using computers for any kind of math work can lead to distractions if the teacher is not strict enough about it.

I'm torn. On the one hand I think it is wonderful that scientific software becomes open source, for the sake of human knowledge. On the other hand, I know that it is very difficult to make money with scientific software.

So this makes me wonder: shouldn't creators of such open source programs be paid like scientific researchers, e.g., through scientific funding?

Sometimes I feel that the work of a scientific programmer is not valued as much as the work of a researcher (who churns out papers instead of code). While on the other hand, everybody thinks it is immensely important that code is open source.

So it is kind of a lose-lose situation for the programmer.

In this case one of the programmers is a researcher. That has applied for grants to work on Sage. Grants that also funded other programmers (grad students and the like).


Also noteworthy is the status of those grant applications. All of them from 2013 onwards are "denied". One wonders.

Hmm. If I were an employee at Mathworks, I'm not sure how happy I'd be about my taxes being used to fund putting me out of work. Nor is doing that, what a researcher should be working on.

But the only programmers that have a right to exist are web developers working on SaaS applications, claiming that they own "their" whole stack (BSD, written by other people) and hiding behind "safe harbor" clauses for large scale copyright infringement!

Quite. I knew it would be an unpopular sentiment here. But I got karma to burn :-)

About 0.001% of voting-eligible US citizens work at Mathworks. The other 99.999% of voters potentially benefit from government funding for open source competitors to Mathworks products. In fact, Mathworks itself has benefited enormously from government-funded open source software.

As a commercial software programmer I'd be happy if open source (with MIT/BSD etc non-GPL licensing) solved the issues that take me the longest time to solve. I could then apply even more levarage in providing more end user value.

Professional software is not like beer or cars, it's about providing the end user tools which maximizes their professional output.

Why is what someone working at some company thinks relevant? Should society also not fund academics to work on drugs because it might make a research scientist at Pfizer sad?

They do different things, basic research vs commercial.

I would imagine (although I have no data to back this up), that the majority of contributors to open-source scientific programs are scientific researchers themselves. They are building tools to scratch their own itch. Hence it is win-win for them to build tools that contribute to their own research.

Researchers are paid to churn out papers, working under publication pressure. As you can imagine, the result is not the best, most user-friendly software.

(Making software is difficult. Adding publication pressure is not going to help the process.)

So, there is a second class of people, called scientific programmers, who might do what you imagined. However, their work is undervalued. For example, although they are often listed as authors of scientific papers, they will almost never be first author. And this type of people will also be the first to disappear if funding dries up. Further, when writing scientific proposals, nobody thinks about hiring a scientific programmer, or it comes as an afterthought.

There are efforts under way to improve the standing of scientific programmers, for instance the UK initiative described in this post: http://software-carpentry.org/blog/2015/06/what-is-a-researc... .

There are now fellowships in the UK specifically aimed at scientific programmers: https://www.epsrc.ac.uk/funding/calls/rsefellowships/ . Even so, currently there no real career path for scientific programmers. Hopefully this will change in the future!

For the category of people you describe, I agree this has been the case in the past, and perhaps even the case at present.

I think (or perhaps hope) the future may hold something different though. There are some industries such as bionformatics where the boundaries between science and scientific computing are being blurred. Whatsmore, I think this blurring of lines between science and computing will continue as a generally trend. Steven Wolfram (Mathematica's creator) articulated this, albeit poorly and hubristically in a "New Kind of Science". That work gained rightful criticism from the majority of the scientific community, but it did articulate a clear trend - scientific research and computation are becoming increasingly intertwined.

We may not differentiate so sharply between the types of work you describe in future, and perhaps value scientific programming more.

Great work. We need more free software alternatives to proprietary juggernauts. I'm sad that GNU octave just isn't where it needs to be in order to supplant MATLAB (but it is getting there). Quite a few researchers in my faculty (including myself) use Python quite a bit, other use IDL (which has a free compiler anyway). Not many use MATLAB, to be honest.

Unfortunately, even if octave can replace MATLAB the language, it's going to take herculean effort to replace MATLAB the ecosystem. Replacing Simulink alone is a huge undertaking, let alone trying to replicate SimMechanics, or some of the other more niche toolboxes. Being able to run a control system block diagram on arbitrary hardware (ARM boards, etc) is huge in the controls world.

The places I see using MATLAB today rely on Simulink & SimMechanics, as well as the Control Systems toolbox and the computer vision packages. OpenCV can replace some of the CV stuff, but can't provide an integrated solution for the controls portion.

Ironically Matlab uses OpenCV for at least some of their vision toolkit - the camera calibration and stereo processing functions for instance.

Thanks. I've created an issue to add mathics support (via the Jupyter kernel) to SageMathCloud: https://github.com/sagemathinc/smc/issues/417 It's awesome that there's a free open source Mathematica-like program now.

Great idea!

I'm working on a fully featured jupyter kernel that will eventually get merged into the main Mathics repo [1]. I was planning to inquire about some hosting in a couple of weeks (once my exams are over and I have a chance to finish the jupyter kernel off).

Edit: [1] https://github.com/sn6uv/Mathics/tree/jupyter

Mathics is a similar project, although the aim is to be an open source interpreter of the Wolfram (Mathematica) language.

It's analogous to the Octave/Matlab relationship.

The development team is also much smaller; I'm the only one contributing regularly to Mathics at the moment. Happy to answer questions.

The true value of Mathematica lies in its vast, high quality, integrated data sets and domain specific algorithms. As far as a teaching tool for math, it doesn't make sense to lock into a proprietary tool.

What open source tooling is up to the task to compete with the Wolfram tooling in terms of UX and usability?

I'd say jupyter notebooks surpass Mathematica UX wise.

I maintain Mathics [1] which has it's own web interface e.g. [2]. I don't think the Mathics interface is as nice as MMA but the documentation bar on the side is really nice.

[1] https://mathics.github.io/ [2] http://mathics.angusgriffith.com/

Interesting, thanks for the info.

I love sagemath, on fedora installing it as simple as 'dnf install sagemath'.

Mathematica not being Open or free is the only complaint I buy. As for it missing features, I'd wager adding them to Mathematica would be less work than building a CAS from scratch with them- in which case I'm sure you'll be missing features from the original.

We already have open source CASs (a handful in fact). So no one is "building a CAS from scratch".

Exactly. When I started SageMath in 2004, by design it built heavily on Pari, Maxima, GAP, Singular, etc., which were all started in the 1990s (or earlier).

I think sagemathcloud has some issues that might need working out.

For instance, after creating an account, there was no way to log out! First time I think I've ever seen that on the web. Probably clearing cookies should not be my only way of logging out.

But I applaud your work!

Also I think a tutorial might be helpful, some sort of "start here" or "getting started" thing to help acquaint people with the site.

Sure it needs some work, but this is 'Engelbart’s Violin' not Facebook or Google!

Wait, found it. I have to go to my profile. Sorry, that is soooo counter to standard web UX flows that I was really confounded by that. There should be a little dropdown menu in the corner from which something like that can be accessed anywhere!

I've created a ticket: https://github.com/sagemathinc/smc/issues/418 (Nobody has complained about the sign out process before, so I haven't prioritized it.)

I have been using it for Graph theory research. Most researchers at my univ also uses it. Sagemath cloud is pretty interesting. With the power of Python, I think sagemath can beat rather than compete with anyone.

Sage is amazing for graph theory.

> But installing SageMath was more difficult than ever.

??? I don't understand? Don't you just give users an exe.

Not on Windows. I believe on Windows the installation method is to download an Ubuntu VM with pre-built Sage.

You are right. Despite many people (including me) trying very hard, nobody has yet successfully ported Sage to properly to Windows. It's millions of lines of code, and difficult to fully port due to many dependencies written by research mathematicians that only support POSIX Unix. Also, I just counted support requests at https://groups.google.com/forum/#!forum/sage-support for this month (Feb 2016) and nearly half of them are problems installing Sage. (Disclaimer: I wrote the above blog post.)

sagemathcloud.org lets teachers, students and others use sagemath without having to install anything.

Sage is always the best on elliptic curve related stuff.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact