dimitriv / Ziria

A domain-specific-language and compiler for low-level bitstream processing.
92 stars 18 forks source link

Don't use the AST labels for types #69

Open edsko opened 9 years ago

edsko commented 9 years ago

Instead, have just enough annotations in the AST that we can compute the type of any subexpression or subcomputation easily.

edsko commented 9 years ago

Plan of attack

  1. make the AST change
  2. define functions expType and compType. this will tell us if we have enough information about types in the AST
  3. update renamer: introduce unique variable names, but leave types alone
  4. update type checker: change Maybe SrcTy to Ty (no more Maybe, and translate from source language to internal language); and similarly for computation types
  5. update rest of the compiler -- should be simple. Any use of labels replaced with use of expType and compType