3 ms·
The most obvious comparison is in syntax. Easier syntax means less user time spent. In Symbolica, an example from the documentation from symbolica import E
by abdullahkhalids 2y ago
The most obvious comparison is in syntax. Easier syntax means less user time spent. In Symbolica, an example from the documentation
from symbolica import Expression
x = Expression.var('x')
f = Expression.fun('f')
e = x + f(x) + 5
e = e.replace_all(x, 6)
print(e)
In Mathematica, the same thing is
e = x + f[x] + 5
e /. x -> 6
What I find striking is that, we know that Python is the most popular language because you don't have to declare your variables or your function headers, and can just start writing the logic of your computation. Then, people keep inventing these mathematics programs in Python, that need you to declare your variables before using them.
- forgotpwd16 2y agoShould note the `/.` is syntactic sugar (or special syntax) for `ReplaceAll[]` function. And basically anything can be written as M-expressions. For any expression this form can be retrieved with `FullForm[expr]` (may have to use `Hold[expr]`). So for your example with no special syntax: Set[e,Plus[5,x,f[x]]] ReplaceAll[e,Rule[x,6]]
- SPACECADET3D 2y agoYou can also just use Expression.parse('x+f(x)+5') Of course, to refer to a specific variable of the CAS in Python, you need to bind it to a Python variable. There is no way around this. In the end most of the time of the user is not spent on syntax, but on designing algorithms. With Mathematica, you are locked into the Mathematica ecosystem. With Symbolica / sympy and other CASs that are libraries, you can use all the familiar data structures of the language you are coding in.