3. Language specification

A program text is compiled into a function by Program.compile This chapter specifies how compilation is done.

First, a program text is analyzed as a sequence of tokens, and then parsed as an abstract syntax tree, as specified in Syntax.

The abstract syntax tree is transformed into a sequence of abstract instructions as specified in Semantics. The function compiled by Program.compile behaves as if it contains the sequence of abstract instructions.

Evaluation of abstract instructions is specified in Evaluation.