OSCON 2010: Cool Perl 6 Today

Patrick Michaud (pmichaud.com)

I’m just back from lunch at Burgerville with Juan and Jonathan. On the way back into the convention center, I ran into Alasdair, who has been attending the hardware hacking sessions. That made me think that I may want to try to find non-Perl sessions to attend. After all, I tend to keep up with Perl news, so the sessions are of marginal usefulness. Unfortunately, nothing on the schedule looked very interesting to me. I was curious about the session on Open Source Tool Chains for Cloud Computing until I read the description. While it looked cool, it wouldn’t be useful for me in my work. The session would go through provisioning, setup, and maintenance of hosts, all of which we already have well-entrenched solutions for in my day job. So, I ended up back in the Perl track. My friends in the San Diego Perl Mongers group will appreciate that, I think.

Anyway, on to the session.

The name Perl 6 is a language specification, rather than any particular implementation. All of the references and links off-handedly mentioned in this post are available from the Perl 6 website.

Patrick is the lead developer of Rakudo Perl, which is the most feature complete and up-to-date.

Perl 6 has a language specification and a test suite. There are still many places in Perl 6 that are not being tested yet.

Rakudo * (Star) is scheduled to be released a week from tomorrow, targeted at being a useful, usable, early adopter distribution.

At this point, Patrick began to enumerate the new language features and how they work in Perl 6, such as variables, loops, interpolation, and so on. I won’t go into these here, since there are numerous places on the Web where this has been documented.

About half way through this session, I realized that “r0ml” was presenting in another room. If I’d noticed that before, I would have attended that session.

OSCON 2010: Perl 5.12

Jesse Vincent (Best Practical)

This talk could be titled something along the lines of “Lessons Learned from Project Management.”

Jesse Vincent is the current Perl 5 pumpking, which for the moment can be thought of as the project janitor.

People who say “Perl is dead” or that Perl hackers are “desperate” are behind the times.

There are a lot of exiting things happening that are not in the Perl core. Audrey Tang has said that “CPAN is the language, Perl is the syntax.” Like Piers in the previous session, Jesse enumerated a handful of things that make Perl awesome:

While some of the coolest new things happening in the CPAN world, it merely scratches the surface of what is available.

About three months ago, Jesse uploaded Perl 5.12. Amazingly, no one has reported any critical regressions.

Jesse has been assured that Rakudo * will be out next week, on 29 July. However, Perl 6 will not replace Perl 5, which has paid Jesse’s mortgage for many, many years. Also, thanks to Perl 5.12, Perl 5.10 is no longer “too new to use.”

Perl 5.12 marks the latest release in the process of cleaning up the inernals and adding much desired features. Some of the highlights:

  • Deprecations warn by default
  • suidperl is dead
  • package Foo::Bar 1.0; – better version import syntax
  • Y2038 compliant – thanks to Schwern
  • Unicode improvements; upgrade to 5.2
  • Pluggable keywords
  • Overridable function lookup
  • Dtrace support
  • Deprecated modules – Class::ISA, Pod::Plainer, Shell, Switch (but still on CPAN)
  • Yadda, yadda, yadda operator

Jesse believes the best new thing in Perl 5.12 is the release process, including him as the pumpking. Twenty years ago, Perl didn’t use version control. He recommends learning from this mistake.

It took five years to release Perl 5.10, after burning through two pumpkings.

Before 5.12, maintenance releases contained all sorts of bug fixes and updates, but could not break binary compatibility. Doing so was a huge task, was very difficult, and, contrary to its name, is unmaintainable. Even without all this work, the pumpking’s job is a lot of work. Jesse really doesn’t want to burn out after a release of Perl.

Traditionally, the process of turning someone with the necessary skills to be the pumpking involves preventing them from using those skills and replacing them with management skills. It’s a shame.

The system is broken and Perl 5 isn’t going anywhere, so how can it be fixed? We can reinvent it, but that’s already being done by Perl 6. Alternatively, we can refactor it. There is no reason many of the skills and duties required of the pumpking can’t be delegated out to people with those skills. In effect, the most important skill and duty for the pumpking is project management.

The 5.9 releases, leading up to 5.10, were haphazard. The 5.11 releases, leading up to 5.12, have settled into a new release every month on the twentieth, with a couple of exceptions. The 5.13 series has followed suit. One of the reasons this was possible was documenting the entire release process.

