Rakumap

Machine-written Raku programs, each run under the reference compiler and under Raku++.

Rakumap writes small Raku programs by machine, runs each one under Rakudo 2026.08, the reference compiler, and under Raku++ 5.0.0-g312cde8e, the engine behind this site, and compares what they print. Below are 207 of those programs, sorted by topic. Open one to see both outputs side by side, change the code and run it yourself.

192of 207 agree with Rakudo
14print something different
1agree, but warn differently

Recorded 2026-09-29 with Rakudo 2026.08 and Raku++ 5.0.0-g312cde8e.

How to read these results
  • ✓ Same as Rakudo Raku++ prints exactly the same text as Rakudo.
  • ✓ Both reject it The program is broken on purpose, and both compilers refuse to run it. That is the right answer.
  • ≠ Differs from Rakudo The outputs are not the same. That is a lead to investigate, not automatically a Raku++ bug: sometimes both answers are valid Raku, and sometimes Rakudo is the one that is wrong.
  • ! Warnings differ Same output, but only one compiler printed a warning.

Most programs share a four-line tail that prints what they computed: its type, its .raku representation, its string form and its truth value. The cards show only the part before that tail.

Literals 10 of 12 agree

Writing values straight into code: numbers in other bases, rationals, pairs, strings, versions.

Variables 12 of 12 agree

Assignment, binding, scope, state variables and dynamic variables.

Numbers 9 of 10 agree

Integers, rationals, floating point, complex numbers and infinities, mixed together.

Operators 11 of 12 agree

Arithmetic, comparison, junctions and reductions over the same pair of values.

Control flow 12 of 12 agree

if and unless, loops, given/when, gather/take and early returns.

Subroutines 12 of 12 agree

Declaring and calling subs, closures and recursion.

Signatures 12 of 12 agree

How arguments bind to parameters: defaults, named, slurpy, typed and multi subs.

Arrays and hashes 10 of 10 agree

Arrays, hashes and scalar containers: what gets copied, what gets shared, what flattens.

Types 11 of 12 agree

Type objects, roles, enums, subsets and smartmatching against types.

my Int @source = (7, 8);
my $value = (@source.^name, @source.of.^name, @source.Array, @source ~~ Positional);
≠ Differs from Rakudo#1
role Named { method label { self.^name } }
class Item does Named { }
my $source = Item.new;
my $value = ($source.label, $source ~~ Named, Item.^roles.map(*.^name).Array);
✓ Same as Rakudo#2
my $source = 5;
my $value = ($source.^name, $source.WHAT.^name, $source ~~ Int);
✓ Same as Rakudo#3
role Tagged { method tag { "mixed" } }
my $source = 4 but Tagged;
my $value = ($source + 1, $source.tag, $source ~~ Tagged);
✓ Same as Rakudo#4
my $source = "3";
my $value = ($source.Int, $source.Numeric, $source.Bool, $source.Str);
✓ Same as Rakudo#5
my $source = answer => 2;
my $value = ($source.^name, $source.key, $source.value, $source ~~ Pair);
✓ Same as Rakudo#6
enum Direction <North East South West>;
my $source = Direction.enums<North>;
my $value = ($source, Direction::East.value, Direction.enums.keys.sort.Array);
✓ Same as Rakudo#7
sub classify(Int $x where * > 0) { ($x.^name, $x * 2) }
my $value = classify(8);
✓ Same as Rakudo#8
class Parent { method value { 2 } }
class Child is Parent { method value { callsame() + 7 } }
my $source = Child.new;
my $value = ($source.value, $source ~~ Parent, Child.^mro.map(*.^name).Array);
✓ Same as Rakudo#9
my $value = (Int.defined, Nil.defined, 0.defined, "".defined);
✓ Same as Rakudo#10
my $source = Int;
my $value = ($source.^name, $source.defined, $source ~~ Int, $source.HOW.^name);
✓ Same as Rakudo#11
subset Small of Int where 0..10;
my Small $source = 4;
my $value = ($source, $source.^name, $source ~~ Small, $source ~~ Int);
✓ Same as Rakudo#12

