3 ms·
IPython is great system for interactive programming, especially for someone who is familiar with Python and is able to find a complete distribution or able to s
by nswanberg 13y ago
IPython is great system for interactive programming, especially for someone who is familiar with Python and is able to find a complete distribution or able to set up all the details about their distribution (e.g. avoid problems like https://news.ycombinator.com/item?id=6725597 https://news.ycombinator.com/item?id=6725597), or someone who requires free-as-in-speech software.
I don't use either IPython or Mathematica much, but I would understand preferring Mathematica over IPython given the choice. Aside from being younger, IPython is made of a combination of systems without a strong conceptual glue tying them together. Mathematica is made of a combination of systems too (kernel written in C, various external libraries in C, Lucene search engine, etc), but the components are tied together using what I guess is now called the Wolfram language, where everything, from computations to settings to notebooks themselves, is specified in Wolfram language expressions. If you view an IPython file in a text editor you see JSON, which is different than the language used to compute. If you open a Mathematica notebook in a text editor you see a nested set of Wolfram language expressions. Mathematica grew up around that idea.
As a further small example, compare the prompts to the two systems:
IPython
In [1]: 1+2
Out[1]: 3
vs
Mathematica
In[1]:= 1+2
Out[1]= 3
In IPython, the array brackets are just a sort of notation--the assignment isn't syntactially correct Python. But in Mathematica, you can view that prompt as assigning the value of an In list at index 1 the expression "1+2".
That sort of consistency holds through the entire system in a way that IPython can't match.
- doctoboggan 13y agoI am not sure if you are aware of this, but you can access the history of IPython inputs and outputs through the two arrays `In` and `Out`. This prompt is precisely indicating this.
- nswanberg 13y agoThank you for pointing that out. I meant to show that while they both store their inputs and outputs in array-like structures, Mathematica does it in a way that is valid in its own syntax, and IPython does not. In Mathematica "In[1]:= 1+2" is a syntactially valid expression (though the literal In symbol is protected), so you could do the following: In[1]:= in[1]:= 1+2 and the interpreter would evaluate it (though the values of In[1] and in[1] would be different). But even with all of the symbols defined, this is not valid Python (according to https://www.pythonanywhere.com/try-ipython/ https://www.pythonanywhere.com/try-ipython/): In [1]: in=[] In [2]: in[0]:1+2 File "<ipython-input-2-b9cd4c9ee15d>", line 1 in[0]:1+2 ^ SyntaxError: invalid syntax The fact that this trivial expression is valid in Mathematica and not in IPython by itself says nothing about the relative merits of each system. IPython could be modified to use another notation for the input/output arrays, and Mathematica would work just as well if it were changed to use some syntactically incorrect notation. But what I was attempting to show is an example of how consistent Mathematica is.
- guipsp 13y ago>the assignment isn't syntactially correct Python. It is.
- U2EF1 13y agowat
- deleted 13y ago[deleted]