rakudo  2021.02.1
About: Rakudo is a compiler for the Raku Pogramming Language (formerly known as Perl 6).
  Fossies Dox: rakudo-2021.02.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rakudo Documentation

Some Fossies usage hints in advance:

  1. To see the Doxygen generated documentation please click on one of the items in the steelblue colored "quick index" bar above or use the side panel at the left which displays a hierarchical tree-like index structure and is adjustable in width.
  2. If you want to search for something by keyword rather than browse for it you can use the client side search facility (using Javascript and DHTML) that provides live searching, i.e. the search results are presented and adapted as you type in the Search input field at the top right.
  3. Doxygen doesn't incorporate all member files but just a definable subset (basically the main project source code files that are written in a supported language). So to search and browse all member files you may visit the Fossies rakudo-2021.02.1.tar.gz contents page and use the Fossies standard member browsing features (also with source code highlighting and additionally with optional code folding).


This is Rakudo, a Raku compiler for the MoarVM and JVM.

Rakudo is Copyright © 2008-2021, The Perl Foundation. Rakudo is distributed under the terms of the Artistic License 2.0. For more details, see the full text of the license in the file LICENSE.

This directory contains only the Rakudo compiler itself; it does not contain any of the modules, documentation, or other items that would normally come with a full Raku distribution. If you're after more than just the bare compiler, please download the latest Rakudo Star package.

Rakudo is currently the most developed implementation of the Raku language; though there have been other partial implementations in the past. The Rakudo compiler has moar, jvm and js backends. Note that each backend has a slightly different set of features. For historical compilers see https://www.raku.org/compilers/.

Recent changes and feature additions are documented in the docs/ChangeLog text file.

Building and Installing Rakudo

Build Status Build StatusBuild Status Build Status

See the INSTALL.md file for detailed prerequisites and build and installation instructions. Check CAVEATS.md for platform specific notes.

The general process for building is running perl Configure.pl with the desired configuration options (common options listed below), and then running make or make install. Optionally, you may run make spectest to test your build on Roast, the Official Raku test suite. To update the test suite, run make spectest_update.

Installation of Rakudo simply requires building and running make install. Note that this step is necessary for running Rakudo from outside the build directory. But don't worry, it installs locally by default, so you don't need any administrator privileges for carrying out this step.

Configuring Rakudo to run on MoarVM

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 before Configure.pl exits.

Alternatively, feel free to git clone https://github.com/Raku/nqp and https://github.com/MoarVM/MoarVM manually and install them individually.

Configuration flags can be passed to MoarVM's Configure.pl using the --moar-option flag. For example, if you wish to use Clang when GCC is the default 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 multiple versions of the same compiler installed, the --cc flag can be used to pass its exact 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's Configure.pl.

Configuring Rakudo to run on the JVM

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 a java.lang.OutOfMemoryError: Java heap space error building rakudo on the JVM, you may need to modify your NQP runner to limit memory use. e.g. edit the nqp-j / nqp-j.bat executable (found wherever you installed to, or in the install/bin directory) to include -Xms500m -Xmx3g as options passed to java. Alternatively, you can set JAVA_OPTS env var; e.g. export JAVA_OPTS="-Xmx51200000000"

Please be aware, that this will install NQP into your given --prefix before Configure.pl exits.

Alternatively, feel free to git clone https://github.com/Raku/nqp manually and install it individually.

Multiple backends at the same time

By supplying combinations of backends to the --backends flag, you can get two or three backends built in the same prefix. The first backend you supply in the list is the one that gets the rakudo name as a symlink, and all backends are installed separately as rakudo-m or rakudo-j for Rakudo on MoarVM, 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 to moar, jvm and javascript backends.


Ensure the test suite is installed

The roast test suite is installed as the t/spec directory under your rakudo directory. If your installed rakudo source directory doesn't have t/spec installed, then you can clone it like this:

git clone https://github.com/Raku/roast.git t/spec

Note the rakudo code includes an entry in its .gitignore file so git will ignore any content under t/spec.

Now you can run tests in the rakudo directory.

Running tests

Run the full spectest:

$ make spectest   # <== takes a LONG time!!

To run a single test, one must use make because of the tooling required to run 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

# specify the desired directory:

# collect the individual files
F=$(ls $D/*t)

# and run them
for f in $F
    echo "Testing file '$f'"
    make $f
echo "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

Where to get help or answers to questions

There are several mailing lists, IRC channels, and wikis available with help for Raku and Rakudo. Figuring out the right one to use is often the biggest battle. Here are some rough guidelines:

The central hub for Raku information is raku.org. This is always a good starting point.

If you have a question about Raku syntax or the right way to approach a problem using Raku, you probably want the “perl6-users@perl.org” mailing list or the irc.freenode.net/#raku IRC channel. The perl6-users list is primarily for the people who want to use Raku to write programs, so newbie questions are welcomed there. Newbie questions are also welcome on the #raku channel; the Rakudo and Raku development teams tend to hang out there and are generally glad to help. You can follow @raku_news and on Twitter, there's a Raku news aggregator at Planet Perl 6.

Questions about NQP can also be posted to the #raku IRC channel. For questions about MoarVM, you can join #moarvm on freenode.

Reporting bugs

See https://rakudo.org/bugs

Submitting patches

If you have a patch that fixes a bug or adds a new feature, please create a pull request using github's pull request infrastructure.

See our contribution guidelines for more information.

Line editing and tab completion

If you would like simple history and tab completion in the rakudo executable, you need to install the Linenoise module. The recommended way to install Linenoise is via zef:

$ zef install Linenoise

An alternative is to use a third-party program such as rlwrap. Documentation on rlwrap can be found here.


See CREDITS for the many people that have contributed to the development of the Rakudo compiler.