Classes and methods 12 of 12 agree

Attributes, inheritance, roles, private and multi methods, delegation.

class Counter { has $.base; method add($x) { self.base + $x }; method twice($x) { self.add($x) * 2 } }
my $value = Counter.new(base => 7).twice(3);
✓ Same as Rakudo#1
class Base { method score { 2 } }
class Derived is Base { method score { callsame() + 6 } }
my $value = Derived.new.score;
✓ Same as Rakudo#2
class Box { has $.value; method doubled { $.value * 2 } }
my $value = Box.new(value => 5).doubled;
✓ Same as Rakudo#3
role Measured { method measure { self.value * 2 } }
class Item does Measured { has $.value }
my $value = Item.new(value => 4).measure;
✓ Same as Rakudo#4
class Point { has Int $.x is rw; has Int $.y }
my $point = Point.new(x => 3, y => 4);
$point.x += 3;
my $value = ($point.x, $point.y);
✓ Same as Rakudo#5
class Math { method triple($x) { $x * 3 } }
my &operation = Math.^find_method("triple");
my $value = operation(Math.new, 2);
✓ Same as Rakudo#6
class Parent { method label { "parent" } }
class Child is Parent { }
my $value = (Child.new.label, Child.^mro.map(*.^name).Array);
✓ Same as Rakudo#7
class Dynamic { method FALLBACK($name, |c) { "$name:" ~ c.elems } }
my $value = Dynamic.new.unknown(8, 9);
✓ Same as Rakudo#8
class Render { multi method show(Int $x) { "int:$x" }; multi method show(Str $x) { "str:$x" } }
my $r = Render.new;
my $value = ($r.show(7), $r.show("7"));
✓ Same as Rakudo#9
class Factory { method build(::?CLASS:U: $x) { ::?CLASS.new(:value($x)) }; has $.value }
my $value = Factory.build(6).value;
✓ Same as Rakudo#10
class Engine { method power($x) { $x * 3 } }
class Vehicle { has Engine $.engine handles <power> }
my $value = Vehicle.new(engine => Engine.new).power(5);
✓ Same as Rakudo#11
class Secret { method !twice($x) { $x * 2 }; method reveal($x) { self!twice($x) } }
my $value = Secret.new.reveal(4);
✓ Same as Rakudo#12

Regexes 12 of 12 agree

Matching, captures, quantifiers, comb, split and subst.

Grammars and match trees 12 of 19 agree

Grammars assembled at random from alternations, quantifiers, subrule calls and captures, with every field of the resulting Match printed.

