Raku: Setting up Raku (for Contributors)

[last revised/updated 2020_10_03]

Foreword

This series of posts on Raku programming attempts to be succinct and useful for folks interested in contributing to Raku. If you find it useful, drop me a note in the comments. -Ofun

Posts in the Series

  1. Try Raku! (work in progress)
  2. Setting up Raku (for Contributors) [this post]
  3. Wading into the Raku community (planned)

Setting up Raku (for Contributors)

When you use Raku and interact with others, your interactions affect the community. Raku is a welcoming community. You are welcome. Pull up a chair and get comfy. These instructions will help you get up and running Raku in a configuration that enables you to contribute back when you are ready.

To enable contributing, we will setup hosted copies ('forks') of the Rakudo, NQP, and MoarVM git repositories on Github. Your changes (when you are ready to make them) will go into your repositories. You will submit requests which allow others to pull your changes upstream into the respective parent repositories.

Rakudo is an implementation of the Raku language. It requires NQP and a backend (MoarVM). Why? Because Rakudo is written in a mixture of Raku and NQP. NQP is a minimal subset of Raku designed to implement a Raku compiler. NQP is bootstrapped. I.e. NQP is written in NQP. The NQP compiler provides virtual machine abstraction layers which allow code to run on different backends such as the MoarVM, JVM, and JavaScript. The most mature backend for Rakudo is MoarVM. MoarVM is written in C.

The source code for Rakudo, NQP, and MoarVM each resides in their own git repository on Github. The Rakudo README.md describes a build method which we DO NOT USE:

$ perl Configure.pl --gen-moar --gen-nqp --backends=moar

Which will automatically clone, build, and install NQP and MoarVM from their respective parent repositories. Because we want to be able to contribute to NQP and MoarVM, we need to configure things to build from our hosted copies of these repositories. 

Let's Get Started

[Click on the '+' sections below for more details as needed]

+ Install Prerequisites: Perl 5.10 or later, git, make, gcc, libssl


Decide where in the filesystem you want to put things. We prefer to isolate everything to do with Raku in $HOME/raku

Create a raku directory in your $HOME

cd ~
mkdir raku

MoarVM: Get, Configure, Build, and Install

cd ~/raku
git clone git@github.com:[Your_Github_Username]/MoarVM.git
cd MoarVM
git remote add upstream git@github.com:MoarVM/MoarVM.git
perl Configure.pl --prefix=$HOME/raku --optimize=0 --debug=3
make
make install

NQP: Get, Configure, Build, Test (Optional), and Install

cd ~/raku
git clone git@github.com:[Your_Github_Username]/nqp.git
cd nqp
git remote add upstream git@github.com:Raku/nqp.git
perl Configure.pl --prefix=$HOME/raku --backends=moar
make
make test
make install

Rakudo: Get, Configure, Build, Test (Optional), and Install

cd ~/raku
git clone git@github.com:[Your_Github_Username]/rakudo.git
cd rakudo
git remote add upstream git@github.com:rakudo/rakudo.git
perl Configure.pl --prefix=$HOME/raku
make
make test
make install

Add the location of raku binaries to PATH

export PATH=$HOME/raku/bin:$HOME/raku/share/perl6/site/bin:$PATH
echo 'PATH=$HOME/raku/bin:$HOME/raku/share/perl6/site/bin:$PATH' >> ~/.bashrc

Execute raku

$ raku -v
This is Rakudo version 2020.08.2-63-gc5cffd40d built on MoarVM version 2020.08-91-g590bac47e
implementing Raku 6.d.
$ raku -e 'say "hello world!";'
hello world!
cd ~/raku
git clone git@github.com:ugexe/zef.git
cd zef
raku -I. bin/zef install .

Familiarize yourself with the Github standard fork and pull request workflow

To re-sync your forked repositories with upstream repos 

cd into each repo (cd ~/raku/[MoarVM|nqp|rakudo]) and:
git fetch upstream
git checkout master
git merge upstream/master
git submodule update --init --recursive
make
make install

Afterward

Thank you for reading. If you have any feedback or thoughts you would like to share, please let me know in the comments below. You can see what posts are planned and in progress at Posts in the Series. Check back every couple weeks for new posts.

Comments

  1. Raku: Setting Up Raku (For Contributors) >>>>> Download Now

    >>>>> Download Full

    Raku: Setting Up Raku (For Contributors) >>>>> Download LINK

    >>>>> Download Now

    Raku: Setting Up Raku (For Contributors) >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete

Post a Comment

Popular posts from this blog

Raku: Advent of Code 2020 - Day Twelve

Raku: Advent of Code 2020 - Day Thirteen