Hasty Briefsbeta

Bilingual

RakuAST Grant Report

a year ago
  • #Raku
  • #Open Source
  • #Compiler Development
  • The RakuAST project involved rewriting and redesigning the compiler frontend for Raku, focusing on parsing, checks, optimizations, and generating low-level representations.
  • Initial grant work had basic infrastructure in place, supporting simple programs with variables, classes, functions, and method calls, but many advanced language features remained unimplemented.
  • Development approach was methodical: fixing one spec test at a time, ordered lexicographically and by fundamental language concepts, though advanced syntax in tests sometimes required implementing features out of order.
  • Timing and sequencing were the most challenging aspects, as Raku's compile-time execution of code (e.g., roles, BEGIN blocks) required precise order of operations, which was undocumented and emergent from the old compiler.
  • The project exceeded initial estimates, with over 900 commits due to the long tail of special cases and error checks, contrary to the expectation that fixes would increasingly resolve multiple tests.
  • A secondary goal was enabling RakuAST to bootstrap the Rakudo compiler without the old frontend, introducing challenges like circular dependencies and the need for workarounds in accessing object internals.
  • The standard library's extensive use of advanced Raku features uncovered deficiencies not covered by spec tests, which themselves sometimes contained bugs or nonsensical tests due to old compiler quirks.
  • Community contributions were limited by the project's complexity, but key contributors helped with areas like RakuDoc and other components, providing essential support.