Lambda, the Ultimate Label

Twobit is based on viewing lambda expressions as assembly language labels that have been augmented by a list of symbolic names for the registers that are live at that label. The simplicity of this view results from allocating all non-local, non-global variables on the heap. Aggressive lambda lifting makes this practical by eliminating all non-local variables except for those that would have to be allocated on the heap anyway. The eliminated non-local variables become additional arguments to lambda expressions, which means they will be allocated in registers.

Most optimizations used in Twobit are well-known, but a few are new or unusual:

The intermediate form used by the front end is a restricted subset of Scheme. The intermediate form used by the back end is assembly code for a hypothetical MacScheme machine.

Pass structure

  1. Standardization of syntax
  2. Optimization
  3. Flow analysis (prototype, not yet released)
  4. Code generation
  5. Local optimization
  6. Assembly


Obsolete benchmarks

Last updated 4 January 1999.