This Week in Perl 6, November 9 - 15 2004


Welcome to yet another Monday summary. This would have been a Sunday summary, but Avernum (from Spiderweb Software) forcibly prevented it. As usual, we will start out with Perl 6 Language.

Perl 6 Language

Modules and Exports

Aaron Sherman wanted to know some specifics about exporting things from modules. In particular, he did not want to have to retype a whole bunch of things. Larry gave an answer indicating that some of what Aaron wants should occur, but some things are difficult for good reason.


Rod Adams wanted to know if he could get AUTOCLASS and AUTOCLASSDEF hooks. Larry told him that he probably could. Rod also wanted module name aliasing. Larry told him that he could. Rod wanted to have module names with arbitrary strings. Larry told him that he could. Rod wanted to be able to load multiple versions of the same module. Larry told him that he could. The summarizer wanted each question of a different focus to be in a different message. Hopefully, Larry will tell him that they should…

Matching the *n*th Occurrences

Sudarshan Gaikaiwari wanted to know how to match the “second last” occurrence in Perl 6 rules. I think he might have posted directly to Google Groups, as I did not receive it in my email and nobody replied. The example Sudarshan gave matches the seconded occurrence. As I am not sure what Sudarshan meant by “2nd last”, I will answer the question I do know. m:2nd/foo/ will match the second occurrence of foo. You can access the nth occurrence similarly.

Perl 6 Compilers

Once again it is a race to see whether someone posts a comment to, or Google picks up, Perl 6 Compilers first.


Welcome to the week of the continuation. If continuations make your head hurt overly, I advise taking a few Advils before continuing. If continuations are the way you naturally think, I advise you to stop playing with LISP compilers.

String Pinning

Bernhard Schmalhofer wanted to pass the same C string into two different external functions so that the first could do things to it that the second required. However, the solution that he found kept eating his string after the first invocation. Dan and Leo concluded that using the b parameter for NCI is correct in this situation.

GC Invocation

Last week Leo posted a radical idea about GC invocation. I decided not to invoke Warnock’s Dilemma too soon. This week, I invoke it.

perl vs. /usr/bin/perl

Gerd Pokorra requested that #! perl change to #! /usr/bin/perl. Although Warnock applied, I think this will likely not happen. Not all systems have Perl installed in /usr/bin/ and people might want to change which perl to invoke by changing their paths.

Command Line Support for Various Compilers

Will Coleda added a TODO item so that Parrot can take various compiler arguments on the command line. What are you waiting for?

Register Stomping

Matt Diephouse had troubles with his newly updated Forth compiler. The verdict seems to be that he has uncovered a bug. To quote Matt, “*sigh*.”

Calling Continuations, Basic Blocks, and Register Allocation

Either Leo or Jeff Clites (I don’t recall who) started what is probably the largest thread for this week, focusing on register allocation and continuation troubles. Apparently the presence of continuations can unduly extend the lifetime of registers (as can try-catch things, but they seem less important). The suggested solutions all have some shortcomings, although it appears that only using lexicals is winning.

Basic Compilation Example

Jeff Clites wondered how something like (a + b) would compile. The answer is to initialize an intermediate PMC to Undef, which will morph as appropriate.

Eval Changes

Leo updated the implementation of eval to make it even cooler, or possibly just clean it up and fix some bugs … I forget.

Basic Operations for MMD

Dan asked for volunteers to spec out the basic vtable and MMD functions for CLS (common language specification-or-other). Sam Ruby said he would be willing to take a stab at it in a few weeks. One week has gone by and Sam grows ever closer to stabbing things.

No Limit on IMCC Identifier Length

Will Coleda noted that there was no limit on the length of IMCC identifiers. Here come the eval buffer overflow attacks….

Duplicate Local Labels Break PASM

Will noticed that duplicate local labels cause IMCC to output broken PASM. I could be mistaken, but I though that IMCC -> PASM has been broken for a while…

Parrot API

Leo wondered if the could be less strict about what it thinks is and is not public. Jarkko Hietaniemi responded that this was not his call to make, and silence reigned supreme.

