Saturday, June 22, 2013

Camelia at Age 13: Perl 6 on the JVM Debuts

Perl 6 is now thirteen years old.  And she's very much a teenager in attitude, self-confident yet still growing up.  This contrasts with Javascript, which emerged from Brendan Eich's head, fully-formed like Athena -- but that only shared the Zeus-sized headaches with everyone until JQuery came along.

But Camelia, as she is fondly referred to by fans of Perl 6, is growing up fast.  Both too fast, and not fast enough.  To some of the community, the prospect of major changes to the language is scary.  Perl 6 is trying all of these crazy new things -- invariant sigils, metaoperators, grammars. She's even doing subroutine signatures, because "all of her friends are doing it".

They can't stay little children forever, you know.

And teenagers are liable to do surprising things.  So it was, that this week we announced Rakudo Perl 6 now runs on the Java Virtual Machine (JVM).  It's not perfect yet, but 62% of the files in the spectest pass as of yesterday.  Given the rate things are progressing, I'm sure it's already at a higher pass percent.

And yet, I'm sure there is no small number of you whose first thought about Perl on the JVM was "Heresy!".

There are certainly good reasons to support this point of view.  Startup times are horrible at this early stage, still O(seconds), and much of that is JVM's overhead.  It has well known security issues.  And of course the major implementation is controlled by $corporation, who just wants to make money off it.  And why would we want to abandon open-source VMs?

Still, there are plenty of good reasons for the port.  One is that the JVM is ubiquitous, and many devices have a copy pre-installed.  Most of Java's stability issues have been dealt with, and it serves Perl's competitors well enough through Jython and JRuby.  And it is well-documented, with bazillions of libraries (more than fooilions, anyway).  So we can finally address the longstanding desires of the community in things like sockets and threading, because we can tell the difference between our mistakes and those of the VM.

Instead of thinking of Perl 5 as a "sister language", I like to think of it as Camelia's father instead.  A father that might be kind of upset that she brought "that kind of language" into our house.  But she has a mind of her own, and I'm afraid that this won't be the only boyfriend she'll be bringing home.  There is a GSoC grant to build a Javascript backend to Rakudo.  And Niecza Perl 6 already uses the .NET Runtime.

However, Perl 6 is not abandoning open-source and C language implementations, either.  The announcement of MoarVM shows that Perl 6 developers plan to develop a lightweight VM specifically for NQP and Rakudo.  C functions will be directly callable within Perl itself, with the NativeCall interface.

Now, if Parrot fly off on its own course, that's Parrot's call.  You know how these teenage relationships go -- this could end up in a blow-up on the quad, or just as easily turn into hot makeup coding.  What, you didn't think I was going to say something that would violate the CoC, did you?

But Perl 6 is not done growing yet.  Camelia, like other teenagers, cares about fashion and wishes she had better threads.  And, once we get tuits, this is pretty high priority.  Because any modern language needs to live in the multi-core reality.  This is something that we can still design around,  that may not have recieved the same care ten years ago.  Many threading features are already baked into the language, like hyper operators and async blocks.

So I view the debut of the JVM port as Rakudo's real début, as with a debutante.  A treceañera, if you will.  I guess, given that she's 13, maybe it's a Bar Mitzvah -- except that she's not a boy, she's a butterfly.  But this is a chance acknowledge Perl 6's presence in the language scene.  Of course, these coming-of-age ceremonies don't mean the teenager is truly grown up yet. 

But grow up she will, and faster than some of you might like.  Perl 6 is rebellious, and changes things that those in her father's Perl 5 community don't understand.  But if you talk to the pumpkings, they sincerly hope that Camelia doesn't turn out exactly like her father.

After all, do we want keep the ithreads model?  Do we want to modules that dig into the compiler internals like XS does?  Perl 5 isn't perfect, we are just accustomed to its particular idiosyncrasies.

But for all that Perl 6 is different, she still loves her father.  We still have sigils, classes, @_ in subs (if you still want it), P5-style regexes, modules, and TIMTOWTDI.  It's still Perl.  Moreover, there are at least two efforts to run Perl 5 code in Perl 6 -- the v5 grammar/compiler in Perl 6, and access to libperl from MoarVM.  So the sky isn't falling on compatibility.

Nor is the other extreme true: Perl 6 development is in fact moving forward at a fast pace.  We know that Perl 6 is late.  Very late.  So late, in fact, that it's her father that's going to turn into a Pumpkin.  But when Perl 6 finally comes of age -- sooner than you think -- it will be something that the Perl community will be proud of.

And I apologize in advance for anything Camelia does in her bratty teenage years.

