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.

Pie-thon!

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/pie-thon.pl.

http://groups.google.com/groups?threadm=40F26AD7.40000@toetsch.at – Parrot runs a Python lambda

http://groups.google.com/groups?threadm=a06110407bd1c65dd4c0e@%5B10.0.1.3%5D – Notes on pie-thon.pl

http://groups.google.com/groups?threadm=a06110400bd1cf1d2b965@%5B10.0.1.3%5D – Namespaces for built-ins

http://www.sidhe.org/~dan/piethon/translator.pl – 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.

http://groups.google.com/groups?threadm=a06110402bd1ae870b2ad@%5B10.0.1.3%5D

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).

http://groups.google.com/groups?threadm=40F28C82.3010904@toetsch.at

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.

http://groups.google.com/groups?threadm=20040713210952.GC2452@elch.elche

Parrot Configuration – A Small Perl Task

Leo asked for volunteers to fix up Configure.pl 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.

http://groups.google.com/groups?threadm=40F76AE3.4000506@toetsch.at

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.

http://groups.google.com/groups?threadm=a3ada2d104070804124184a442@mail.gmail.com

Pushing Lazy Lists

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

http://groups.google.com/groups?threadm=200407121213.12812.philipp.marek@bmlv.gv.at

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.

http://groups.google.com/groups?threadm=40F26C12.6030704@toetsch.at

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.

http://groups.google.com/groups?threadm=20040713071222.GC338@matfyz.cz

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 Application.new.run 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).

http://groups.google.com/groups?threadm=20040713132455.GC27097@babylonia.flatirons.org

Cartesian Products and Iterations

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

http://groups.google.com/groups?threadm=Pine.LNX.4.58.0407131513280.30821@q.pcteor1.mi.infn.it

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().

http://groups.google.com/groups?threadm=20040718172834.89363.qmail@onion.perl.org

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 mailto:pdcawley@bofh.org.uk

http://donate.perl-foundation.org/ – The Perl Foundation

http://dev.perl.org/perl6/ – Perl 6 Development site

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub