What makes up Mathics?¶
At one time, there was a single Python PyPI installable package that made up this open-source version of the Wolfram language. It included for example a Django-based front end.
However in order to facilitate using the parts of it in other projects or the parts you need it has been broken up into separately installable packages.
This generally reduces the dependency for most of the pieces. And if you only need or want part of Mathics you don’t needed to the code or dependencies you don’t want. For example, if you might now want or need the Django-based front end. If that is the case, then you don’t need to install Django or MySQL which Django uses in our implementation to save worksheet data.
Similarly, if you aren’t interested in Natural-Language Processing (NLP) you don’t need to install NLTK and word lists.
On the there other hand, if you do want everything, we have a separate package called Mathics-omnibus which pull on all of the Mathics-related packages. As part of the github project is a docker setup.
Using this, us can use the full Mathics suite via dockerhub without having to build Mathics or have necessary OS libraries (including Python itself) outside of the docker containers.
The pieces are described next go into the individual Python-packages that make up the Mathics suite.
The Mathics core contains a parser, and evaluator, and some formatting routines.
Over time, formatting routines may be packaged separately
There is also a very rudimentary command-line shell called
The Mathics core required for any work with Mathics.
If you are developing a non-interactive application written in Mathics, you may no more than this.
Front ends Mathics-Django and mathicsscript use mathics core.
Mathics Character Tables and Tokenizer¶
This is the tokeniser or scanner portion for the Wolfram Language.
As such, it also contains a full set of translation between Wolfram Language named characters, their Unicode/ASCII equivalents and code-points.
The scanner inside Mathics Core, but it can also be used for tokenizing and formatting Wolfram Language code. In fact mathics-pygments described in the next section uses this.
Mathics Syntax Highlighting¶
The main diffence between the two is that the character tables are used here. Possibly over time more parts of the scanner will be used as well.
Mathicsscript uses this package.
The Mathics core comes with a very rudimentary command-line shell, if you want fancier shell features such as:
- Prompt toolkit and GNU Readline terminal interaction. This includes
saving command history between sessions.
variable completion, even for symbol names like \[Sigma]
limited ESC keyboard input; for example esc
pesc is π
Syntax highlighting using mathics-pygments
Automatic detection of light or dark terminal background color.
Entering and displaying Unicode symbols such as used for Pi or Rule arrows
There is a separately-installable PyPI package called mathicsscript.
If you prefer, as many do, browser-based interaction with nicely formatted graphics and MathML-formatted output, right now there is a Django-based PyPI package Mathics-Django.
Some of its features:
Extensive online documentation and interactive documentation via Ajax
Integrated graphics and MathML mathematics output via MathJax
Note: in the future we intend to also provide a Jupyter-like interface.
A number of the add-ons are not automatically loaded when Mathics starts, instead can be loaded from within Mathics using the Needs function.
However the Python packages need to have been Python installed outside of Mathics first for this to work.
Below we describe some of these packages. A full list can be found by looking in the Mathics3 organization.
Natural Language Python Module add-on¶
If you want Natural-Language processing, there is an additional PyPI package called pymathics-natlang.
Graph Python Module add-on¶
If you need to do work with Graph Theory or Networks you may want the Graph Python module called pymathics-graph.
Matplotlib Python Module Backend Renderer¶
Currently this is a work in progress and works only in very limited way. It provides graphics rendering using matplotlib.
Asymptote Python Module Backend Renderer¶
Currently this is a work in progress and works only in very limited way. It provides graphics rendering using the asymptote vector graphics language.