Chapter 12 · 31 July – 17 September

RakuAST and slangs

RakuAST is the syntax tree Rakudo is moving its front end to, and a public API programs can use: build a tree, print it back as Raku, run it. For a tree-walking interpreter, adopting it as the internal tree would have been expensive. Raku++ took a different route: its RakuAST is a view built on request, and it cost the ordinary path nothing. Then slangs ran for real, lifting the restraint the compiler had been built on.

489RakuAST classes, generated from Rakudo's own list
72.9%of Rakudo's nodes reproduced on the shared corpus
−1.3%mean time over sixteen kernels with RakuAST in (worst +2.7%)
11languages you can write Raku in with use L10N::XX at v3.28.0 (14 now)
The turnRakudo compiles its tree and then runs something else. A tree-walker runs its tree, on every visit, for as long as the program runs. For fib, the RakuAST tree has 39 nodes where Raku++'s own has 17. So RakuAST in Raku++ is built only when .AST is called, over the parse the engine already has.

Measured, then left out

Two things were not built, because measurement said not to. .parent answers Nil for every tree a program can actually obtain in Rakudo, and storing a parent link would make every tree a reference cycle in an engine that counts references. And a RakuAST node is a graph, not a tree: the same node can be reached along two paths.

Raku in your own language

With use L10N::DE; (or JA, AF, CY, EO, FR, HU, IT, NL, PT, ZH) a program is written with that language's keywords. In Raku++ it is a rewrite of the token stream between the lexer and the parser, and it needs no flag. Rakudo 2026.08 needs RAKUDO_RAKUAST=1 for these modules. Latvian, Russian and Ukrainian followed on 19 September.

A formatter

rakupp --fmt rewrites a program's layout and refuses whenever the result would parse differently. Over 757 files in the repository it refused once; over 954 corpus programs, never; over 723 installed ecosystem modules, ten times.

Slangs, for real

A slang is a module that changes how Raku is parsed: Roman numerals, number bases, emoji operators. The first attempt on 9 September recognised one slang by name and imitated it. It was reverted the same day. The plan was rewritten to run the slang's own code instead. On 13 September slangs ran: the module is loaded at use time in a second interpreter, and its tokens become seams in the C++ lexer.

v4.0.0 shipped it: eight slangs run their own tokens, and Slang::Tuxic runs as modes. It is also the point where the founding restraint of the compiler chapter was lifted: the parser now runs user code, and programs still compile.