Releases in the 5.12 series are on a fixed schedule, every three months. A release schedule has been created for 5.14, too.

One of the things I’ve learned working in an enterprise and my observations of the Fedora Project is that good project management is vital. Jesse Vincent is exactly what Perl needed and he continues to demonstrate that, with regular, high quality releases of Perl. What’s more, he is a good spokesman for the project, being able to come to OSCON and give a session on all of this detail in a cojent and interesting format.

OSCON 2010: New Beginnings in Perl 5

Piers Cawley (BBC)

After reviewing today’s session schedule, I quickly came to the conclusion that I will spend my entire day sitting in the room “Portland 256.” This is, apparently, where the Perl track is located.

Paul Fenwick introduced Piers in song, to the tune of Gilligan’s Island.

Piers switched from Perl to Ruby a while back and swore that he wouldn’t return to Perl until 6. Facetiously, the reason he switched to Ruby was the handsome community associated with it and he reason he switched back to Perl was the amazingly supportive community associted with it. He began with a point about programming style. We think of code as describing what we are doing, but in reality the majority of our code actually describes how we are doing it. This infrastructure code is noise.

More seriously, he absolutely hated unrolling the @_ variable in every function. In such a high level language like Perl, why must we pop arguments off the stack in the same manner we would in an assembly language? This leads to long subroutines, every single one containing anti-patterns designed to implement the language infrastructure, instead of the language doing the work for us.

Moose does a lot to improve writing classes, using a more declarative syntax. However, even within Moose methods we need to write the infrastructure code. The MooseX::Declare module solves this problem, giving method syntax a more declarative style. By moving the infrastructure code out of sight, we can better focus on what we are trying to do, rather than how we are doing it.

Piers proceeded to list the modules that “rock” and brought him back to Perl:

Perl’s object-orientation absolutely “sucks.” However, this turns out to be a good thing. It allows very clever people to create modules that extend the semantics of the language. In a language like Ruby, which has a good object-orientation built-in, it’s essentially stuck. If, in the future better ideas of object-orientation are developed, they can be implemented in Perl far more easily than in Ruby. An interesting point: sometimes when the tool sucks, things are better. People develop layers of tools that enhance and extend the original.

It also helps that the Perl release schedule has accelerated.

Piers continued with a high-level, hand-waving explanation of how MooseX::Declare works. While not informative, it was entertaining. Including a video of Matt Trout attempting to hypnotize the room.

Piers ended by thanking the Perl community and expressing how good it feels to be back into it and developing in Perl again.

OSCON 2008: The Twilight Perl

It’s the last session of the conference, and I saw Damian Conway’s name on the schedule. So here I am, attending The Twilight Perl. I have no idea what to expect, but come on, it’s Damian. It’s got to be good.

Based on past experience, this is likely to be a fast-paced, highly-entertaining talk. One which will be impossible to summarize, or no doubt even to explain, here. Needless to say, if you’re not here, you’re missing out. I intend to sit back, relax, and enjoy.

He’s talking about the defining characteristic of a hacker. Particularly when they’re told that something is impossible and can’t be done. The reaction is typically, “you wanna bet?”

He just presented a slide that read, “Let’s leave behind the shackles of sanity…”

Now I’m scared.

This is a great talk. It’s a series of examples of things “you can’t do in Perl.” At least, not until Damian shows us how.

I think Brad may have taken notes. Which is good, because now I wish I had.

[tags]oscon, oscon08, ocon2008, Perl, Damian Conway[/tags]

OSCON 2008: Perl and Parrot

It’s the first session on Friday and I’m in Perl and Parrot: Baseless Myths and Startling Realities with Tim Bunce. As people were filtering in from the break, Tim displayed one of my favorite xkcd comics for us to enjoy.

There are so many holy wars debates about whether one language is better than another. Instead, the right question to ask is whether or not the developer’s skill set is right for the job. I agree. When I look for a developer, I’m more concerned with how they think than in what language they think.

Unfortunately, Tim is preaching to the converted in this talk. Nearly the entire attendance already uses Perl and don’t believe the myths. With that, let’s conquer them anyway.

Perl is Dead

