Skip to main content

Online Raku Compiler

Write Raku, press run and read the output in seconds. Nothing to install and nothing to configure.

How it works

Free, no install, works on laptop and phone.

What is an online Raku compiler?

An online Raku compiler is a free tool that lets you write Raku code in your browser and run it to see the output, with nothing to install. On Techsnap you can add input, run a program in seconds and use it on a laptop or a phone.

Updated December 2026

How to run Raku code online

  1. Step 1

    Write your Raku code

    Open the editor and type or paste your Raku program. Syntax colours and indentation help you spot mistakes as you go.

  2. Step 2

    Press Run

    Your code is sent to a secure server that compiles and runs it. Add any input the program needs in the Input box first.

  3. Step 3

    Read the output

    Results and error messages appear below the editor within a few seconds. Fix, edit and run again as often as you like.

Everything you need to code in Raku

Nothing to install

No Raku setup, PATH or version problems. It works on a college lab PC or a phone.

Input support

Give your program input the same way a judge or exam platform does, then check the output.

Instant results

Most runs finish in a second or two, so you can try an idea and see what happens right away.

Free to start

Run code without paying. A free Techsnap account gives you more runs and saves your work.

Raku code examples

Open the editor, paste one of these examples in and run it. Change a value and run it again to see what happens.

Hello World in Raku

say "Hello, Techsnap!";

Variables and types

my $name = "Asha";
my Int $age = 21;
my $marks = 87.5;
my $passed = True;

say "$name $age $marks $passed";
say $age.WHAT;

If, elsif and else

my $marks = 72;

if $marks >= 90 {
    say "Grade A";
} elsif $marks >= 60 {
    say "Grade B";
} else {
    say "Needs work";
}

Loops

for 1..3 -> $i {
    say "for: $i";
}

my $n = 3;
while $n > 0 {
    say "while: $n";
    $n--;
}

Subroutines

sub square(Int $x) {
    return $x * $x;
}

sub greet(Str $name, Str $greeting = "Hello") {
    return "$greeting, $name!";
}

say square(7);
say greet("Asha");

Arrays and hashes

my @nums = 4, 9, 12, 15, 20;
@nums.push(25);
say @nums.map(* * 2);
say @nums.grep(* %% 2);
say @nums.sum;

my %marks = DSA => 90, DBMS => 82;
say %marks<DSA>;
for %marks.sort -> $pair {
    say "$pair.key(): $pair.value()";
}

Classes

class Student {
    has Str $.name;
    has Int $.marks;

    method summary() {
        return "$!name scored $!marks";
    }
}

my $s = Student.new(name => "Ravi", marks => 78);
say $s.summary;

Error handling with try and CATCH

try {
    my $age = +"twenty";
    die "Age must be a number" unless $age.defined && $age == $age;
    CATCH {
        default { say "Caught: " ~ .message }
    }
}
say "Done";

Regular expressions

my $text = "Order 4521 shipped on 2026-12-02";

if $text ~~ / (\d ** 4) '-' (\d ** 2) '-' (\d ** 2) / {
    say "year=$0 month=$1 day=$2";
}

say $text.subst(/\d+/, '#', :g);

Lazy lists and ranges

my @squares = (1..5).map({ $_ ** 2 });
say @squares;

my @evens = (1..Inf).grep(* %% 2).head(5);
say @evens;

How to take input in Raku online

Raku reads a line of standard input with get. Convert it to a number with .Int, and split a line of values with .words.

my $n = get.Int;
my @nums = get.words.map(*.Int);

say "count: $n";
say "sum: ", @nums.sum;

Common Raku errors and how to fix them

Variable '$x' is not declared
Declare it with my before using it. Raku requires declarations under its default strict mode.
Type check failed in assignment
A value does not match the declared type, such as a string assigned to an Int variable. Convert it or change the type.
Cannot resolve caller ...
A function was called with arguments that no definition accepts. Check the number and types of arguments.
Two terms in a row
A comma, operator or semicolon is missing between two values. Check the line shown.

Who uses an online Raku compiler

Students and learners

Practise Raku for class assignments and exams without installing anything.

Teachers and mentors

Share a short program in a lesson and let students run and change it on their own devices.

Interview candidates

Rehearse Raku questions in the same plain editor many online tests use.

Working developers

Check a snippet or an API behaviour in seconds without opening an IDE.

Writers and bloggers

Test code samples so the examples in your tutorials really run.

Teams

Paste a reproducible example into a ticket or chat so everyone sees the same result.

Online compiler vs local Raku setup

Techsnap online compilerLocal setup
Setup timeNone, open the pageInstall Raku, set PATH, pick a version
Works on any deviceYes, any modern browserOnly the machine you set up
Best forPractice, quick tests, learningLarge projects and long-running work
Extra librariesStandard library onlyAnything you can install

About Raku

What is Raku?

Raku, formerly known as Perl 6, is a modern, multi-paradigm language designed from scratch by the Perl community. It has powerful text processing, built-in concurrency, optional types and a very expressive syntax.

What is Raku used for?

Text processing, scripting, parsing with grammars, and exploring language ideas. Its grammars make building parsers much easier than in most languages.

Raku for beginners

Start with say, my variables, for loops and subs. Learn the sigils ($ scalar, @ array, % hash) and then ranges, map, grep and classes.

Raku vs Perl

They are different languages in the same family. Raku is newer, more consistent and has built-in types, classes and concurrency, while Perl 5 has a far larger set of libraries and existing code.

Why use an online Raku compiler?

Installing Raku with Rakudo takes a few steps. An online Raku compiler lets you explore the language and its regex-like grammars right away.

Raku career opportunities

Jobs that specifically ask for Raku are rare. Its ideas in text processing and concurrency are useful in any scripting role.

Explore more online compilers

Frequently asked questions

Is this online Raku compiler free?

Yes. Write and run Raku code in your browser for free, with nothing to install. A free Techsnap account gives you more runs and saves your work.

Is Raku the same as Perl 6?

Yes. Perl 6 was renamed Raku in 2019 to show it is a separate language from Perl 5.

How do I take input in Raku online?

Use the Input box and read lines with get, as shown on this page.

Can I run Raku on my phone?

Yes. The editor, input and output work in a mobile browser, so you can practise without a laptop.

Ready to write Raku code?

Open the editor and run your first program in under a minute.