Lowering to Bytecode

Why lower?

  • AST is structured, bytecode is linear
  • Linear IR is easy to execute and test

Stack machine rules

  • Push operands
  • Emit operator last (postfix)

Calls

  • Lower args in order
  • CALL name arity

Design space

  • Stack IR is a start
  • Other IRs can replace it later
1 / 1
Use arrow keys or click edges to navigate. Press H to toggle help, F for fullscreen.