No it isn’t. It’s two decades old and still growing strong. The books aren’t flying off the presses with great speed because the Perl community already has excellent books.

The trend when searching for “web development” jobs shows Perl growing very slowly in relation to other languages, particularly PHP. However, searching for “developer” jobs shows Perl growing very strongly and holding its own extremely well.

As a lurking member of the Perl community and an active member of my local Perl Mongers group, it’s been my experience that Perl programmers tend to be quite happy with their jobs. Which, unfortunately, has made it very difficult for me to find talent.

In fact, Perl is growing faster than ever. A simple look at how much work is going into CPAN will show that. The community is strong and Perl is everywhere.

Perl Is Hard to Read / Test / Maintain

Only if you’re doing it wrongly. We have Perl Best Practices, to use as the default documentation for coding standards, leaving developers with the need to only document when they deviate from the norm. There’s Perl::Tidy, to force any Perl code into one’s own personal style. Perl::Critic for ensuring that code is being well-written and follows best practices. And there’s no end to the Test::* modules and the work being done to make testing easy. There’s even a coverage analysis tool.

Perl 6 is Killing Perl 5

In fact, Perl 6 saved Perl 5, but one has to be close to the center of the community to see that. One should notice that Perl 5.8 and 5.10 have both been released in the time that Perl 6 has been in development.

There is a culture of testing around Perl. So many tests have been written for Perl 6, and the language is being defined by its test suite. This culture has leaked out to the community. In fact, I find there now exists a lot of peer pressure in the community to do proper testing.

Perl 6 Is Not Perl

Yes, and no. Unfortunately, I was so busy trying to catch up with the last section that I missed most of the points Tim made. In the end, I feel that this is fine. If Perl 6 was supposed to be Perl 5, why not just use the perfectly decent, already existing Perl 5? Which is still being actively developed.

Perl 6 Will Never Be Ready

It’s not on a schedule and, if it were on a schedule, it would be crap. It will be ready when it’s ready. Better to do it right than screw it up. The development model encourages a lot of experimentation, and it’s difficult to schedule experimentation.

There’s No Perl 6 Code

Sure there is. Thousands of lines of Perl 6 code exist in the test suite that came about from Pugs. These very same tests are being used in Perl 6 development today in the form of Rakudo, Perl 6 on Parrot.

The important thing to note is that Perl 6 refers to a specification. It does not refer to a particular implementation. Any implementation that passes the test suite may call itself Perl 6.

From an authority in the audience (who I don’t recognize, unfortunately), we have been told that there will be a useable Perl 6 by this Christmas. A round of applause ensued.

[tags]oscon, oscon08, oscon2008, Perl, Tim Bunce, myths[/tags]

OSCON 2008: State of the Onion

It’s finally time for the State of the Onion. Larry Wall introduced this year’s theme, Rules That Are Meant to be Broken.

If he had Perl to do all over again, what would he do different? Only two things, nothing, and everything. Perl 6 is the everything part of the answer.

In Perl 5, one of the problems that creeps up is that regular expressions (regexes) are strings. The best example of this is variable interpolation in regexes. In Perl 6, this has been fixed. They are now their own language.

Like cargo-cult programming, parsing has turned into its own cargo-cult. Perl 6 breaks the mold when it comes to copying languages (the old lex/yacc loop), and instead uses polymorphism in its sub-language design.

Both regexes, double quoted strings, and single quoted strings are examples of sub-languages in Perl 6. Each of these sub-languages has its own parsing rules and therefore parsing implementations. This allows is code reuse. Parsers can derive behavior from other parsers, but treat the tokens differently as necessary.

Fundamentally, Perl 6 is very simple. It has no CORE. It has no built-ins and no operators. What Perl 6 has given us (will give us?), in effect, is a just in time lexer. Tokens and their behavior can be defined on the fly, on a per-sub-language basis.

There are quite a few changes to the regularity of regular expressions. Mostly what this means is that Perl 6 regexes are incompatible with those used in Perl 5, and that Perl-compatible regular expressions (PCRE) aren’t (or won’t be).

All languages tend to fall into the One True Syntax trap. Perl 6 has aimed to break out of that trap. By giving the user enough power over the syntax (rope) to design the language that suits them (hang themselves).

