Filter

Perl 6 for Programmers

Perl 6 is an exciting new language, boasting excellent Unicode support, a clean new pattern matching syntax that scales from regexes to full grammars, high-level concurrency features, built-in reactive programming, neat interoperability with native libraries (C), Perl 5, Python, and more. Solid and flexible OO enables rapid implementation of object models, while a whole range of functional-inspired features make data munging a joy. These together make Perl 6 a great glue language for the modern world. Compared with Perl 5, Perl 6 represents a step of revolution, not evolution.

This 2-day course will enable you to add Perl 6 to your programming toolbox. Starting out from writing small scripts for simple data processing tasks, it gradually works its way up to building concurrent programs and web services, taking in a wide range of features along the way. The course doesn't just explore the language; it also covers writing tests, installing and using modules, and how to get help and learn more beyond the course. It includes short and frequent hands-on exercises, to provide lots of opportunities to explore the language and get a real feel for it.

The Edument team contains individuals who have contributed to both the Perl 6 design and compiler implementation process, and remain highly active in the community today. Therefore, you can be sure you're learning from those who know Perl 6 best.

    Target audience

    The course assumes an existing knowledge of typical concepts that show up in many other languages: values, variables, conditional and looping constructs, subroutines, classes, and methods. Therefore, participants should have some years of prior programming experience in at least one other programming language in order to appreciate this course (such as Perl 5, C#, JavaScript, Python, Ruby, or something else). Perl 6 differs in a lot of ways from Perl 5, and is best considered a new language in the same family; therefore, prior Perl 5 expereince is not important for this course.

    What you will learn

    Finding your feet

    • Language specification vs. implementation
    • Installating the Rakudo Perl 6 compiler
    • Understanding the Rakudo Perl 6 stack
    • Hello, world
    • Statements
    • The REPL
    • The zef module installer
    • Where to find documentation and assistance

    Values

    • Numerics
    • Values know WHAT they are
    • Strings
    • Booleans

    Variables

    • Scalar variables
    • Array variables
    • Hash variables
    • Assignment vs. binding
    • Dynamic variables
    • Interpolation

    Basic I/O

    • slurp and spurt
    • Working with file handles
    • Encodings

    Control flow

    • Iteration with the for loop
    • Conditionals
    • Definedness
    • More loopy skills

    Basic testing

    • Testing culture
    • The Test module
    • The most common test assertions
    • plan vs. done-testing

    Routines and blocks

    • Subroutine declaration
    • Signatures, parameters, and arguments
    • Return type constraints
    • Blocks and pointy blocks
    • Placeholder parameters
    • Unpacking and destructuring

    Smart matching

    • The ~~ and !~~ operators
    • given, when, and the topic variable revisited
    • where traits
    • subset types

    Exception essentials

    • die and CATCH
    • Built-in exception types
    • Test assertions relating to exceptions

    Object orientation

    • Classes, attributes, and methods
    • Roles and flattening composition
    • Inheritance
    • Custom exception classes
    • Parametric roles
    • The FALLBACK method
    • Introspection

    Basic text pattern matching

    • New regex syntax overview
    • Literals
    • Quantifiers
    • Character classes, built-in and user-defined
    • Grouping and capturing
    • Named captures
    • Alternations: sequential and longest prefix
    • Factoring out patterns into named regexes
    • Lookahead and other zero-width assertions

    Parsing with grammars

    • What is a grammar?
    • Start at the TOP
    • The parse and subparse methods
    • token vs regex
    • rule and automatic whitespace handling
    • make and .made
    • Action classes

    Creating modules

    • Modules, compilation units, and distributions
    • The export trait and export tags
    • use and importing by tag
    • The EXPORT sub for custom exporting
    • The META6.json file

    Multiple dispatch

    • By arity
    • By type
    • By smart matching
    • By structure
    • Insight: operators are just multi-dispatch subroutines
    • The MAIN subroutine

    Sequences and laziness

    • Array, List, and Seq
    • Common list-processing operations: map, grep, unique, and more
    • The reduce, zip, and cross meta-operators

    Concurrency

    • Promise and await
    • Reactive programming with Supply
    • Working with processes asynchronously
    • The supply/react/whenever syntax

    Putting it all together: building a web service

    • The Cro libraries for building reactive services
    • Reactive pipelines
    • Signature-based routing
    • Supplies meet web sockets

    Quick mentions

    • Inline::Perl5 and Inline::Python
    • NativeCall
    • Profiling

    Course info

    Course code: T260
    Duration: 2 days
    Price: 21 500 SEK
    Language: Engelska

    Course schedule

    There are no set dates for this course at the moment, but contact us and we'll make arrangements!

    Teachers

    Share

    Contact us for details

    +46 40 61 70 720
    info@edument.se


    All prices excluding VAT