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.

2 of 172 comments (clear)

  1. The Superiority of PHP over Perl by egg+troll · · Score: 0, Troll

    Hello Slashdot,

    Recently I've had a chance to do some web design with PHP. Previously
    I'd used Perl because I'd heard from many people that Perl was the end
    all and be all of scripting languages for the web. Imagine my suprise
    to discover that PHP was vastly superior! I know this is a bold
    statement, but I have solid arguements to support it.

    Before I begin, let me just clarify something. I'm not arguing that
    PHP is better than Perl in all cases. There is certainly still a use
    for Perl. Also, PHP isn't perfect but it does manage to fix many of
    the shortcomings I've had with Perl. Here are a few of the things I've
    noticed about PHP. Finally, I'm not the most talented Perl programmer
    out there. I generally prefer to use the vastly superior Python, but
    can use Perl if I have to.

    * Ease of use. After about a day I had an excellent understanding of
    both PHP and SQL. I was able to get a stable, useable and presentable
    website up within 24 hours of reading the basics of PHP. Learning Perl
    took me weeks and I'm still not even as good with it as I am with PHP.
    I would definitely not recommend anyone new to programming begin with
    Perl.

    * The OO of PHP is excellent. In my experience, it rivals Smalltalk.
    We all know that Perl's OO still needs work (whether or not OO is all
    that great is another discussion.) Hopefully Perl will be patched up
    so it supports such must-have OO features like introspection,
    reflection, self-replication and ontological data-points.

    * Outstanding database support. PHP supports virtually every DB under
    the sun (although Berkeley DB is missing, oddly enough.) Perl seems
    limited to MySQL and PostgreSQL, and its really a kludge for the
    later. I've heard that this will be fixed in upcoming versions of Perl
    though.

    * Speed. PHP is one of the fastest languages I've ever used. While it
    won't be replacing assembly or C, its definitely faster than Perl in
    almost every case, particularly in regex which has long been Perl's
    strongest point. I'm sure there are cases where Perl is equal to PHP,
    but I can't think of any at the moment.

    * Portability. I can take PHP code off my Linux box and plop it onto
    an IIS server, or even one of those new Macintosh servers and have it
    run without having to change a single line of code. Try doing this
    with Perl! Its as though it was written in assembly, Perl requires
    that much rewriting.

    * Graphics. PHP comes with a nice little graphics library. While I
    wouldn't use its to code the new Doom (VB would be a better choice)
    its adequate for most web pages, and should be considered as a
    substitute for Flash for certain things. Perl lacks a graphics library
    of any kind.

    * Data Structures. Under PHP you can create any type of datastructure
    you need: Linked lists, binary trees, hash tables, queues, inverse
    Reiser-biased recursion trees, etc. Under Perl you're extremely
    limited in what you can do. This is because Perl isn't OO (so you
    can't create Node classes, for example, usefull in a linked list) and
    because it lacks pointers. Some of you may notice that PHP lacks
    pointers, but look deeper! Behind the scenes, hidden from the user
    pointers are used. Because of this, PHP can support complex data
    structures.

    Again this is just my experience. I don't mean to offend any Perl
    coders because Perl was an excellent language. However, in certain
    cases it may behoove one to write the back end in PHP instead of Perl.

    --

    C - A language that combines the speed of assembly with the ease of use of assembly.
  2. Where's the BitTorrent Link? by TrollBridge · · Score: 0, Troll

    Surely somebody's scanned this book into a .pdf and redistributed it to the masses by now!

    --
    There's a Mercedes gap too. I want one and can't afford one, but it's not government's job to do anything about it.