StrongerXi / soc

Compiler for a subset of OCaml
1 stars 0 forks source link

Closure #15

Closed StrongerXi closed 3 years ago

StrongerXi commented 3 years ago

Design and implement Closure Intermediate Representation (CIR).

What it does:

  1. Eliminate module; a program is function definitions plus a main expression.
  2. Use explicit closure construction to make variable capturing explicit.
  3. Uncurrying: applications with insufficient # of args are turned into a function.
  4. Manifest primitive ops (they were represented as functions in AST).

What it doesn't do:

  1. linearize program into instruction sequence