Next: compiler conv, Up: compiler [Index]
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:
library
forms and full R6RS programs the expander has
transformed into library-letrec*
core language forms.
eval
, for
example read by the REPL, either in the context of a stateless
environment or in the context of a stateful interactive environment.
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: compiler conv, Up: compiler [Index]