grammar G {
    rule TOP { \d+ }
    rule r0 { <[a..c]> }
}
…
✓ Same as Rakudo#1
grammar G {
    token TOP { $<k0>=[ \w <[a..c]>+ \w | \w <[a..c]>+ 'b' | \w <[a..c]>+ ] | <r0> | [ <?after 'x'> <k1=r0> || <?after 'x'> \d+ || <?after 'x'> <r0> ] }
    token r0 { <[a..c]> }
    rule r1 { \w }
…
✓ Same as Rakudo#2
grammar G {
    token TOP { 'b' }
    regex r0 { \w+ }
    token r1 { <.r0> <k0=r0> <k0=r0> | <.r0> <k0=r0> }
…
✓ Same as Rakudo#3
my token r0 { \w+ }
my regex r1 { [ <r0> ] [ 'a' 'x' || 'a' <k1=&r0> ] }
my token r2 { <r1> <r1> <&r0> <k1=&r1> 'a' }
my rule r3 { [ <r2> <r2> ] }
…
✓ Same as Rakudo#4
my regex r0 { \w }
my @inputs = "  b a 1 0 2 - 1 <", "  b _ 2 a _ - b <", "  1 bc b 1 b c = - c ";
for @inputs.kv -> $i, $in {
    say "#$i input {$in.raku}";
…
✓ Same as Rakudo#5
grammar G {
    rule TOP { [ ( 'a' ) || $<k0>=[ <?after 'b'> ] ] <[a..c]>+ }
    token r0 { \d+ }
    token r1 { 'b' }
…
✓ Same as Rakudo#6
grammar G {
    regex TOP { <k0=r1> }
    token r0 { \d+ }
    regex r1 { \w+ }
…
✓ Same as Rakudo#7
grammar G {
    rule TOP { <[a..c]>+? [ 'b' \d+ ] }
    rule r0 { \d }
    rule r1 { \w+ }
…
✓ Same as Rakudo#8
grammar G {
    token TOP { [ <r0> [ <[a..c]>+ ] ** 2 ]* \d }
    token r0 { \d }
}
…
✓ Same as Rakudo#9
grammar G {
    token TOP { '=' | [ $<k1>=[ <r1> ] | 'x' ] | $<k1>=[ <?r0> <!r0> <r0> ] }
    rule r0 { <[a..c]>+ }
    rule r1 { <[a..c]> }
…
✓ Same as Rakudo#10
grammar G {
    regex TOP { <r2> }
    token r0 { <[a..c]> }
    rule r1 { <[a..c]> ',' \w+ '=' <k1=r0> <?r0> }
…
✓ Same as Rakudo#11
grammar G {
    token TOP { <.r0> }
    regex r0 { <[a..c]> }
    token r1 { [ <[a..c]>+ ] ** 1..2 % '-' }
…
✓ Same as Rakudo#12
my token r0 { \w }
my token r1 { <r0> \w }
my rule r2 { \w+ }
my @inputs = "b", ")223bc>", "";
…
≠ Differs from Rakudo#13
grammar G {
    regex TOP { <k0=r0> [ <.r3> <[a..c]>+ <!r2> ] }
    token r0 { \w }
    rule r1 { 'b' <[a..c]>+ \w || 'b' <[a..c]>+ 'x' || 'b' <[a..c]>+ <r0> }
…
≠ Differs from Rakudo#14
my regex r0 { <[a..c]> }
my regex r1 { \w+ }
my @inputs = "c1a", "ab", "";
for @inputs.kv -> $i, $in {
…
≠ Differs from Rakudo#15
grammar G {
    regex TOP { ( <r0> ) | [ <[a..c]>+ ]+ <r0> '-' <[a..c]> <r1> <?r0> | [ <[a..c]> ] [ <.r0> | <.r0> ] }
    regex r0 { \d }
    regex r1 { <[a..c]> }
…
≠ Differs from Rakudo#16
grammar G {
    rule TOP { <r1> | <k1=r2>* <r2> <k0=r1> <k1=r2> $ }
    token r0 { \d }
    rule r1 { <[a..c]> }
…
≠ Differs from Rakudo#17
my token r0 { \w }
my token r1 { $<k0>=[ \w ] <&r0> }
my rule r2 { <r0> }
my @inputs = "0", "1_", "";
…
≠ Differs from Rakudo#18
my rule r0 { \d+ }
my rule r1 { \d+ }
my token r2 { <[a..c]> }
my token r3 { \d+ <k1=&r0> || \d+ <r0> }
…
≠ Differs from Rakudo#19

Unicode 12 of 12 agree

Characters versus codepoints, case mapping and text outside ASCII.

Built-in functions 12 of 12 agree

Everyday routines: abs and sqrt, sort, unique, zip, rotor, sprintf and friends.

Phasers 12 of 12 agree

Code that runs at a particular moment: BEGIN, INIT, END, ENTER, LEAVE, FIRST, LAST, CATCH.

Concurrency 12 of 12 agree

Promises, start/await, channels, supplies, locks and threads — small and bounded.

Programs that must fail 9 of 12 agree

Deliberately broken code. The correct result is a compile-time error, not output.