Day 17 – Perl 6 from 30,000 feet

by

Many people have heard of Perl 6, especially in the greater Perl community.  However, Perl 6 has a complicated ecosystem which can be a littled daunting, so as a newcomer to the Perl 6 community myself, I thought I would share what I’ve learned.

How do I install Perl 6?

It’s simple; you can just download one of the existing implementations of the language (as Perl 6 is a specification), build it, and install it! There are several implementations out there right now, in various states of completion. Rakudo is an implementation that targets Parrot, and is the implementation that I will discuss most in this post. Niecza is another implementation that targets the CLR (the .NET runtime). For more information on these implementations and on other implementations, please see Perl 6 Compilers. Perl 6 is an ever-evolving language, and any compiler that passes the official test suite can be considered a Perl 6 implementation.

You mentioned “Parrot”; what’s that?

Parrot is a virtual machine that is designed to run dynamically typed languages. Along with the virtual machine, it includes tools for generating virtual machine code from intermediate languages (named PIR and PASM), as well as a suite of tools to make writing compilers easier.

What is Rakudo written in?

Rakudo itself is written primarly in Perl 6, with some bits of C for some of the lower-level operations, like binding method arguments and adding additional opcodes to the Parrot VM. It may seem strange to implement a Perl 6 compiler in Perl 6 itself; Rakudo uses NQP for building itself.

What’s NQP?

NQP (or Not Quite Perl 6) is an implementation of Perl 6 that is focused on creating compilers for the Parrot Compiler Toolkit. It is currently focused on targetting Parrot, but in the future, it may support various compilation targets, so you will be able to use Rakudo to compile your Perl 6 programs to Parrot opcodes, a JVM class file, or perhaps Javascript so you can run it in the browser. NQP is written in NQP, and uses a pre-compiled version of NQP to compile itself.

I hope that this information was useful to you, dear reader, and that it helps to clarify the different pieces of the Perl 6 ecosystem. As I learn more about each piece, I intend to write blog posts that will hopefully help others to get started contributing to Perl 6!

-Rob

About these ads

One Response to “Day 17 – Perl 6 from 30,000 feet”

  1. raiph Says:

    Note that you can try Perl 6 right now, without installing anything:

    Farabi You can try recent versions of Rakudo, Niecza, STD and Perlito 6 (four distinct implementations of Perl 6) using the fledgling (first appeared at the end of 2012) Farabi, an online “Modern Perl Editor”.
    #perl6 If you just want to do some one liners, and would find it helpful to have folk seeing and commenting on what you enter and what results you get, you can try recent versions of Rakudo, Rakudo Star, Niecza, STD, and Pugs using evalbots on IRC channel #perl6 on freenode.net.

    If you do want to install something, and are a Windows user, and would be happy with the Rakudo Star bundle (which adds docs, jnthn’s awesome debugger, the Panda module installer, some basic modules, etc. to the compiler), you can just grab the latest .MSI from the Rakudo downloads link.

    If you want to use Niecza, or stay close to C# (which is Niecza’s underlying “systems” language), or prefer targeting CLR/.NET/mono (Niecza’s current bytecode target), you would want the latest from sorear’s Niecza github repo.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 37 other followers

%d bloggers like this: