This week on Perl 6, week ending 2003-11-09

Traditionally this paragraph concerns itself with a few words on what I’ve been up to before finally settling down to get the summary written. But despite the fact that it’s nearly four o’clock, it’s been one of those days where I seem to have done almost as much as Leon Brocard generally does to warrant a mention each week.

So, here’s what’s been happening in perl6-internals to make up for the lack of guff about breadmaking or whatever. (If you’re interested, the raisin borodinsky I mentioned last week was an unmitigated disaster. The focaccia was fabulous though).

New glossary entries

Gregor N. Purdy has added a few entries to the Parrot glossary, so if you’ve been bursting to know what PIR, IMCC and other Parrot specific clusters of capitals stand for, check out docs/glossary.pod in the parrot distribution.

String Encodings hurt my head!

Peter Gibbs is attempting to implement the DBCS encoding (whatever that is) and has discovered that he can’t implement skip_backward for it because of the mixture of 1-byte and 2-byte characters. He offered seven suggestions for the right thing to do at this impasse.

Michael Scott didn’t have any suggestions about the Right Thing, but he did point to a page on his very lovely Parrot Wiki which discussed most things Unicode for parrot, and made a plea for Dan (or whoever) to produce a Strings PDD. - Michael’s WikiWord

Perl 6 patches

