Class Compiler

java.lang.Object
convex.core.lang.Compiler

public class Compiler extends Object
Compiler class responsible for transforming forms (code as data) into an Op tree for execution. Phases in complete evaluation:
  1. Expansion (form -> AST)
  2. Compile (AST -> op)
  3. Execute (op -> result)
Expanded form follows certain rules: - No remaining macros / expanders in leading list positions TODO: consider including typechecking in expansion phase as per: http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf "A language that doesn't affect the way you think about programming is not worth knowing." ― Alan Perlis
  • Field Details

    • INITIAL_EXPANDER

      public static final AFn<ACell> INITIAL_EXPANDER
      Initial expander used for expansion of forms prior to compilation. Should work on both raw forms and syntax objects. Follows the "Expansion-Passing Style" approach of Dybvig, Friedman, and Haynes
    • QUOTE_EXPANDER

      public static final AFn<ACell> QUOTE_EXPANDER
      Expander used for expansion of `quote` forms. Should work on both raw forms and syntax objects. Follows the "Expansion-Passing Style" approach of Dybvig, Friedman, and Haynes
    • QUASIQUOTE_EXPANDER

      public static final AFn<ACell> QUASIQUOTE_EXPANDER
      Expander used for expansion of `quasiquote` forms. Should work on both raw forms and syntax objects. Follows the "Expansion-Passing Style" approach of Dybvig, Friedman, and Haynes
  • Constructor Details

    • Compiler

      public Compiler()