Lataa pdf-muodossa

Rakudo Perl 6 and NQP Internals

This workshop offers a deep dive into Rakudo Perl 6 and NQP. The main focus is on the backend independent parts but also with some focus on the JVM and the upcoming MoarVM. During the training, participants build their own little compiler, complete with a simple class-based object system, to help them understand how the tool chain works.

Perl 6 is finally here! Get the most relevant and important skills and information from Jonathan Worthington from Edument who has been actively involved in the development of the Rakudo Perl 6 Compiler, as well as the language itself.


Programmers who are curious about the Perl 6 internals and how the compiler works. The course is also interesting for those who want to learn compiler creation in general.


Reasonable knowledge of Perl 6 language. Experience with NQP is helpful.



Day 1

Overview: Compiler, and NQP/Rakudo-architecture
•Role of the compilers
•Perl 6 challenges
•NQP as a language
•NQP as a toolbox for building compilers
•Operations in nqp::
•Bootstrapping in a nutshell
•How Rakudo uses NQP

NQP Language
•Literals, variables, and control structures
•Subroutines, pointy blocks, closure semantics
•Classes, attributes, classes, and methods
•Regexps and grammar
•Multiple dispatch
•Builtin commands and nqp::-operations
•Exception handling
•Limitations and other differences from the full-fledged Perl 6

•Class HLL::Compiler
•Frontends, backends, and QAST in between
•Grammar based parsing, AST building with documents
•Code generation
•Build a small language from scratch

•QAST::Node, base of everything
•Overall structure of AST
•Literals: QAST::IVal, QAST::NVal and QAST::SVal
•Operations: QAST::Op, basic example
•Sequencing: QAST::Stmts, QAST::Stmt
•Variables: QAST::Var, QAST::VarWithFallback, scope, decl, value
•Block-symbol table
•Parameters and arguments
•Contextualisation: QAST::Want
•Block references: QAST::BVal
•Object references: QAST::WVal
•Backend escape hatch: QAST::VM
•On top QAST::CompUnit

A closer look at nqp::-operationerna
•Control flow
•Exception related
•Context introspection
•Big integers

Day 2

•Object: behavior + state
•Types and varieties
•Meta object
•knowhow, the root of everything
•Building a simple object system from scratch
•Adding items to our new little language, with a World
•Method caches
•Tycp checking
•Explore NQPs metaobject
•Explore Rakudos metaobject
•Working with the container

Limited serialization and module handling
•Compilation phase vs. run phase
•Serialization contexts
•QAST::WVal recap
•What is "limited" in it
•Takeback, conflicts and other nasty issues
•nqp::-operations in relation to serialization contexts
•World recap
•How module loading works

Regex- and grammar engine
•QAST::Regex node and its sub types
•Cursor and Match
•Two stacks: bstack and cstack
•NFA:s and the longest token matching

JVM backend
•Description of the JVM
•Run time support library

MoarVM backend
•Description of the MoarVM

Ota yhteyttä



010 4321 001 Ota yhteyttä

Kesto: 2 päivää
Veroton hinta (+ alv 24 %): 1 550 €
Voit maksaa:

Haluatko koulutuksen asiakaskohtaisena? Jätä yhteystietosi, niin palaamme asiaan.