- Notifications
You must be signed in to change notification settings - Fork379
🦋 Rakudo – Raku on MoarVM, JVM, and JS
License
rakudo/rakudo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is Rakudo, a Raku Programming Language compiler for the MoarVM, JVM and Javascript virtual machines.
Rakudo is Copyright © 2008-2025, The Raku Foundation. Rakudois distributed under the terms of the Artistic License 2.0. For moredetails, see the full text of the license in the file LICENSE.
This directory contains only the Rakudo compiler itself; itdoes not contain any of the modules, documentation, or other itemsthat would normally come with a full Raku distribution. If you'reafter more than just the bare compiler, please downloadthe latestRakudo Star package.
Rakudo is currently the most developed implementation of the Rakulanguage; though there have been other partial implementations in thepast. TheRakudo
compiler hasmoar
,jvm
andjs
backends. Notethat each backend has a slightly different set of features. Forhistorical compilers seehttps://www.raku.org/compilers/.
Recent changes and feature additions are documented in thedocs/ChangeLog
text file.
See theINSTALL.md
file for detailed prerequisites and build andinstallation instructions. CheckCAVEATS.md
for platform specific notes.
The general process for building is runningperl Configure.pl
withthe desired configuration options (common options listed below), andthen runningmake
ormake install
. Optionally, you may runmake spectest
to test your build onRoast,the Official Raku test suite. To update the test suite, runmake spectest_update
.
Installation of Rakudo simply requires building and runningmake install
.Note that this step is necessary for running Rakudo from outside the builddirectory. But don't worry, it installs locally by default, so you don't needany administrator privileges for carrying out this step.
To automatically download, build, and install a fresh MoarVM and NQP, run:
$ perl Configure.pl --gen-moar --gen-nqp --backends=moar
Please be aware, that this will install MoarVM and NQP into your given--prefix
beforeConfigure.pl
exits.
Alternatively, feel free to git clonehttps://github.com/Raku/nqp andhttps://github.com/MoarVM/MoarVM manually and install them individually.
Configuration flags can be passed to MoarVM'sConfigure.pl
using the--moar-option
flag. For example, if you wish to use Clang when GCC is thedefault compiler selected for your OS, use the--compiler
flag:
$ perl Configure.pl --gen-moar --moar-option='--compiler=clang' \ --gen-nqp --backends=moar
If the compiler you want to use isn't known by MoarVM or you have multipleversions of the same compiler installed, the--cc
flag can be used to pass itsexact binary:
$ perl Configure.pl --gen-moar --moar-option='--cc=egcc' \ --gen-nqp --backends=moar
Custom optimization and debugging levels may also be passed through:
$ perl Configure.pl --gen-moar --moar-option='--optimize=0 --debug=3' \ --gen-nqp --backends=moar
For more information on how MoarVM can be configured, view MoarVM'sConfigure.pl.
Note that to run Rakudo on JVM, JDK 1.9 or higher must be installed.To automatically download, build, and install a fresh NQP, run:
$ perl Configure.pl --gen-nqp --backends=jvm
If you get ajava.lang.OutOfMemoryError: Java heap space
error buildingrakudo on the JVM, you may need to modify your NQP runner to limit memoryuse. e.g. edit the nqp-j / nqp-j.bat executable (found wherever you installed to, or in theinstall/bin
directory) to include-Xms500m -Xmx3g
as options passed to java.Alternatively, you can setJAVA_OPTS
env var; e.g.export JAVA_OPTS="-Xmx51200000000"
Please be aware, that this will install NQP into your given--prefix
beforeConfigure.pl
exits.
Alternatively, feel free to git clonehttps://github.com/Raku/nqp manuallyand install it individually.
By supplying combinations of backends to the--backends
flag, youcan get two or three backends built in the same prefix. The firstbackend you supply in the list is the one that gets therakudo
nameas a symlink, and all backends are installed separately asrakudo-m
orrakudo-j
for Rakudo onMoarVM, or JVM respectively.
The format for the--backends
flag is:
$ perl Configure.pl --backends=moar,jvm --gen-moar --relocatable$ perl Configure.pl --backends=ALL --gen-moar --relocatable
ALL
refers tomoar
,jvm
andjavascript
backends.
The roast test suite is installed as thet/spec
directoryunder your rakudo directory. If your installed rakudosource directory doesn't havet/spec
installed, thenyou can clone it like this:
cd $YOUR_RAKUDO_SRCDIRgit clone https://github.com/Raku/roast.git t/spec
Note the rakudo code includes an entry in its.gitignore
fileso git will ignore any content undert/spec
.
Now you can run tests in the rakudo directory.
Run the full spectest:
$ make spectest # <== takes a LONG time!!
To run a single test, one must usemake
because of the tooling required torun the spectests. For example:
$ make t/spec/S03-operators/comparison.t
Run all tests in one S* directory with a sh script. One example:
$ cat run-tests.sh#!/bin/sh# specify the desired directory:D='t/spec/S26-documentation'# collect the individual filesF=$(ls $D/*t)# and run themfor f in $Fdo echo "Testing file '$f'" make $fdoneecho "All tests in dir '$D' have been run."
That can be written as a one-liner:
for f in $(ls t/spec/S26-documentation/*t); do make "$f"; done
There are several mailing lists, IRC channels, and wikis available withhelp for the Raku Programming Language and Rakudo. Figuring out the right one to useis often the biggest battle. Here are some rough guidelines:
The central hub for Raku information israku.org.This is always a good starting point.
If you have a question about Raku syntax or the right way to approacha problem using Raku, you probably want the “perl6-users@perl.org”mailing list or theirc.libera.chat/#raku IRCchannel. The mailinglist is primarily for the people who want to use Raku to writeprograms, so newbie questions are welcomed there. Newbie questionsare also welcome on the #raku channel; the Rakudodevelopment teams tend to hang out there and are generally gladto help. You can follow@raku_newsand on Twitter, there's a Raku news aggregator atPlanet Raku.
Questions about NQP can also be posted to the #raku IRC channel.For questions about MoarVM, you can join #moarvm on Libera.
The Raku community is committed to providing a welcoming, inclusive, safe, and enjoyable environment for everyone. Programming should be-Ofun
. The Raku Community therefore has adopted aCode of Conduct. Please report any violations of the Code of Conduct by emailing the Raku community affairs team atCAT@raku.org.
Seehttps://github.com/rakudo/rakudo/issues/new
If you have a patch that fixes a bug or adds a new feature, pleasecreate a pull request using github's pull request infrastructure.
Seeour contribution guidelines for more information.
If you would like simple history and tab completion in therakudo
executable,you need to install theLinenoise module. The recommended way to installLinenoise is viazef:
$ zef install Linenoise
An alternative is to use a third-party program such asrlwrap. Documentation onrlwrap can be foundhere.
SeeCREDITS for themany people that have contributed to the development of the Rakudo compiler, some of which haveleft this existence way too early.
About
🦋 Rakudo – Raku on MoarVM, JVM, and JS