Thursday, June 6, 2013

Thanking the Perl Community for an Awesome YAPC

My first time at YAPC::NA was too incredible for words. That said, because this is a blog, I'm going to have to put it in words anyway.

So, about a month ago, I didn't even know that I was even going to YAPC.  I was just talking to raiph++ in an IRC back channel, when he asked me if I was going to the conference.  I said that it would be fun, but I didn't really have money to go.  Being unemployed means lots of free time for hacking, but not so much free money for going places.

Well, raiph told diakopter++, who asked if I could be willing to go, if he found funds.  I responded, "Of course, if you think it's possible."  I soon went to sleep, and twelve hours later, I had a plane ticket to Austin in my inbox courtesy of The Perl Foundation.   So just like Peter Rabbitson's case, the Perl community eagerly gave me a chance to attend.  So thank you to all 440 attendees, and all of the sponsors for your own personal contribution to my attendance.  Even though I'm new, you all gave a me a chance to participate in the community, and for that I am grateful.

And what a community it is.  I've long known that Perl programmers were a little strange.  Naturally, I fit right in.

The conference itself had quite a fun and informative series of talks.  More often than not, I had two or more that I wanted to attend at the same time.  For the most part, I stuck to the Perl 6 "track", where most of my work has been so far.  After all, it's not often that so many of the European contingent make a trip to our humble continent, so I was eager to spend time with them.

No one warned me that jnthn++ has a tendency to spring wild new features on us at YAPCs.  Reversible grammars, seriously?!  I'm still trying to wrap my head around that one.  The announcement of MoarVM was equally exciting, as it offers us a chance to start fresh with everything we learned about Perl 6 and virtual machines in the last five years.

So I have to say diakopter++ once again.  Besides introducing Moar in his talk, Matthew Wilson was constantly busy behind the scenes, making sure that everything ran smoothly the entire conference.  I think the man must be buying tuits on the black market.

YAPC also helped immensely in my hunt for a job.  The job fair brought me several contacts, and the talks helped me learn which skills I'll really need to learn in those jobs.  Person-to-person contact offers so much more in truly understanding the state of the language, and of what projects are of the greatest use right now.

Truly, Perl's community is it's greatest strength. 

It's the community that keeps Perl vital.  After seeing YAPC for myself, the whole "Perl is Dead" meme seems entirely baseless.  Conference attendance was up 19% over last year, which was the previous record high.  Perl feels like a growing language, with lots of experiments in how to revitalize the now 25-year-old syntax with p2, moe, and Perl 6.

The community keeps Perl relevant.  While it may not be the sole alternative to bash scripts like it once was, it is used for enterprise and homebrew projects alike, from the stock exchange to the surface of Mars.  Projects like DBIx, Moose, and Dancer provide modern frameworks to acomplish more with less work.

The community keeps Perl open.  No one seemed to be afraid to say what they felt, on or anything else, but everyone remained civil.  Hallway++ is a great social hack to get everyone to feel comfortable talking to each other.  So when I found myself sitting across from TimToady, instead of being intimidated as a newbie, I had a great conversation with him about supervolcanoes and nonverbal Japanese language.

And the community really wants all of the projects to succeed.  I spent a lot of time at non-profit and political events in the past, where we were all theoretically working for a common cause.  And yet scheming, conflict, and political maneuvering were inevitable.  But in Perl, where we actually have multiple implementations and modules competing for mindshare and tuits, people cheer for everything to succeed.  No one fights each other or rages against $language_of_the_week stealing our users, for the real enemy is the lack of tuits.

I overheard this at dinner last night, from a fellow first-time attendee:
"I'm just happy that the two of you liked my work." -- vanstyn
Although he was talking about DBIx, I think that captures the spirit of conference as a whole.  All of us here -- from the n00bs to the pumpkings -- want to share our work and make something useful for others.  It's not an organization where we wait for pronouncements from on high, but one where users create endless variations and share them.  Not an organization so much as a family.

During TimToady's epistle/speech to the community, he said something like:
"We have faith, hope, and love, but the most awesome of these is love." -- Larry Wall
A line like this might seem a bit hokey out of context, but it was actually moving when I heard it.  We have faith that we can use Perl to solve our problems.  We have hope that Perl 5 and 6 will continue to get better. And we love Perl, unconditionally, despite all of her flaws.  And as Wil Wheaton says about us geeks, we just want to love our special thing the best we can, and go the extra mile to share it with others.

I just want to say that I love the Perl community right back.  You went out of your way to include me and all the other newcomers.  You all gave me all a chance to learn, play, and code with you -- and to be part of your community -- and I am so glad you did.