Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yet there is hardly any computing system that can replicate Mathematica tooling capabilities.

One would expect 37 years would be enough to create such alternative.

Jupiter notebooks aren't the same.





Sage Math? Though I admit, unlike homogeneous Mathematica, it's just a Python glue on multiple smaller projects of different quality and poorly integrated. I wish there was something more like the Wolfram software but there isn't.

I quite like Sage. Python is a much better language than Wolfram (yes, he named it after himself...). In Wolfram, there is no real scoping (even different notebooks share all variables, Module[] is incredibly clumsy), no real control flow (If[] is just a function), and no real error handling. When Wolfram encounters an exception, it just prints a red message and keeps chugging along with the output of the error'd function being replaced by a symbolic expression. This usually leads to pages and pages of gibberish and/or crashes the kernel (which for some reason is quite difficult to interrupt or restart). Together with the notebook format and the laughable debugger, this makes finding errors extremely frustrating.

The notebooks are also difficult to version control (unreadable diffs for minor changes), and unit testing is clearly just an afterthought. Also the GUI performance is bad. Put more than a hand full of plots on a page, and everything slows to a crawl. What keeps me coming back is the comprehensive function library, and the formula inputs. I find it quite difficult to spot mistakes in mathematical expressions written in Python syntax.


> Python is a much better language than Wolfram

Different languages are better at different things, so it rarely makes much sense to say that one language is better than another in general. Python is definitely much better than Mathematica for "typical" imperative programming tasks (web servers, CLI programs, CRUD apps, etc.), but Mathematica is much better at data processing, symbolic manipulation, drawing plots, and other similar tasks.

> there is no real scoping (even different notebooks share all variables, Module[] is incredibly clumsy)

Scoping is indeed an absolute mess, and the thing that I personally find the most irritating about the language.

> no real control flow (If[] is just a function)

You're meant to program Mathematica by using patterns and operating on lists as a whole, so you should rarely need to use branching/control flow/If[]. It's a very different style of programming that takes quite a while to get used to, but it works really well for some tasks.

> no real error handling

For input validation, you should use the pattern features to make it impossible to even call the function with invalid input. And for errors in computation, it often makes the most sense to return "Undefined", "Null", "Infinity", or something similar, and then propagate that through the rest of the expression.

> The notebooks are also difficult to version control (unreadable diffs for minor changes)

Mathematica notebooks tend to do slightly better with version control than Jupyter Notebooks, although they're both terrible. You can work around this with Git clean/smudge filters, or you can just use ".wls"/".py" files directly.


For writing production code, I find good scoping rules non-negotiable. And error handling, monitoring etc has to be well thought out before deploying at scale.

So as great as Mathematica sounds for interactive math and science computations, sounds like a poor tool for building systems that will be deployed and used by many people.


> So as great as Mathematica sounds for interactive math and science computations, sounds like a poor tool for building systems that will be deployed and used by many people.

Yes, I definitely agree there. Mathematica is definitely great for interactive use, but I'm not really aware of anyone aside from Wolfram himself who tries to deploy it at scale.


That is a fair assessment. By and large it is used for the former. It is super handy in the exploratory phase of certain kinds of mathematical research.

How is "If" as a function even a drawback? It is largely seen as something desired, no? I would see that as a huge advantage, which allows for very powerful programming and meta-programming techniques.

One potential issue is that unlike most other languages, it doesn't create a new scope. But almost nothing in Mathematica introduces a new scope, and Python also uses unscoped "if"s, so it's rarely much of a problem in practice.

But with pattern matching, you almost never need to use "If[]" anyways:

  fib[0] := 0
  fib[1] := 1
  fib[n_ /; n < 2] := Undefined
  fib[n_Integer] := fib[n - 1] + fib[n - 2]

  fib[8]
  (* Output: 21 *)

  fib /@ Range[10]
  (* Output: {1, 1, 2, 3, 5, 8, 13, 21, 34, 55} *)

  fib[-1]
  (* Output: Undefined *)

  fib["a string"]
  (* Output: fib["a string"] *)

