Raku

A language with a great many ideas in it. Every example below is a real editor — change it, run it, break it. Nothing is installed and nothing is sent to a server.

One name, many implementations

Multiple dispatch picks the right body from the arguments' types and shapes, so you write what each case means instead of unpicking it inside one function.

multi greet(Int $n) { "the number $n" }
multi greet(Str $s) { "the string '$s'" }
multi greet(@list)  { "a list of {@list.elems}" }

say greet($_) for 42, "hi", [1, 2, 3];

Sequences that never end

The ... operator continues a sequence from the pattern you started, and lists are lazy — so an infinite one costs nothing until you ask for a piece of it.

my @powers = 1, 2, 4 ... *;
say @powers[^10];

my @fib = 1, 1, * + * ... *;
say @fib[^12];

Grammars are part of the language

Parsing is not a library here. A grammar is a kind of class, its tokens are named and reusable, and what comes back is a match tree you can index.

grammar Date {
    token TOP   { <year> '-' <month> '-' <day> }
    token year  { \d ** 4 }
    token month { \d ** 2 }
    token day   { \d ** 2 }
}

my $m = Date.parse('2026-07-28');
say "year $m<year>, month $m<month>, day $m<day>";

Decimals that add up

0.1 + 0.2 == 0.3 is True. Raku keeps decimal literals as exact rationals rather than binary floating point, so money and measurements behave the way you were taught they would.

say 0.1 + 0.2 == 0.3;

say (1/3).nude;      # numerator and denominator
say 1/3 + 1/6;

One value that is several values

A junction holds many values at once and collapses to a single answer when you compare against it — no loop, no grep.

my $n = 42;

say so $n == any(3, 42, 100);
say so $n  > all(1, 2, 3);

Operators that operate on operators

[+] folds an operator across a list; »*» applies one to every element. Both are built from ordinary operators rather than being special cases.

my @r = 1, 2, 4, 8;

say [+] @r;          # reduce with +
say @r »*» 2;        # apply * to each
say (1..5).map(* ** 2);

Where to go