Provides an introduction to this
new language from
the creators of Perl and Python. Not just a comprehensive language
reference, it demonstrates advanced programming techniques in
including programming network clients and servers, software
and the use of Parrot on the World Wide Web.
Today brought the official announcement that many of us in the Perl and Python communities had been awaiting and expecting for some time now: the culmination of the year-long collaboration between Larry Wall and Guido van Rossum, and the establishment of a period of joint development between the developers of Perl and Python.
It's my pleasure and privilege to bring you an exclusive interview with Larry and Guido, where we discuss this exciting announcement.
LW: ..and I was very aware that we needed a big shake-up in Perl and the Perl community. Perl needed to be completely rethought, the language and the community redesigned from scratch. A lot of that happened when we started work on Perl 6. We completely reorganised the development structure, and I was elected to go away and redesign the language.
GvR: So we got together and started talking about the changes that both needed for our languages, and we decided we should try to help each other out, and that's really where the idea for joint development came from.
GvR: We also got talking about Microsoft's .NET, and the Common Language Runtime; we agreed it would be a really good idea to try and push our interpreters closer together, so that eventually you'd be able to run Perl and Python bytecode on the same interpreter.
LW: But then when I collected together the change requests - we called them RFCs - for Perl 6, I just couldn't help thinking "Hey, Python's already got a lot of this sorted out".
GvR: Right, and I found that I needed to bring in some things to Python that Perl had had for years, such as nested scopes for variables. So we just brought the ideas together, and we came up with the design of a brand new language.
LW: We also wanted the name of an animal, to represent the combination of the camel and the python. It also helps with the book covers...
GvR: Eventually, I came up with Parrot after thinking about Monty Python's finest hour, the Parrot sketch.
LW: It just sounded right - dynamic, colourful, exotic. I love it!
LW: I think it was quite easy to come up with most of the ideas for the language design; after all, we've both had a lot of experience designing languages and we know what works and what doesn't. The Perl 6 RFCs were also a great help, as an indication of what I thought would work but what actually didn't.
GvR: Fundamentally, a lot of the concepts we had in our languages were identical; it was just a question of deciding on the best ways to put them all together.
# copy stdin to stdout, except for lines starting with # while left_angle_right_angle: if dollar_underscore =eq= "#": continue_next; } print dollar_underscore; }LW: I think this shows exactly what we were trying to achieve: it's immediately obvious to both Perl and Python programmers what that does. We've got a great compromise between Perl's brace-structured blocks and Python's white-space blocks; we've merged the names of language keywords in an elegant way; we've kept the idea of Perl's shortcut variables, but we've combined that with Python's readability.
GvR: Of course, this is just one way you could write that program. There's more than one way to do it, right, Larry?
LW: Sure. I'd probably write the program something like this:
while(@line = Sys::Stdin->readline()): continue_next if $line =eq= "#": print @line; }
GvR: Exactly. We're going to be getting our development teams to work together on the Parrot interpreter. Dan Sugalski and Jeremy Hylton are sitting down now to work out how to go forward, how to merge the code that we've already got; we hope to have some results for you by this year's Parrot Conference at the end of July.
GvR: I think it'll be a little harder for Python people to accept than Perl people. But then, this is the direction we've been moving in for a while now. Python 2 has had to introduce some features that Perl has had for a long time, such as nested scopes, and there were many other changes I felt we needed to make, all of which were pushing us towards the best features of Perl. But I agree with Larry, I think once Python programmers realise that this is a combination of the best parts of both languages, they'll feel right at home programming Parrot.
GvR: Well, yeah; we were expecting some people to get scared off by the idea. It's only natural. Incidentally, John Ousterhout was very interested in what we were doing, but I haven't heard what the Tcl guys think about this.
GvR: I can't imagine what you're talking about. (Fnord.)