Raku by example
Twenty-four self-contained programs, each a page: the source in a live editor, what it prints, and the language features it leans on.
Each program is complete and self-contained — no arguments, no setup, no network. Twenty-one of them run right on their page, in your browser, on Raku++ compiled to WebAssembly; the three that need real threads or sockets are shown with the output they print natively. For snippet-sized pieces of the language rather than whole programs, the tour is the place; for mid-size projects, the showcase.
Graphics & fractals
mandel.raku
The Mandelbrot set as ASCII — loops, complex-plane arithmetic.
sierpinski.raku
The Sierpinski triangle — Rule 90 cellular automaton, bit ops.
life.raku
Conway's Game of Life on a torus — 2-D arrays, given/when.
Grammars & parsing
calculator.raku
Evaluates arithmetic expressions — grammars + an actions class.
json.raku
A JSON parser → native data structure — grammars + actions.
rpn.raku
A postfix (RPN) calculator — stack machine, exact Rat.
Numbers & maths
primes.raku
A short number-theory tour — lazy sequences, big Int.
rationals.raku
Exact rational arithmetic — the Rat tower, continued fractions.
fibonacci.raku
Fibonacci three ways, cross-checked — lazy sequences, bignums.
factorize.raku
Prime factorization, gcd/lcm — number theory, reductions.
pascal.raku
Pascal's triangle & what it encodes — combinatorics, Z+, formatting.
matrix.raku
Linear algebra by hand — nested arrays, reductions.
Algorithms
quicksort.raku
Quicksort, merge sort, one-liner — recursion, .grep, multi-dispatch.
hanoi.raku
Towers of Hanoi — recursion, formatted output.
nqueens.raku
The 8-Queens puzzle — backtracking.
brainfuck.raku
A tiny Brainfuck interpreter — tape/pointer loop, dispatch.
Text & strings
anagrams.raku
Groups words into anagram classes — hashes, .classify.
wordcount.raku
Word-frequency bar chart — Bag, regex, sort by value.
cipher.raku
ROT13 / Caesar / Vigenère — .trans, modular arithmetic.
roman.raku
Roman numerals, both directions — given/when, table-driven logic.
Concurrency & I/O
parallel.raku native
Prime counting across threads — start/await, Channel.
sleep-sort.raku native
The sleep-sort joke algorithm — start, Channel, sleep.
echo-server.raku native
A TCP echo server and its client — IO::Socket::INET.
Curiosities
quine.raku
A program that prints its own source — string self-reference.