Empty Sub Troubles

Will Colleda posted a bug for empty subs in IMCC. St├ęphane Payrard provided a fix. Leo applied it.

Languages with Object Support?

Jeff Horwitz wondered if there were any languages with object support that he could bend to the evil ends of mod_parrot. While no one answered, I think Parakeet might be such a language….

WinXP Problems

Christian Lott has been having troubles with WinXP, in particular with Read on for the blow-by-blow.

Strings + Working Correctly = Pain

In his noble efforts to make Parrot respect foreign languages and cultures, while not necessitating ICU, Dan has massively reworked strings. He reports … progress. He also posed a question for all to ponder: “How global should the defaults be?”


Nicholas Clark wondered what would generate this file. Leo answered. Nicholas tracked his problem down to a quirk in FreeBSD make and fixed it.

#line Directives from PMC Files

Nicholas Clark announced his triumph over #line directives in People were impressed, but promptly asked how to turn it off. Kids these days don’t appreciate what they have. ;-)

Tail Calls

Jeff Clites asked about tail calls in the presence of continuations. After much debate, the consensus seems to be that they don’t affect each other much at all. In fact, continuations make tail calls easier. However, the topic was broached as to whether these were an optimization that IMCC should detect, or should compilers generate them explicitly. I think the final decision was compiler generated, although I doubt I would be alone in not minding if IMCC had a flag to allow it to add them as it saw fit….

Character Classes

Patrick R. Michaud wanted to know if Parrot had character class support (that is, checking membership). Leo responded that it would after Dan’s aforementioned string stuff.


Leo asked about the differences between POSTCOMP and LOAD. Dan provided the answer: POSTCOMP runs only when (and as soon as) the sub is compiled. LOAD runs when the sub is loaded. This need not be the same time if the source is used to generate bytecode that is later executed.

Register Allocation/Spilling/Volatility

Jeff Clites suggested using variable-size register frames with explicit, volatile and non-volatile sections. Leo responded that this would cause serious code bloat, and pointed him to his and Miroslav Silovic’s “watermark” scheme. Others voiced support for this as well as removing the implicit operands. Dan said no.

AIX JIT Gnomes

Adam Thomason observed that the AIX JIT problems have gone away and thanked the gnomes responsible. Remember, the proper sacrifice for little people like gnomes are mini-Milanos or other reduced-size cookies (nothing from Keebler as the gnomes and elves have long-unresolved issues).

Register Allocation (Again)

Bill Coffman’s register allocator (or should I say his implementation of the Matula/Chaitin/Briggs algorithm) grows ever closer to being committed (although my initial prediction of two weeks ago was clearly wrong). In fact, his algorithm is so good that it even turned up bugs from other pieces of the code. Dan started a test run on his evil code, so we should have truly stressed performance numbers within the next several fortnights.

IMCC Segfault on Bad if

Gopal V found a way to make IMCC segfault. I think it is still waiting for a fix….

No perldoc == BIG FAT WARNING

James deBoer submitted a patch to fail if the configuration step did not find perldoc last week. This week the request has gone out to modify it to warn in a big and preferably fat way. No answer yet.

RT Clean Up

Will Coleda, whose diligent minding of the RT queue is much appreciated, closed a few tickets that no longer apply.

BASIC Compiler

Will “Dr. Frankenstein” Coleda has attempted to resurrect the basic compiler with some major surgery. He is making progress. Joshua Gatcomb put out a request for a new maintainer.

Config Provides Slightly More Info

Luke Palmer provided a patch for making slightly more informative. Brent “Dax” Royal-Gordon applied it.

Find-Method Inheritance

Sam Ruby asked for comment before committing a patch to allow calling of attributes as methods and to allow inheritance of attributes. When no one commented, he committed.

Threads, Events, Win32

Gabe Schaffer pointed out some issues with threads and events from a Win32 perspective. Leo pointed out that this has not yet been fully implemented/abstracted/documented and observed that Gabe would be a welcome volunteer.

Core Dump on japh16

Bernhard Schmalhofer noticed that japh16 core dumps. He also submitted a simplistic fix.

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



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