Next: , Up: compiler   [Index]


17.1 Introduction to the compilation process

An expression in the core language is Scheme code fully expanded in which: no syntactic bindings are present; all the lexical bindings have a unique name represented by a lex gensym; all the top level lexical bindings are associated to a loc gensym used to hold the binding’s current value. The compiler is used to process:

these symbolic expressions must be compiled after correct initialisation of location gensyms for:

The compiler recognises the following core language forms, whose semantics is similar to the corresponding standard language syntax:

(library-letrec* ((?lhs ?loc ?rhs) ...) ?body)
(quote ?datum)
(if ?test ?consequent ?alternate)
(set! ?lhs ?rhs)
(begin ?body0 ?body ...)
(let     ((?lhs ?rhs) ...) ?body)
(letrec  ((?lhs ?rhs) ...) ?body)
(letrec* ((?lhs ?rhs) ...) ?body)
(case-lambda (?formals ?body) ...)
(annotated-case-lambda ?annotation (?formals ?body) ...)
(lambda ?formals ?body)
(foreign-call "?function-name" ?arg ...)
(primitive ?prim)
(annotated-call ?annotation ?fun ?arg ...)
?lex
(?func ?arg ...)
(typed-expr ?expr ?core-type-name)

where: a standalone ?lex atom is a lex gensym, interpreted as reference to binding; ?lhs stands for “left–hand side” and it is a lex gensym; ?rhs stands for “right–hand side”; ?loc is a loc gensym; ?prim is a symbol representing the public name of a core lexical primitive.


Next: , Up: compiler   [Index]