Perlcast

Interview with Audrey Tang

Perlcast is back in action with an interview with Audrey Tang, the creator of the Pugs project, maintainer of numerous CPAN modules, and general contributor to open source. In this interview we discuss Pugs, what it is and where it is going.

O’Reilly is also giving away ten editions of the upcoming book “Perl Hacks” through their new Rough Cuts system. To be entered in a drawing for “Rough Cuts”, just send an email to perlcast+perlhacks at yapcchicago.org.

Transcription

Introduction

Josh

Today is Tuesday March 28th 2006 and you’re listening to another Perlcast interview. This is your host, Josh McAdams, here with an interview with Audery Tang. Audrey blasted onto the Perl scene with the Pugs project. Aside from that, she maintains over one hundred CPAN modules and is a contributor to numerous open source projects.

As an added bonus O’Reilly will be giving away ten electronic versions of Perl Hacks through their Rough Cuts program. To enter the contest, just send an email to perlcast plus perlhacks at gmail dot com. That is perlcast, the plus sign, perl hacks, the at sign, gmail dot com. Get those emails to me by April 10th for the drawing on April 11th.

And now, on to the interview.

Interview

Josh

Welcome to another Perlcast. Today on Perlcast I have Audrey Tang. Audrey is very well known for her Pugs fame here in the Perl world, but she also maintains many other modules. I think about a hundred on CPAN also. Well, welcome to Perlcast Audrey.

I guess we’ll get started and I’ll just ask, for those who don’t know, what is Pugs?

Audrey

Pugs is a project that works on everything related to Perl6 with, many sub-projects… one that parses Perl6, runs Perl6, translates Perl6 to other languages and runtimes. We also work on Perl6 examples, documentations, tests, and, well, everything else.

Currently Pugs is the only Perl6 implementation, but that may change in the future.

Josh

If somebody is really wanting to learn Perl6 then Pugs, would be the only way that they could go right now.

Audrey

Yeah, I think is the case.

Josh

Whenever you say Pugs is a Perl6 implementation does it actually just parse the Perl6 language and get that into something that Parrot can run or does it go further than that?

Audrey

Well, currently we have a reference implementation written in Haskell that runs Perl6. But we also have pretty comprehensive support for compiling Perl6 and turning it into JavaScript that runs in your browser.

And, besides that we have Parrot and Perl5 compilation targets that are coming along pretty well. But the most exciting thing by far is to write one more of these parts in Perl6 itself so that one day we will have a fully bootstrapped Perl6 compiler and also the implementation runtime already in Perl6 itself. And that will be the ultimate goal for the Pugs project.

Josh

So that was one thing that I was going to ask you about: bootstrapping the language. So at one time I think that Perl5 was gonna be used and then at another time C. And now, is it going to be Pugs that used, or Haskell, that’s used to bootstrap the language?

Audrey

Well, we are using Perl5 and Haskell and well basically everything at our disposal. But, I think the way to think about this is while in Perl5 all of the language features are hard coded into the runtime, into the interpreter, in the XS C-level macro language. In Perl6, actually, there is just a very minimal language inside and all the other sugars are just translated. We call it desugaring. Basically from complex macros and rules into this very simple language and then we can take this simple language and compile it to Parrot or to Javascript or to Perl5.

So this translation process, this the sugaring process, could be written in Perl6 or Perl5 or Haskell. So think of it as a scaffolding that we’ve already built in Haskell and we are taking it bit-by-bit off and replace it with pure-Perl equivalents so that one day it can bootstrap itself.

Josh

You actually announced this project in February of 2005 and so a little over a year has passed. Are you pleased with the progress?

Audrey

It was quite unexpected. I mean I started this as my pet project, pun intended, to learn about junctions and multi-methods, the exciting Perl6 features that were at that time quite poorly understood. And then people started submitting patches and writing IRC bots in it and, gasp, deploying it in production. And, yeah, I totally didn’t foresee it happen and my life haven’t been the same since then. But overall I was very impressed and amazed by our 200 contributors and nearly 10000 revisions in the first year and with Larry Wall and Damian and other people becoming committers and hanging around IRC. I think the next year is going to be even more amazing and impressive.

Josh

I noticed that was mention in the Q&A of the Pugscode website that Pugs could be used kind of as a test for ideas in the Perl6 language. So, has that actually happened and has Pugs been used to shape some of what Perl6 will be as far as syntax?

Audrey

Oh yes, definitely. In #perl6 IRC Freenode, we have Larry Wall and Chip of Parrot and Rafael of Perl5 and a lot of other people who care about the language evolution of Perl5 and Perl6. So I’ve been experimenting with the ghost writing procedure where we experiment with some Perl6 features in Pugs and discover what works and what doesn’t work or make feature suggestions. And because Larry and other design team members are on IRC, so we make a decision right there and get other people to review and then I’ll commit it into the synopsis that is the Perl6 language specification. So it is done in a very iterative and very very fast fashion, this feedback loop between the implementation and the language design.

Josh

Well after Perl6 does finally arrive, what is Pugs gonna be at that state? Will it still be useful, will it still be around?

