Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Raku is a multi-paradigm language from the Perl family, designed by Larry Wall and the community over roughly fifteen years before its first stable release in 2015. Known as Perl 6 until it was renamed in 2019, it keeps Perl's love of expressive text processing while adding gradual typing, built-in concurrency, lazy lists, and full grammars for parsing. The reference implementation you run here is Rakudo. On XCODX, Raku runs through the Piston sandbox with the core language only, which covers its built-in regex and grammar engine, rational numbers, and rich set of operators. The runtime version is shown in the badge, and there is no toolchain to set up on your own machine.
my $name = prompt("What is your name? ");
my $n = prompt("How many? ").Int;
say "Hello, $name!";
for 1..$n -> $i {
say "$i squared is { $i * $i }";
}
Raku is strong at text processing, scripting, and one-off automation, where its grammars, expressive regexes, and Unicode-aware strings do a lot of work in a few lines. Pick it when a task is heavy on parsing or string manipulation and you value flexibility over raw speed, or when you want a modern successor to Perl scripting. Its startup and runtime performance trail compiled languages, so it is a poor fit for CPU-bound number crunching or low-latency services. In this sandbox it is a great place to experiment with grammars, junctions, and the core language without installing Rakudo or the zef ecosystem.
No. Only the core Raku language and its built-in modules are available. zef downloads modules from the Raku ecosystem over the network, and this sandbox has no network access or dependency install, so ecosystem modules cannot be added.
Use prompt("...") to print a message and read a line, or read directly with $*IN.get. On XCODX you type into the live terminal while the program runs, or paste text into the Stdin Box first, and Ctrl+D closes the stream. Input arrives as a string, so append .Int or .Num to convert it to a number.
Yes. The language was called Perl 6 during development and was renamed Raku in 2019 to signal that it is a distinct member of the Perl family rather than a drop-in replacement for Perl 5. The implementation you run here is Rakudo.
Grammars are a built-in way to define structured parsers using named regex rules, almost like classes for pattern matching. They make Raku strong for parsing configuration formats, small languages, and complex text, all with the core language and no extra modules.
Raku's startup and runtime are slower than compiled languages, though performance has improved a great deal over the years. It is excellent for text processing and scripting where expressiveness matters more than raw speed, and less suited to CPU-bound number crunching.
Raku redesigned the language with consistent sigils, a real object system, gradual typing, lazy lists, and grammars, and it uses a dot for method calls instead of an arrow. It is not source-compatible with Perl 5, although the two share heritage and philosophy.
main.rakuperlprompt()# Raku (formerly Perl 6)
say "Hello from Raku!";
say "Welcome to XCODX Online Compiler!";
# Array operations
my @numbers = 1..10;
say "Numbers: ", @numbers;
say "Sum: ", [+] @numbers;
say "Even: ", @numbers.grep(* %% 2);
# String interpolation
my $name = "XCODX";
say "Running on {$name} Compiler";