Allison Randal posted a couple of patches to the current (very) mini Perl 6 that comes with Parrot (in languages/perl6. A little later in the week, Joseph F. Ryan contributed a Perl 6 patch. It’s good to see this receiving attention again.


Nick Kostirya wondered why docs/parrot_assembly.pod appeared to be simply an old version of docs/pdds/pdd06_pasm.pod. He also worried that docs/ops/ appeared to be empty in the 0.0.13 release of Parrot. Dan noted that both of the parrot assembly docs were wrong, and that what would probably happen would be that the PDD would be updated and docs/parrot_assembly.pod would be retired. Jürgen Bömmels said that the empty docs/ops was because during the Great Move, the Makefile that generated those POD files didn’t get updated to cope with the new location of the .ops files. Nick wondered which other POD files might be going away so he’d not have to go through the process of translating obsolete docs into Russian. – Why can’t I type in Cyrillic?

From the “Interesting, but is it useful?” department

Melvin Smith has been playing with an uncommitted version of invoke which allows you to invoke a function by name not address. He outlined the ideas behind it (and the workaround to make it play nice with the GC system), but wondered if it was actually of any use. Dan and Leo both agreed that it wasn’t because of issues with threading and the JIT.

Freeze/thaw data format and PBC

Leo Tötsch is working on the data serialization/deserialization (aka Freeze/Thaw) system discussed over the last few weeks. He wondered if there were any plans for the frozen image data format. Leo’s plan is to use PBC constant format (with possible extensions) so things integrate neatly into bytecode. Dan had a bunch of comments, but the PBC based format idea seemed to be well received, with the caveat that it should be a ‘dense’ format.

Opening files on other layers

Jürgen Bömmels asked for comments on a patch for opening files on different layers which had a few issues that he felt needed clarifying. He and Melvin Smith spent some time discussing things.

Apologies for not doing a better job in summarizing this thread, but I’m hamstrung by not quite knowing what ‘layer’ means in this context.

Parrot Has PHP

Okay, so the subject line’s not quite true (yet), but who could resist the recursive acronyminess of it? Anyhow:

Thies C. Arntzen and Sterling Hughes, core PHP hackers, popped up to discuss the work they’re doing on porting PHP to Parrot. Specifically, they’ve hit a performance snag where PHP’s typeless nature meant using a PMC where they would rather be using a native type for speed. Thies proposed a new datatype to get ‘round the issue.

The general response was “Hey! Fabulous! Someone’s making a serious effort to port a real language to Parrot! But that new type suggestion is just reinventing the PMC. Oh, and if you could change your generated code slightly you’d get much faster execution”.

It’s definitely fabulous though. – Thies and Sterling’s presentation

newsub and implicit registers

Melvin Smith was concerned about the version of newsub that implicitly sets P0 and P1, which can give IMCC’s register tracking code something of a headache. He proposed getting rid of the implicit version and simply using IMCC to hide things. Leo agreed that the implicit form of newsub wasn’t really necessary, but pointed out that there were plenty more ops out there that had implicit registers that IMCC needed to track. Leo has a patch in his tree that deals with the issue.

HASH changes

Jürgen Bömmels wasn’t entirely happy with some recent changes to HASH in src/hash.c which make the hash tests fail. Nor was he happy with the asymmetry of hash_put and hash_get, where you hash_put a void *value but hash_get back a HASHBUCKET. Leo apologised for breaking the tests, but defended the asymmetry because it allows for distinguishing between a value of NULL and a nonexistent key. Jürgen wasn’t impressed, sometimes the ambiguity is exactly what you want.

Jürgen ended up submitting a patch which implements a new, extended hash querying API:

  HashBucket *hash_get_bucket(...);
  void       *hash_get(...);
  INTVAL      hash_exists(...);

NCI broken on Win32

NCI, the Native Call Interface, tries to help its users by adding the appropriate ‘loadable library’ extension to any library it’s asked to load. This turns out to be the wrong thing to do when you’re trying to use the NCI from Win32, where there’s more than one possible extension for a loadable library (this turns out to be true for Mac OS X as well). Jonathan Worthington let slip the fact that he was working on a library to give Parrot access to the entire Win32 API, and that this would involve loading a file with a .drv extension, which isn’t currently possible with Parrot on Win32.

The catch is that, in a lot of cases, you need to be able to leave the extension unspecified because different Unix like OSes use the same basic library name, but a different extension. (For instance, a Linux box uses ‘.so’, and OS X uses ‘.dynlib’). Leo proposed a workaround of only adding the default extension if the file name didn’t already include a . in the filepart. Jonathan thought that sounded workable, but suggested that simply trying to load the library with the name as given, then trying with the default extension and only if that fails throwing an exception, but Leo thought that that would slow down opening libraries quite substantially.

Regular expressions

It’s been a busy old week this week. First we hear of an effort to port PHP to Parrot, and then Stéphane Payrard announces that he’s started working on implementing Perl 6 Regular expressions. Which is nice.

Meanwhile in perl6-language

Nested modules

Luke Palmer noted that, as with Perl 5, there was no need for modules named Foo and Foo::Bar to be related. However, he wondered if it would be possible to do

   module Foo;
   module Bar {...}

and refer to the inner module as, say, ‘Foo.Bar’. He also wondered about scary things like anonymous modules.

Larry came up with answers, essentially you could get the semantics Luke was after but not necessarily with the same syntax.

How to get environment variables

Andrew Shitov wanted to know how to get at environment variables from the Perl 6 mini language that comes with Parrot. Judging by the error report that he pasted on his second post, it looks like that’s not supported in the current Perl 6 implementation.

Announcements, Apologies, Acknowledgements

As I said earlier, it’s been a busy week. It’s fabulous to see things like the PHP porting effort and Stéphane’s work on Perl 6 regular expressions getting underway.

I’m afraid that anyone who thought I’d manage two Monday summaries in a row has been sadly disappointed. Sorry.

Despite that, if you found this summary valuable, please consider the following ways of showing your appreciation:

  • Take part. There’s new, shiny projects to get involved with now, maybe you have exactly the knowledge and skills they need. and are good starting points. Hopefully once the PHP porting effort gets further down the road I’ll be able to point you at a website for that too.
  • Take out your wallet and donate some good hard cash to the Perl Foundation to help support Larry, Dan and Damian.
  • Take the time to drop me a line at letting me know what you think. I was enormously pleased last week to get some mail from someone at the Sanger Institute thanking me for the summaries. Personally, I reckon the Sanger Institute deserves far more thanks from all of us for keeping the genome free, but it’s always nice to be appreciated.



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