On the note of Jupyter notebooks and version control - there was a talk at this year's Pycon Ireland about using a built in cleaner for notebooks when committing the JSON (discard the cell results), and then dropping the whole lot into a CI system utilising remote execution (and Bazel or similar) to run and cache the outputs. Was a talk from CodeThink. No video up yet though. Scenario was reproducible notebooks for processing data from a system under test.

> On the note of Jupyter notebooks and version control - there was a talk at this year's Pycon Ireland about using a built in cleaner for notebooks when committing the JSON (discard the cell results)

Yup, I use a long "jq" command [0] as a Git clean filter for my Jupyter notebooks, and it works really well. I use a similar program [1] for Mathematica notebooks, and it also works really well.

[0]: https://stackoverflow.com/a/74104693

[1]: https://github.com/JP-Ellis/mathematica-notebook-filter


This is not true. Mathematica has the concept of contexts. You can have each notebook have it's own unique context. Mathematica Packages create their own context too, we are not talking about module's here which are useful for local variable scoping. Packages and contexts lead to the isolation you are looking for. These are things that have been around since the initial Mathematica 1.0 in 1988 (!). https://reference.wolfram.com/language/ref/Context.html

Same about your criticism of error handling and control flow: https://reference.wolfram.com/language/guide/RobustnessAndEr...


Fully agreed. I have never seen a programming language which is so badly designed as Wolfram. I really wish there was another way to access all of Mathematica's functionality with a more sane interface.

I've used Sage for years to run the backend (calculations/computations/graphics/prototyping) for a multivariable calculus class I teach. It's not perfect, but as a lightweight, Python-style CAS to do all sorts of "standard" calculations, it's very easy to use!

I tried Sage Math. Just the fact that one has to declare all variables before using them, makes it extremely annoying. In Mathematica, I frequently do computations which have a couple of dozen variables. I am not going to write boiler plate for 20 different variables in every notebook.

Yeah, but that was my point, similar capabilities, not a bunch of tools glued together, poorly integrated, as you point out.

Have you tried Maple? It is also proprietary but it comes from (originally) Waterloo University, and is used in Academia too.

Honest question: I think Maple is really a competitor, even if less known.

Prob I am a very small minority here, but I used Maple a lot in the past and I liked it a lot. More standard syntax than mathematica, and overall much much easier to debug. In particular, as far as I remember, maple allowed for more transparency in the mathematical methods used in some computation than mathematica, as I could just see what it was doing exactly when an unexpected result came or I wanted to understand some method. When you work a lot with integrals, limits and special functions there is always a shit ton of assumptions and cases all over the place, and if something is missed somewhere the computation can just get wrong. There were some few times I would actually get wrong results in mathematica. When the language is more like a black box, it is hard to know what happened.

That is also my feeling, although it has been ages since I last worked with Maple. But some colleagues of mine at other uni do use it instead of Mathematica. Thanks for the detailed reply!

[flagged]


I have no qualms with proprietary software, use plenty of it.

Yes, I didn't think so. So again, why do you want an alternative? Is there something about Mathematica you don't like, but think an alternative would do better?

OP never said he wanted an alternative, just expressed surprise an alternative/competitor didn’t exist.

I know. I just picked on it because on one hand it is great that Wolfram was able to execute on his vision and make it work as a viable product. It needs a lot of resources to make something as great as Mathematica. On the other hand, an essential tool like that, you want to own it for life and grow with it, and I don't think that is quite possible with a "product".

You have to ask fsh that question.

My point is that so much talk against it, and yet there isn't really worthwhile competition.


Ok, I agree with you. I own a copy of Mathematica myself. This topic just very much interests me, because there is this dilemma with this kind of software (I am working on something like that myself): It is so much work, you need to charge for it; on the other hand, for widespread adoption it probably needs to be open-source. What do you do?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: