|[6 earlier articles]|
|Re: Compilers in six hours firstname.lastname@example.org (1994-05-19)|
|Re: Compilers in six hours chase@Think.COM (1994-05-19)|
|Re: Compilers in six hours email@example.com (1994-05-20)|
|Re: Compilers in six hours firstname.lastname@example.org (Stefan Monnier) (1994-05-22)|
|Re: Compilers in six hours email@example.com (1994-05-24)|
|Re: Compilers in six hours firstname.lastname@example.org (1994-05-24)|
|Re: Compilers in six hours email@example.com (1994-05-25)|
|Re: Compilers in six hours firstname.lastname@example.org (1994-05-26)|
|From:||email@example.com (Ron Cytron)|
|Organization:||Washington University in St. Louis|
|Date:||Wed, 25 May 1994 15:25:31 GMT|
I have students in the first course translate from a C-like language
(extended with nested procedures, and the Algol-68 "everything has a
value" semantics, but cut back on data types and constructs) to a
Scheme-like language. In the target language, the atomic unit of
execution is an Expression, and each has a:
(PushLevel n (LinkExpression k)
(Args (SymbolID s1)
(Locals (SymbolID l1)
which declares the static nesting depth (n), the next outer scope (k), and
the arguments and locals associated with this expression.
I find this an easy target for a one-semester course, and I provide an
interpreter for it, so students can watch their programs execute.
This could be followed up with some low-level code generation, probably
using iburg, or could be the subject of program optimization, which I
teach in a second course.
The next time I teach the first course, I may short-change parsing
somewhat to cover the code generation, so the students do get a feeling
for low-level code issues.
The run-time library is written in this intermediate language, by the way.
There's tech report I could send interested people on this intermediate
language (which I call FrIL).
Return to the
Search the comp.compilers archives again.