I didn’t enjoy the State of the Onion as much as I have in the past. I suppose that’s to be expected. Larry did warn us at the top of the talk that it would be serious and contain only a single joke. For as great a writer as Larry is, his ability as a public speaker is lacking. That’s okay, though. I’d rather he not shift focus away from the design and development of Perl.

[tags]oscon, oscon08, oscon2008, Perl, State of the Onion, Larry Wall[/tags]

OSCON 2008: Perl Lightning Talks

It’s 4:30pm on Thursday and that means it’s time for the Perl Lightning Talks. The crowd is excitedly gathering, but there are still plenty of seats as I write this.

Sorry guys, these are five minute talks. If I start summarizing, I’ll fall way behind. You’re lucky I even take the time to write this.

If you really want to know what’s going on, there’s a schedule.

For those of you still reading, here’s a bit of stream-of-consciousness for you. Note, if trying to match these up to the schedule, they are in order, but I didn’t comment on all of them.


Testing databases with TAP is cool. You really can test anything with it.


Nice to see The Perl Foundation get some slots in Google’s Summer of Code this year.


It’s interesting to see how much Perl is used to compile USA Today every day. Without Perl, it would be a very empty paper. Though I’m not convinced the content would be much different.


Schwern tells us that, in thirty years, time will wrap.

$time = 2**31 - 1;
print scalar gmtime $time;

Tue Jan 19 03:14:07 2038

$time = 2**31;
print scalar gmtime $time;

Fri Dec 13 20:45:52 1901

Wait, that’s not good. But he’s fixed it.


Sweet, Perl on Google App Engine!


Use autodie instead of Fatal. It’s better.

Also, Paul Fenwick is one of the best speakers I’ve seen in ages. I hope he becomes an OSCON staple.


F*ck, the F*cking thing is F*cked had the best slides.

IPv6Experiment.com (warning: there may be porn).

[tags]oscon, oscon08, oscon2008, Perl, lightning talks[/tags]

OSCON 2008: Ultimate Perl Code Profiling

Lunch is over and I’m here to listen to Tim Bunce talk about Ultimate Perl Code Profiling with Devel::NYTProf.

The Devel::DProf module is old and a waste of time and is broken. Stop using it. Take it out and shoot it.

The first obvious distinction between profilers is CPU time versus real time. CPU time tends to be highly granular, but doesn’t include I/O, context switching, or other kinds of blocking. That’s where real time comes in. It’s far more useful in the real world.

Tim, as with many of us, is interested in line-based profiling. It provides a high level of granularity The total subroutine time is not always useful, particularly in larger subroutines.

The NYTProf module is exremely fast, discounting the time taken by profiling overhead, making it quite a bit more useful for real world analysis. It also allows profile times per block, and can be aggregated up to the subroutine level. It’s a module with dual profilers: line-based and subroutine-based.

It gets better, every location that calls the subroutine keeps separate track of the subroutine time. This allows us to determine where the majority of the subroutine calls are coming from. For control flow statements, the decision expression is not taken into account when profiling the block that is executed. This is useful if the loop control itself takes time that should be discounted.

And that’s it for the description. Now we have half an hour to play with it.

The HTML-based reporting is inspired by Devel::Cover‘s reporting. Reported for each file are the number of statements executed, the time spent in the source file and the line, block, and subroutine reports. The subroutine reports include the amount of time spent within the subroutine and the amount of time spent in other called subroutines. The coloring of each line of the report—red, orange, yellow, and green—give a relative measure of deviation from the norm. Very impressive.

Even more impressive, Devel::NYTProf is capable of reporting exactly what a subroutine reference is called, even when it’s an anonymous subroutine compiled within an eval. With a handy link also provided, the called code can be easily inspected.

In summary, Devel::NYTProf is awesome. Use it. I know I will.

Tim Bunce is even more impressive than most people think he is. He is the only presenter I’ve seen so far who has managed to use IRC while giving his talk. Well, he didn’t actually type on IRC, but he had Colloquy running in the background. This particular IRC client uses Apple’s Growl feature to display notifications when you are mentioned in a channel. After he’s opened up the session to questions, one of those notifications pops up on the projected display:

<sirhc> Adam Kennedy (to Tim Bunce): Why are you so awesome?

