This Week on Perl 6, Week Ending 2004-07-18

Following last week's bizarrely dated summary (I misplaced a day) we're back with the correct week-ending date, but I'm ashamed to admit that I've slipped to writing on a Tuesday again. My head hangs in shame and I am filled with the direst remorse.

It will probably happen again though; life's like that.


Anyone would think that the possibility of not even being able to run the Piethon benchmark (let alone getting a pie in the face for running it too slowly) weighs heavily on Dan.

The bulk of the week's traffic related to getting to the point where we can at least run all the tests.

Python::Bytecode, the module that parses, well, python bytecode, shot up in version numbers; I think it reached 2.7 by the end of the week.

Dan released a Piethon translator, a tool that uses Python::Bytecode to translate Python to Parrot. So has Leo. Dan's is on his web site (see the link below); you'll find Leo's in languages/python/ -- Parrot runs a Python lambda[] -- Notes on[] -- Namespaces for built-ins -- Dan's translator

Semi-Stack Code

In a quest for speed when emulating python's stack manipulation ops, Dan outlined a plan for manipulating a pseudo-stack using some of Parrot's PMC register (18-29, with P31 used for overflow). Leo wasn't convinced it was needed.[]

string_to_num Precision

Leo's got some problems with the precision of the string_to_num function found in string.c. He doctored things to use atof, but Dan's not so keen on that idea because atof doesn't have standard behavior across platforms. He recommended grabbing Perl 5's string_to_num code (which he thought we'd already done). Nicholas Clark wasn't convinced that this was a good idea; he reckoned that Perl 5's code wasn't good enough. I think Nicholas convinced Dan that atof is actually the right thing to use (with a little preprocessing to deal with C99's atof being incompatible with C89's -- Parrot expects C89 behavior).

GMP Licensing

Armin Obersteiner reported his investigations into the licensing requirements of the GMP maths library. It appears that the FSF's 'GPL Compliance Engineer' reckons we won't need to include the GMP's source code with binary distributions. We just have to make it available from the same source as the distribution. Which is handy.

Parrot Configuration -- A Small Perl Task

Leo asked for volunteers to fix up in order to make it less dependent on the host Perl's configuration. Brent Royal-Gordon provided a teeny-tiny patch that's actually shorter than Leo's description of the problem.

Meanwhile, in perl6-language

Scalar Subscripting

Remember Guatam Gopalakrishnan's question about subscripting scalars? Discussion continued. One Piers Cawley (who he?) suggested that it should be possible to specify a postcircumfix:[] is rw method in the String class to make string subscripting behave in a helpful fashion. He also suggested pulling this (and other similar behaviors) out into a Sequence trait. Juerd thought the proposed method name was a little verbose compared to Ruby's syntax for doing the same thing and showed off some rather pretty Ruby metaphors.

Another sub-thread discussed interpolation in strings. Larry's changed his mind so that "$file.ext" is now interpreted as "$object.method". You need to do "${file}.ext" or "$( $file ).ext". Or maybe "$«file».ext" by analogy with %foo«bar». James Mastros pointed out that . is rather ambiguous in a literal string; sometimes a full stop is just a full stop.

Pushing Lazy Lists

This thread continues to resemble the lists it is nominally discussing: Infinitely long and possibly endless.

Perl 6 and Parrot Essentials, 2nd Edition

Leo pointed us at an O'Reilly press release announcing that the second edition of Perl 6 and Parrot Essentials is available. Huzzah! Let joy be unconfined.

Rules to Match Abbreviations

Hans Ginzel wondered wondered about adding something to the rules system to easily match specified abbreviations of a string. Luke Palmer came up with a (pretty ugly) solution that he then wrapped very neatly in a rule.

Enhancing open

There's a good deal of mileage to be had talking about how to improve the open function it seems.

Larry continues to come up with new and interesting ways of designing the language in such a way that almost every decision about how to do something can be deferred. Speaking as someone who wishes he could just write and then debug his way to working code, I'm all for this kind of late binding.

It's also amazing how much use Larry's getting out of his colon. (The character, obviously).

Cartesian Products and Iterations

Michele Dondi wondered whether Perl 6 will support Cartesian products between lists. Short answer: Yes. It's probably called outer.

Do We Really Need Filehandles?

Dave Whipp thought the unthinkable (but in a good way) and wondered if we actually need user-visible filehandles, given the tools we have for slicing and dicing strings, manipulating lazy data structures, etc. He proposed being able to write:

    my $text is TextFile("/tmp/foo.txt");
    for $text.lines -> {

Which is rather neat, isn't it? Personally I'm not sure we can get rid of filehandles, but I do like the idea of a library that implements something like this. Alex Shitov pointed out that there would still be a need for methods like $text.flush() or $text.close().

Announcements, Apologies, Acknowledgements

OK, so the interview was on Tuesday the 13th of July. It went well; I'm going to be a maths teacher.

If you find these summaries useful or enjoyable, please consider contributing to the Perl Foundation to help support the development of Perl. You might also like to send me feedback at -- The Perl Foundation -- Perl 6 Development site

Visit the home of the Perl programming language:

Sponsored by

Monthly Archives

Powered by Movable Type 5.13-en