PL Pedagogy Poll:

For teaching purposes, what would you call the process of converting a surface syntax tree into a core syntax tree, in an implementation of an interpreter for a programming language?

Compiling
0%
Elaboration
50%
Desugaring
45.5%
Other (comment)
4.5%
Poll ended at .
@joey Is it typed and if so are the types used at all in the conversion/translation? Is the core syntax more or less a sublanguage of the surface syntax or are they related but clearly different languages?

@joey (for me:

  • it's elaboration if it's at all type-directed - that could include an H-M surface language to a rank-1 System F fragment in a pinch
  • it's desugaring if the core is a sublanguage of the surface syntax, so that the output could be thrown through a different language implementation with no notion of "core language"
  • both are technically compiling and this isn't a bad notion to introduce, but precision is a good thing

)

@joey in particular, there are good reasons in general for an efficient interpreter to do something that is very intentionally conceptually compilation and it's worth distinguishing "and we compile to this bytecode for efficiency" from the sort of compilation stages that move through intermediate languages to eg provide a clearly semantics-preserving pipeline even if the last of them does in fact spit out a bytecode