Audrey

I think the Perl6 design team makes a distinction that Perl6 is a language, while in Perl5 you know that it’s a pun right? Depending on one bit, whether it’s written upper case, where perl5 means the language or it’s lower case where Perl5 means the implementation. No matter how you write Perl6, Perl6 is just a language. So, Pugs the project produces, depending on how you count, two or three Perl6 implementations already. And there will be no doubt be other Perl6 implementations in the future. Not necessarily from the Pugs project.

But, yeah, Perl6 will become like C or C++, a language with many implementations and I think that is a very good thing to drive innovations forward.

Josh

Why in the beginning did you choose Haskell to implement Pugs?

Audrey

Because I was learning Haskell?

Well seriously, I think Perl6 and Haskell have many things in common. Perl6’s major features such as power parsing with rules and grammar and infinite lists and streams and complex data structure matching and pipe system. All of those things are present in Haskell, if not in the very sweet and sugary and convenient Perl6 syntax. But, they share some very similar underlying semantics.

So by starting with something already resembles Perl6 somewhat, it’s far easier to get something up and running very quickly instead of starting from something that is quiet apart from Perl6, which would make things much harder.

Josh

Pugs seems like an amazingly intimidating project to get started on, but I’m sure
you need quite a bit of help, so what types of help are you needing right now?

Audrey

It is really not that hard to start jumping in and hacking because one of our newest and most exciting sub projects is the Perl5 runtime, where we taking pieces of Pugs, the rules parser and emitter and compiler and turn them into CPAN modules that you can use in your existing Perl5 programs.

So for example we just uploaded Pugs::Compiler::Rule, a rules engine written in Perl6 cross-compiled to Perl5 and you can use that in your Perl5 program now. And there will be more modules like that in the future, so if you know Perl5 its really easy and exiting to start hacking Perl5 and Perl6 interoperability. So that you can mix Perl6 and Perl5 in the same programming, running in the Perl5 interpreter.

But, we also very much need English hackers because the synopsis only specifies the look and feel of the language. But, we are writing real Perl6 programs now so we’re also in need of specifying the various APIs, the methods of the building objects, and things like that. So we are collecting the various overviews and tutorials and things like that and turn them into a Perl6::Doc launched on CPAN so people can access it with the normal POD tools. So if you know English and/or POD, then that would be an exciting thing to get into.

But, in Pugs we’re really language agnostic because our intermediary data structures are mostly in YAML now. And YAML can be loaded and manipulated in any language. So no matter what you are interested area is, like a refactoring browser or a syntax highlighter, you can write it in your favorite language.

Josh

Audrey, I really appreciate you coming on Perlcast and telling us a little bit about Pugs. is there anything else that you’d like to tell the audience.

Audrey

Hmm, let me think about it. Well I think this podcasting is a wonderful idea so I’ll probably convert my public talks about Perl6 and Pugs and turn them into MP3 and flash and upload them to pugs.blogs.com. That’s the Pugs development journal. So, feel free to check it out.

So, Perl6 is fun and Pugs is fun and just join us and have fun. Thank you very much Josh for the interview.

Closing

Josh

I would like to once again thank Audrey for taking the time to be interviewed and also thank O’Reilly for their continued support of Perlcast through promotional give always. On that note, remember to get your entry in by April 10th to perlcast plus perlhacks at gmail dot com.

Be sure to check back with Perlcast soon. There are interviews with Bob Walsh, the author of “Micro ISV: From Vision to Reality”, as well as, Steve Oualline, the author of “Wicked Cool Perl Scripts”, already recorded and awaiting post production.

Also, as some of you know, I’m helping organize Yet Another Perl Conference this year in Chicago. Well, we just opened registration for the conference, which will be held from June 26th to 28th on the campus of the Illinois Institute of Technology. Also, just after the conference we will have three open classes taught by some of Perl’s premiere instructors: Learning Perl by brian d foy, Intermediate Perl by Randal Schwartz, and Perl Best Practices by Damian Conway. With the conference costing only $85 and the classes only $200 each, this is one of the best deals in conferences today. Check out http://yapcchicago.org for more information and instructions on registering.

The GarageBand.com artist for this podcast was Feldspar with “Lunatics Audio” from their “Metropolis Mixes” album.

Thanks for listening to Perlcast. This is Josh McAdams signing out until next time.

I really enjoy these perlcasts, thanks for doing them. I curious though, what’s with using a vocoder? Or was my mp3 bad…

I think that Audrey said that she was using a noise cancellation device. The recording picked it up pretty badly, so her voice was somewhat mechanical.

Er, the first time over Skype I was under noice cancellation (which caused a very flat/quacky sound), so that soundtrack was discarded, and the current .mp3 was re-recorded later with a higher-quality microphone.

At that time I was playing with http://www.audio4fun.com/ as a voice training program, partly prepare for my upcoming voice chord surgery. So the voice in the .mp3 was “masked” by VCS and thus quite mechanical.

I’ll probably get a difference voice after the operation, and possibly re-record the .mp3 again with that voice. :)

whatever can be said of the perl6 project, whatever life is in it is there due to audrey