Raku FAQ

Short, task-shaped answers to questions people actually ask — how do I, why does this print twice, does Rakudo do the same.

Writing Raku

Containers, itemisation, and why my list has one element
Why does my list have one element? Itemisation, $(…) vs […], and passing lists to routines.

Installing and finding modules
Getting a module and being able to use it: rakupp install, zef, and where both engines look.

Can I write Raku in my own language?
Writing Raku in German, Japanese or Afrikaans: the L10N modules, why Rakudo needs a flag for them and Raku++ does not, and the one declarator that cannot be translated.

What Raku 6.e adds to 6.d
What the 6.e language revision adds to 6.d, and what use v6.e.PREVIEW actually turns on.

Talking to the outside world

Running external commands
Running external commands: run vs shell, capturing output, feeding input, exit codes.

Background processes and Proc::Async
Proc::Async: fire-and-forget processes that outlive the program, bind-stdin pipelines, kill — and where Raku's own docs stand on the survival.

Is HTTP built into the engine?
Is HTTP built into the engine? Sockets are and HTTP is not: what you get with no use, writing a request by hand, and which HTTP modules work on each engine.

Buffering: why output does not appear when you expect it
Why output does not appear when you expect it: out-buffer and flush, the three places output can sit, and the child's own buffer you cannot set from outside.

Compiling, and making it fast

Turning a program into a binary
Turning a program into a binary: --exe vs --aot vs --bundle, and what -O buys.

Why -O is not the default
Why the optimising code generator is opt-in: what a default owes every program, and where -O loses.

My program is slow
My program is slow: what compiling does and does not speed up, with measured numbers.

When something goes wrong

When something goes wrong
When something goes wrong: what a die tells you, --lint, --ast, --cpp, and telling your bug from ours.

The garbage collector
There isn't one: what reference counting buys, what a cycle costs, and when DESTROY actually runs.

How Raku++ works

What kind of compiler is Raku++?
One-pass or multi-pass, LL(1) or LR, is there an IR, a VM, a JIT: the compiler-theory questions, answered one at a time.

How reference counting works
How reference counting works, in Raku terms: what is shared and what is copied, what keeps a closure's frame alive, why DESTROY waits for a sweep, and the cycles you make without noticing.

Hand-written vs. written by hand
Is "hand-written" honest for an AI-built project? The term of art it invokes, and the authorship answer behind it.

Three ways to build a Raku
Three Rakus in active development — Rakudo, Raku++ and mutsu — and the engineering decisions that separate them.

Where Raku++ and Rakudo differ
Where Raku++ and Rakudo differ, in both directions, and the few you will actually meet.