It got a laugh, and Tim seemed to take it all in stride, even joking that he was not looking very professional on his screen cast. Important safety tip for session presenters, don’t leave your IRC client open.

[tags]oscon, oscon08, oscon2008, Perl, programming, profiling[/tags]

OSCON 2008: Perl for Political Campaigns

There was nothing interesting for me scheduled for the second session today, so I ended up in Perl for Political Campaigns, presented by Chris “Pudge” Nandor. I’m not entirely sure why I’m here, but it likely has something to do with Perl in the title and Pudge as the presenter. I must be in the right place, though. Both Damian Conway and Adam Kennedy are present.

Pudge is, quite famously, a Republican, so he wants poor people to die, he asserts his right to shoot people who jaywalk, and he hates puppies. Now that we have that out of the way, this will not be a political talk. Instead, it will be a talk that just happens to use politics as the problem domain for which Perl was the solution (but isn’t it always?). Pudge happens to volunteer for the Republican party in Snohomish county, Washington. I actually know the area fairly well, as my grandmother happens to live there.

Winning elections is all about knowledge. And blackmail. But, mostly knowledge.

This session is essentially about data mining. There are a number of disparate data sources available with information about voters. From registration and voting history to contact information and preferences—can or can they not be contacted. This data is not always easy to access. For example, there is something called the Voter Vault, which is a super secret database of voter information controlled by the Republican party (there’s an NDA involved, so we won’t see any of it).

Essentially, Voter Vault is a really crummy Web application that only works for IE (hence the crummy part). That’s where WWW::Mechanize comes in. Using this brilliant module, data on any Web site can be retrieved, even if it requires a certain amount of user interaction to access. This, along with other sites, like the Washington State Public Disclosure Commission, provide all the raw data Pudge needs.

However, raw data is, by itself, not useful to anyone. This is the reason behind Pudge’s efforts. He uses Perl (and some JavaScript) to collect and aggregate all of this data. Then, once it’s all compiled, he can use a bit of Perl glue to use the data in Apple’s Address Book and Mail applications. But, more importantly, he can visualize it.

For the visualization, Pudge uses everyone’s favorite new tool, Google Maps. Using the Ajax API provided by Google, he can embed a map in his own Web application and, next to it, provide controls to enable and disable different views of the data on the map. For example, candidate donations by city and how much each candidate received.

It gets better. With the Google Earth APIs available to Google Maps, KML files can be generated (again, with Perl) to provide even better data visualizations. For example, precinct boundaries can be imported and colored based on voting history.

Initially, I wasn’t sure how I’d feel about this talk, but I ended up enjoying it. It was an excellent presentation on how to take data and display it to users in a useful manner.

[tags]oscon, oscon08, oscon2008, Perl, politics, visualization[/tags]

OSCON 2008: Stick a fork() in It

First session of the day and I’m in room F150 (brought to you by Ford). The F wing, bereft of wifi. I’m here for Stick a fork() in It: Parallel and Distributed Perl with Eric Wilhelm of Scratch Computing. It’s great to see how popular Perl still is. It’s standing room only in here.

A computer once referred to a human worker who would perform calculations. This was a fairly easy thing to cluster and “run” several computers in parallel. As time progressed, more and faster work was desired. Enter the electronic computer, and specifically for this talk, the Cray. As with anything, the inner workings of the Crays of old can be recreated in Perl. Just use the Cray module, no problem (if only it existed).

After the history lesson, we move into high level overviews of parallelism and pipelineing, and a note about Amdahl’s Law. This was followed up with an example for detecting prime numbers by partitioning the work.

The slide presentation was over in under 20 minutes. Instead, we’re jumping straight into code examples. Awesome.

Or so I thought. Unfortunately, he’s been interrupted by multiple people in the audience, who keep wanting to move off into tangential conversations. Eric is having difficulty bringing the talk under his own control—it’s no longer his talk, but that of the somewhat rude fellow in the front row. Neither is Eric as eloquent when he switches from a prepared talk to demonstrating and explaining real code. It’s become far more difficult to pay attention to this session, and I find myself looking at the clock to see how much time we have until the next session.

For real fun, be sure to check out Brad’s post on Schwern’s session about skimmable code.

[tags]oscon, oscon08, oscon2008, Perl, programming[/tags]