Slashdot Mirror


Perl 6 Essentials

JayBonci writes "It may come as a surprise that within the pages of 'Perl 6 Essentials' lies what could be two books, despite its length. If not for lack of cover space, it could easily bear the names "Perl6 for Perl5 programmers" and "Parrot in a Nutshell". Both topics are concise and clearly covered, despite their relatively different audience." Read on for the rest of Jay's review. Perl 6 Essentials author Allison Randal, Dan Sugalski, and Leopold Totsch pages 208 publisher O'Reilly rating 9 reviewer Jay Bonci ISBN 0596004990 summary A solid look ahead at Perl 6, and a reference for Parrot developers

Make no mistake, Perl 6 isn't here yet, but it's coming. The book starts with a good explanation of "the plan"; chapters 1-3 deal with the history, goals, and design considerations of the project. It's a good conceptual overview of the process about how it has been run so far, and how it seems to be continuing. Chapter 3 is of special interest, as it showcases some of the in-depth thought that has been poured into the project. Though we all aren't language theorists, it helps allay some of the fears that change brings while being completely fascinating reading.

This first part of the book isn't very useful without a fairly solid Perl 5 background. It wastes no time in chapter 4 discussing syntactical differences in the v5 to v6 transition. Programmers should be pleased with the practicality of the approach to the new language, as it refers to the new structures and features, and how they solve simple workarounds that Perl veterans are used to in Perl 5. Currying, multimethods, class definitions and structures, new operator syntax, and the dynamics of the new regular expression engine (now called rules) are all touched on, and their values made obvious to the reader.

The last three chapters are for those interested in Parrot development and those who wish to port languages to Parrot. (There are active projects to port Python, Ruby, and even .NET to Parrot.) The section has a slight perl slant to it, but is really about the interpreter and compiling / running Parrot code. It is a fairly complete reference to the different parts of PASM (Parrot Assembly Language), and its role in porting languages to use Parrot. A comfort with assembly language basics is assumed in these sections, as the syntax and concepts of registers and machine code are made easier with general assembler familiarity. This part was somewhat dry for me, as it reads more like a reference than anything else, but it covers the topic fully without droning or leaving anything out. Examples are abundant and range from the simple, to the integrated, and are enough to get people started programming and writing tests with Parrot bytecode.

It should be noted that this book is valid and accurate now, but any development project can make changes quickly. There are places where the authors have admitted that a feature isn't in stone, and is possible to change. According to chromatic, an editor for O'Reilly, the plan is to update the book once a year until Perl 6 is released. Until then, a great place to keep up to date for the casual observer is at the p6p digest. This book goes down a lot easier than the Apocalypses, RFCs, and Exegeses, and I'd heavily suggest it to anyone who is serious about being ready for 6 or joining in on development . I preordered it from Amazon when I saw it was coming out, and am quite happy with my investment.

Table of Contents
  1. Project Overview
    • The Birth of Perl 6
    • In the Beginning . . .
    • The Continuing Mission
  2. Project Development
    • Language Development
    • Parrot Development
  3. Design Philosophy
    • Linguistic and Cognitive Considerations
    • Architectural Considerations
  4. Syntax
    • Variables
    • Operators
    • Control Structures
    • Subroutines
    • Classes and Objects
    • Grammars and Rules
  5. Parrot Internals
    • Core Design Principles
    • Parrot's Architecture
    • The Interpreter
    • I/O, Events, Signals, and Threads
    • Objects
    • Advanced Features
    • Conclusion
  6. Parrot Assembly Language
    • Getting Started
    • Basics
    • Working with PMCs
    • Flow Control
    • Stacks and Register Frames
    • Lexicals and Globals
    • Subroutines
    • Writing Tests
    • PASM Quick Reference
  7. The Intermediate Code Compiler
    • Getting Started
    • Basics
    • Flow Control
    • Subroutines
    • IMCC Command-Line Options
    • IMCC Quick Reference

You can purchase Perl 6 Essentials from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

9 of 172 comments (clear)

  1. Perl 6 plan over three chapters? by Anonymous Coward · · Score: 2, Funny

    So that's what... like 100 pages of the string "Smoke crack" repeating?

    print "Smoke crack" x 1000000 .. hey, that was pretty easy.

  2. Re:The Superiority of PHP over Perl by TomatoMan · · Score: 4, Funny

    Excellent points, thanks. I'll just add a few notes:

    - Don't forget that Perl is bright blue, while PHP is dark green. If you have an aversion to bright blue, you should definitely code in PHP.

    - Three out of four gnomes script their underwear-cart code in PHP; Perl gets sticky on hot days.

    - Perl behaves badly under zero-gravity conditions; PHP will actually make your computer lighter. The benefits of this should be obvious to everyone.

    Really, there's no competition. PHP is the obvious choice - and its emissions are less fattening, too.

    --
    -- http://frobnosticate.com
  3. Re:The Superiority of PHP over Perl by Anonymous Coward · · Score: 1, Funny

    > what do you think all those \$a, \@b, \%c are ????

    Random selections of characters aren't they ? Oh shit, we're talking Perl arent we :-O so that means they "mean something".

  4. Perl 6 is coming by imnoteddy · · Score: 4, Funny
    Make no mistake, Perl 6 isn't here yet, but it's coming.

    Will it be released at the same time as HURD?

    --
    No electrons were harmed creating this post, though some may have been subjected to electrical and/or magnetic fields.
    1. Re:Perl 6 is coming by Jon+Abbott · · Score: 2, Funny
      Will it be released at the same time as HURD?
      Yes, I've heard that some retailers will eventually start offering a software variety CD that has a copy of Perl 6, HURD, and Duke Nukem Forever on it! But, due to a strange contract mishap, each developer group is waiting for the other two to publish their software first, so it's just all waiting from here... But, that's just what I've heard.
  5. Re:Mod parent up! by nixer · · Score: 2, Funny

    Trie, bit Slshdt dsnyt hive e speeling chckr

  6. Re:Perl 6 release date? by Anonymous Coward · · Score: 1, Funny
    though the more people who contribute, the sooner Programming Perl 6 will be released.


    I think Fred Brooks might disagree with that statement.

  7. Re:Barely about Perl. Certainly not essential. by refactored · · Score: 3, Funny
    perl5 isn't too pretty inside the bowels.

    Neither are you mate, no, not pretty at all, at all.

  8. Re:Barely about Perl. Certainly not essential. by shotgunefx · · Score: 2, Funny

    I'll thank you for not pondering about the
    attractiveness of my internals. :P

    --

    -William Shatner can be neither created nor destroyed.