Hacker News new | ask | show | jobs
by Banana699 1666 days ago
They are not really comparable. Jupyter is more like a repl where every cell is a seperate python script that nonetheless share the same interpreter instance and the binding enviroment. The reason it often draws comparisons to Mathematica is that this is the default mode of interaction with Mathematica (on a PC at least), the IDE opens into a text-editor-like interface and any valid mathematica expression can be entered into an input cell and eval'd seperately from the rest of the script, but it permanently mutates the global state of the running interpreter. This is so much the de facto default that a lot of people don't even know how to interact with the language otherwise.

Jupyter creator said (IIRC) that he was in fact inspired by Mathematica's interface, but it's not like Lisp, Smalltalk and APL weren't doing this at least a decade before.

Aside from this superficial similarity, Mathematica the language is a whole different... language. Imperative contructs are awkward to use and frowned upon, symbolic computation over expression trees is the default and very common, loops and with their exit conditons are expressed as either map-reduce style functions or recursive relations with multiple definitions. All code is literally just a tree of symbols that you can inspect and manipulate, you can enter "NonsenseFunction[1,2,3,4,5]+12" and the interpreter would just give it back to you unchanged, the execution model is simply implementing a rule-rewriting engine, if it can't find a rule to simplify an expression it simply returns the thing as is. This is very different from python or really any mainstream language, it's a fun mixture of Lisp and Prolog.