Mathics3 Core Interpreter¶
At its heart, the Mathics3 interpreter works over a generalization of an S-expression, called an M-expresssion. An M-expression is a nested and/or sequenced lists, pretty much the same as simple Lisp interpreters work, except the head element can be an expression rather than just a simple function name. See also Everything is an Expression.
When you enter a string to Mathics3 there is a 3-step process:
the input string is parsed to
FullForm
The
FullForm
M-expression is evaluated giving another M-expressionThe result is formatted to the kind of output desired. Formatting can cause additional evaluations to occurs
This is mentioned from the user perspective in the Figure “Steps in the operation of Wolfram Language”
Each of the above steps can be involved, so we break these down below.
- Session
- Scanning
- Parsing
- AST, M-Expression, General List: same thing
- Evaluation of an Expression
- Pattern Matching in Evaluation
- Rules
- Forms, Boxes, and Formats
- Python Modules in Mathics-Core
- Object Classes
- Glossary