CONST is the first Tiny Interpreters interpreter. A complete program is just a non-negative integer literal:
123That lets us follow a complete program from source text to an evaluated value:
flowchart TD
A["123"] -->|parse| B["Program (Const 123)"]
B -->|evaluate| C["VNumber 123"]
For a closer look at each step, read CONST: From Source Text to Value.
To try it, you'll need Nix with flakes enabled.
nix develop
elm replThen:
import CONST.Interpreter as I
I.run "123"
-- Ok (VNumber 123)