Skip to content

The Compiler

Siddhartha Kasivajhula edited this page Aug 26, 2023 · 6 revisions

This is a placeholder for a guide to understanding how the compiler is implemented, as well as possible avenues for possible optimization, workflows and tools for validating performance and checking compiled output at various stages, etc.

Layout

TODO.

Theory of Optimization

Functional, immutable. No accidental side-effects.

Optimizations

Stream fusion.

Workflows and Tools

  • Using environment variables like PLT_LINKLET_SHOW_CP0=1.
  • Inspecting compiler output at intermediate stages.
  • Inspecting expansions using raco expand.
  • Gotchas: stale compilation. Use racket -y.

Research Directions

  • Alternative layouts - E-graphs, etc.
  • Applying stream fusion to core routing forms (may involve new forms of fusion that aren't exactly the traditional kind -- especially to handle multiple values, but also potentially for combinators like -<).
  • Avoiding values->list->values at the level of interface macros, and in host expressions that are subexpressions of flows.
Clone this wiki locally