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.

10 of 172 comments (clear)

  1. What's the difference? by Anonymous Coward · · Score: -1, Troll

    Either requires fucking a big smelly thing that couldn't run a website properly even if you taught it to.

  2. 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.
  3. Essential Perl Advice by Anonymous Coward · · Score: -1, Troll

    Use Python instead.

  4. The Right Tool For The Job by Anonymous Coward · · Score: -1, Troll

    I always hear everyone say use The Right Tool For The Job TM, as in, there are a lot of programming languages for a reason; some are better suited for certain tasks than others. But now after lots of programming I am convincied this is a false, much like the civil engineering anologies so commonly thrown out (i.e., writing programs is like building houses; using object orientation is like reusing bricks). Most languages are subsets of a better language, and only reason for existence is the author did not like some syntax of the original language. The vast amount of languages makes is hard for programs to interoperate. Basically only assembly, a C-like language and a high level language, like Lisp or Scheme are all that are really necessary. ALL the syntaxes in Python, Perl, Java, etc. are hard coded in, and these languages exist because someone didn't like how to do a loop or an object system in the previously existing languages, and since there was no real macro functionality (ala lisp), they had to go and write a new language.

  5. GTAA FUCKED-UP POST SYSTEM www.borahbands.com by Anonymous Coward · · Score: -1, Troll
    GTAA (Gay Troll Association Of America) is the first organization to wipe its ass with the GAY NIGGER post.



    Are you Gay?

    Are you a Troll?

    Are you a Gay Troll?



    If you answered yes to any of the above questions, then GTAA (Gay Troll Association Of America) might be exaclty what you've been looking for!

    Join GTAA (Gay Troll Association Of America) today, and enjoy all the benefits of wiping your ass with lame posts.

    GTAA (Gay Troll Association Of America) is the fastest-growing GAY TROLL community with thousands of members all over the USA. You too can be a part of GTAA if you join today!



    Why not? It's quick and easy - only thee simple steps!

    - First, you have to print out that lame GNAA post and wipe your ass with it.

    - Second, you need to succeed in being the first reply to any lame GNAA post.

    - Third, you need to tell how stupid the lame GNAA post is to any of its posters.



    If you have any mod points, mod both this and the parent down.

  6. Perl Essentials in 5 seconds... by Anonymous Coward · · Score: -1, Troll

    ...learn Python!

  7. why is the parent a troll? by Anonymous Coward · · Score: -1, Troll

    after all, haven't you seen the new Perl 7 spec?

  8. Essential??? nahhh by Anonymous Coward · · Score: -1, Troll

    "Ugh... UGH!" Chris Pirillo moaned as he squatted
    over the ThumbDrive. He eyes darted back and
    forth like a stone man and he sighed gay breaths
    as he attempted to shove the device filled with the
    entire line of eBooks into his anus. His geek house
    trembled with fag vibrations coming from his crack
    but then- his doorbell rang, whistling the tune
    from "Matlock" throughout his hovel.

    "Damn" he howled in a gay, sepulchral voice and
    slipped on a pair of pastel slacks. He trapsed to
    the threshold of his cold abode and grabbed the
    greasy doorknob that was shaped like Birdman.
    With a slavish sigh, he opened the door to see
    none other than Adam Sessler himself!

    A gay gasp escaped from Chris's dork lips and
    Adam began to speak. Quickly, Chris snapped at him.
    "Damnit for the last time you vagabond, you're not
    supposed to be here!" The revolting nerd slammed
    the door in Adam's face, but the Game Master
    quickly shoved his iron boot inbetween the door
    and the wall, wedging it open. "I have come for you,"
    he spoke in a cold tone; electric arcs coursed
    between the spikes in his cockneyed bleached hair.

    Adam howled as a blast of mystic Boohbahs
    emanated from his busy shirt and slammed
    Chris down the hall and into a Microsoft Digital
    Picture Frame. Chris grunted and swiped nerd
    dust and sheetrock from his arms. He rose to
    his feet and watched in horror as Adam brandished
    a weapon made from 3 Xbox controllers tied
    at the ends. "Oh my word! Game peripherals!"
    the dork bellowed; the stench of Cheetos and
    Diet Dr. Pepper wafted from his geek teeth.
    Instantly his palms began to sweat at the very
    sight of them, as if the grease from his McGriddle
    hadn't slicked them up enough.

    Chris tried to run from his game-playin' adversary,
    but it was too late. Adam swung the weapon above
    his head and threw it at the King of Nerds,
    entangling his legs and forcing him to the floor.
    Adam pulled a cestus made from PS2 DVDs
    out of his Spice Girls backpack and rushed Chris.
    He swiped at his turdly back over and over, causing
    streams of cold blood to squirt from his flesh.
    "Oh god, the horror, the HORROR!" Chris moaned
    as Adam butchered him relentlessly. A old Brit with
    one eye and a cockneyed accent burst into the
    room and started kicking Chris in the side.

    Chris was just about do die when... he rose from
    his bed. It was just a dream! He laughed and
    took a sip of more Brawls Guarana, hoping he
    wouldn't fall asleep again. "Time to plot..." he
    grumbled and shoved yet another pin into his
    Leo Laporte voodoo doll.

  9. 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.
  10. Ruby by Anonymous Coward · · Score: -1, Troll

    Perl is old news.

    Ruby.