Hello, friends in this post we will tell you how to install Rakudo on Ubuntu 20.04 / Debian 10.
Raku and Rakudo
Actually, Raku is the Perl based programming language. Raku intends to carry forward the high ideals of the Perl community. Raku has been developed by a team of dedicated and enthusiastic volunteers and continues to be developed.
Some features of Raku are as follows:
- Object-oriented programming including generics, roles and multiple dispatch
- Functional programming primitives, lazy and eager list evaluation, junctions, autothreading and hyperoperators (vector operators)
- Parallelism, concurrency, and asynchrony including multi-core support
- Definable grammars for pattern matching and generalized string processing
- Optional and gradual typing
So, where is Rakudo in all this?
Well, Rakudo is the most mature implementation of Raku. In itself, it is a compiler that will allow us to enjoy the full potential of Raku in a better way.
So, you could say that they are inseparable.
Install Rakudo on Ubuntu 20.04 / Debian 10
Raku is not as popular as Perl or Ruby but it has seen significant acceptance by the community. This results in Rakudo being available from the official Ubuntu 20.04 / Debian 10 repositories
So, all we have to do is open the terminal and run:
sudo apt install rakudo
This fairly easy method will not give us the latest stable version of Rakudo. So you can either download the package directly from the website or use the wget command.
wget -c https://rakudo.org/dl/rakudo/rakudo-moar-2021.03-01-linux-x86_64-gcc.tar.gz --2021-03-26 15:40:00-- https://rakudo.org/dl/rakudo/rakudo-moar-2021.03-01-linux-x86_64-gcc.tar.gz Resolving rakudo.org (rakudo.org)… 2606:4700:20::681a:6d6, 2606:4700:20::ac43:44f0, 2606:4700:20::681a:7d6, … Connecting to rakudo.org (rakudo.org)|2606:4700:20::681a:6d6|:443… connected. HTTP request sent, awaiting response… 200 OK Length: 15711356 (15M) [application/octet-stream] Saving to: ‘rakudo-moar-2021.03-01-linux-x86_64-gcc.tar.gz’ rakudo-moar-2021.03-01-linux-x86_64-gcc.ta 100%[=====================================================================================>] 14.98M 13.0MB/s in 1.1s 2021-03-26 15:40:02 (13.0 MB/s) - ‘rakudo-moar-2021.03-01-linux-x86_64-gcc.tar.gz’ saved [15711356/15711356]
Then you decompress it to a location of your choice and the binary is in the bin
folder.
tar xvfz rakudo-moar-2021.03-01-linux-x86_64-gcc.tar.gz
If you want to rename the folder to have a simpler name.
mv rakudo-moar-2021.03-01-linux-x86_64-gcc/ rakudo
Now we will make the first program.
Testing Rakudo on Ubuntu 20.04 / Debian 10
Create a file with your favorite text editor. From the Raku website, they recommend Atom. In this case, I will use nano.
nano example.pl
And add the following content:
use v6;
say "Hello world. Welcome to Osradar";
Then, save the changes and close the editor.
So, to run it we only have to invoke the raku binary in the Rakudo folder.
rakudo/bin/raku example.pl
And you will get the next output on the screen.
Hello world. Welcome to Osradar
Then we can start working. Also, you can create a profile entry so that you can use raku as a command.
So, enjoy it
Conclusion
There are many programming languages but Raku claims to be an evolution of Perl. It is not as popular as the latter but it is well-positioned. Now together with Rakudo they form a couple ready for work.
So, share this post and join our Telegram Channel.