Jump in!
Rakudo™ is a compiler for Raku code. Install it and you're all set to run Raku programs!
Download RakudoMany new features greatly advance our tradition of expressive and feature-rich programming
- Object-oriented programming including generics, roles and multiple dispatch
- Functional programming primitives, lazy and eager list evaluation, junctions, autothreading and hyperoperators (vector operators)
- Parallelism, concurrency, and asynchrony including multi-core support
- Definable grammars for pattern matching and generalized string processing
- Optional and gradual typing
grammar Parser {
rule TOP { I <love> <lang> }
token love { '♥' | love }
token lang { < Raku Perl Rust Go Python Ruby > }
}
say Parser.parse: 'I ♥ Raku';
# OUTPUT: 「I ♥ Raku」 love => 「♥」 lang => 「Raku」
say Parser.parse: 'I love Perl';
# OUTPUT: 「I love Perl」 love => 「love」 lang => 「Perl」
start { sleep 1.5; print "hi" }
await Supply.from-list(<A B C D E F>).throttle: 2, {
sleep 0.5;
.print
}
# OUTPUT: ABCDhiEF
# No floating point noise:
say 0.1 + 0.2 == 0.3; # OUTPUT: True
say (1/13 + 3/7 + 3/8).raku; # OUTPUT: <641/728>
# Infinite list of primes:
my @primes = ^∞ .grep: *.is-prime;
say "1001ˢᵗ prime is @primes[1000]";
# Lazily read words from a file
.say for '50TB.file.txt'.IO.words;
Want to see more? Visit Raku examples page