It seems that both math
and wolframscript
can be used to run Mathematica
scripts on the command line. Which one I should use, are they cross-compatible and what are the differences?
1 Answer
math
starts Mathematica as an application or in shell. This is the full application with all built-ins and loaded packages. Graphics and data types can be input and output.
wolframscript
is a reduced modern innovative variant of Mathematica. The set of built-ins available are dependent on the monthly abonnement on the web platform web Mathematica in my case. wolframscript is independently licensed from Mathematica or other Wolfram Inc products.
For most younger, it is very important to get the knowledge from Wolfram Alpha to advance better and faster. Mathematica provides more built-ins. A good orientation provides the online web platform Web Mathematica some times web platform, wolfram online.
The most important difference is the missing notebook interface, help features, graphics are not displayed, no interactivity, the formatting of help like ? or Information is different. It is like the documentation provided with the used shell.
It works in shell of choice and has more kind of OS near functionality. It is a script version of Mathematica otherwise. Batch processing and calculation that run safely are a good choice in comparison to the Mathematica interface or the web platform. It has obviously the In-Out-concept that is common to Mathematica-based apps.
Wolframscript is free or cheaper for short time uses than Mathematica and therefore much more attractive for low budgets. concepts for code creating and management and storage are needed for both.
There are cases like the update to Catalina on MacOS where Wolframscript worked and Mathmatica needed to be updated to version 12 and 64bit in complete.
-
2$\begingroup$ "innovative variant of Mathematica". Why is this innovative? I've seen reduced versions of flagship products released by other software developers. $\endgroup$ Apr 30, 2020 at 19:37
-
6$\begingroup$ Most of this description is incorrect and seems to refer to differences between Mathematica and the free Wolfram Engine (which does contain all the function which are available in Mathematica).
wolframscript
is not a different product. It is a way to invoke the Mathematica kernel. You can run scripts withwolframscript
or withmath -script
and there are some differences in behaviour. $\endgroup$– SzabolcsApr 30, 2020 at 19:39 -
$\begingroup$ Thanks @Szabolcs and @user2432923. Indeed I was not referring to the free engine. I have found little documentation on scripts using
math -script
, but somehow my install doesn't havewolframscript
, so in first instance, I was wondering if I could just substitute the commands. But also which one would be future-proof, more widely used etc. $\endgroup$– DanielMay 2, 2020 at 14:39