This Week in Perl 6, June 29-July 5, 2005

My, doesn’t time fly? Another fortnight gone and another summary to write. It’s a hard life, I tell you!

This Week in perl6-compiler

Where’s Everyone Gone?

It seems that most of the Perl 6 compiler development discussions occur at Hackathons and on IRC, with summaries appearing in developers’ weblogs. What’s a summarizer to do? For now, I’ll point you at Planet Perl 6, which aggregates a bunch of relevant blogs.

PGE Now Supports Grammars, Built-In Rules

Allison Randal raved about the “totally awesome” PGE grammar support. I doubt she’s alone in her enthusiasm.

Multiple Implementations Are Good, M’kay?

Patrick discussed the idea of a “final” Perl 6 compiler, pointing out that it isn’t clear that there needs to be a “final” compiler. As long as multiple implementations are compatible.

Meanwhile, in perl6-internals

New Calling Conventions

Klaas-Jan Stol asked a bunch of questions about the new calling conventions and Leo answered them.

Parrot Segfaults

What’s a tester to do? You find a bug that makes Parrot dump core, so you write a test to document the bug and make sure it gets fixed. But the test leaves core files lying about. It goes without saying that Parrot should never dump core without the active assistance of an NCI call or some other unsafe call blowing up in its face.

This makes it a little embarrassing that PIR code generated by Pugs can cause a Parrot segfault, though the cause appears be mixed up calling convention style in the generated call.

Brian Wheeler’s segfaulting Pugs script

Python PMCs

Leo pointed out that the various dynclasses/py*.pmc Parrot support PMCs don’t yet support all the semantics that Python needs. He outlined some outstanding issues and announced that, as calling conventions and context handling were changing, he’d be turning off compiling py*.pmc for the time being.


It appears that the upcoming changes in Parrot’s context handling tweak a bug in PGE. The discussion moved onto a discussion of PGE’s implementation strategy; Nicholas Clark was keen to make sure it didn’t repeat some of the Perl 5’s regex engine’s infelicities. While this discussion continued, Leo spent half a day with gdb and tracked down the problem, which turned out to be that a register wasn’t getting initialized in the right place.

Left-Recursive Grammars Are Bad, M’kay?

While experimenting with PGE grammars, Will Coleda managed to write a left-recursive grammar that blew Parrot’s call stack with impressive ease. Luke apologized for things blowing up so spectacularly, but pointed out that PGE didn’t support left-recursive grammars and showed a rewritten grammar that didn’t have the same problem (but which doesn’t appear to match the same expressions).


Leo pointed to a summary of coroutines (PDF), and noted that we still hadn’t defined the syntax of Parrot coroutines, especially with respect to argument passing. He discussed it with Matt Fowles and solicited a set of tests that expressed the semantics they came up with.

ParTcl, Perl 6 Grammars

Will Coleda announced that, thanks to Matt Diephouse’s work, ParTcl (Tcl on Parrot) is now able to run part of Tcl’s cvs-latest test suite. The tests aren’t fully native yet, being currently driven through a Perl test harness and only passing ten percent of the tests, but hopefully the situation will improve and ParTcl will end up able to run the tests completely natively (while passing far more of them). Congratulations on the work so far, though.

Python and Parrot

Kevin Tew popped up to say that he too is working on a Python compiler targeting Parrot and wondered how to handle things like Python’s self parameter. Michal Wallace and Leo chipped in with suggestions.

Another Month, Another Release

Has it really been a month? Seems so. Parrot walked through the traditional feature freeze and code freeze before being released on Sunday. The latest release is Geeksunite, referencing the website that discusses Chip’s problems with his former employer. You should definitely visit the Geeksunite site–Chip needs our help.

lower in Default find_name Scope

Patrick posted a code fragment whose output surprised him–it turned out that looking up lower as a name in the default scope returns an NCI object. Leo explained why this was so, prompting Patrick to suggest that it would be useful if, somewhere in the Parrot documentation, there were some descriptions of Parrot’s built-in namespace. Leo encourage others to comment on namespace issues, and hoped for some decisions as well.


If you’re like me, discussion of copyrights and licenses is the sort of thing that either really winds you up or induces serious drowsiness, depending on your mood as you read the thread. It’s one of those “too important not to think about, but too tedious to think about any more than is absolutely necessary” topics. That said, Will Coleda said that he had thought that all of Parrot’s code should to have its copyright assigned to the Perl Foundation. However, on inspection, he noticed a multiplicity of copyright notices in the actual code, including one file in the repository with a Microsoft copyright.

PGE: Code Blocks

Matt Diephouse wondered about the plan for integrating code blocks into PGE. He thought it’d be nice to be able to specify a compiler to use along with the code block (or, for the time being, just to be able to use PIR code). Patrick said that there is a plan (or several) for handling this, but getting blocks to work well needs coordination between PGE and the compiler language. In essence, when PGE encounters a code block, it needs to hand off to the target language’s compiler to parse to the end of the code block, and get back from the compiler the length of the block thus parsed.

Possible Bug Calculating Denominators

Curtis Rawls posted a fragment of code that seems to break Inc’s computed_denominators algorithm. Leo wasn’t surprised that there were probably bugs in that part of IMCC, which was contributed by Angel Faus, who no longer seems to be participating in Parrot development. Which means it’s not been maintained for a while for lack of tuits. Anyone with an appropriate supply of tuits is welcome (nay, encouraged) to take it on.

Meanwhile, in perl6-language

Type Variables Vs. Type Literals

Autrijus had a question about the difference between

sub (::T $x, ::T $y) {...}


sub (T $x, T $y) {...}

Larry answered about four times, mulling over various options. It’s times like that remind me why it’s worth following the list in detail rather than reading the summaries–it’s good to see Larry thinking aloud, considering all sorts of (seemingly) wacky options and getting feedback.

Mr. Clean Vs. Perl 6

Yuval Kogman had some comments about fascism, strong (but I think he meant static) typing, cleaning products, Perl 6, and type inferencing. Stephane Payrard hoped that “Perl6 could become the playground of type theory searchers.” (To which I can only respond with a highly personal “Ick!”)

Documentation Trait/Docstring Equivalent

The Platypus (AKA David Formosa) wondered if documentation traits on subs would be useful. The first to hope that it would be was Chromatic, commenting that it’s a shame for Perl 6 to throw away potentially useful data recklessly. Larry commented that he always cringes when he hears “the documentation” as if it’s the only thing. Again, Larry’s thinking aloud on this subject is well worth your time.

SMD Is for Weenies

So says Yuval Kogman, and who are we to doubt him? Yuval wanted to make multimethods the default type. Sam Vilain disagreed, pointing up the usefulness of warnings like “method foo redefined at ….”

DBI v2: The Plan and How You Can Help

Tim Bunce outlined his current thinking on how DBI v2 will work (DBI v2’s going to be Perl-6-only) and a local roadmap for the first things that need doing. He then opened the floor for detailed proposals for what a Perl 6 DBI API should look like. (I wonder if DBI v2’s going to be an important enough tool that it’ll want an RFC type process.)

I’m glossing over the ensuing discussion–it’s at the stage where, if you’re interested, you’re better off joining in directly.

Should .assuming Always Be Non-Mutating?

Ingo Blechschmidt had some suggestions about the behavior of the currying method .assuming, arguing that it should always return a new thing and not alter the state of the underlying object. Larry agreed.

return() in Pointy Blocks

Coo. The pointy block thread returns. The question is, where to?


Gaal Yahas announced that he’d added localtime to Pugs in order to address Dave Rolsky’s needs when porting the very lovely and worthwhile DateTime family of modules. He noted that Perl 6’s final time-related interfaces were rather underspecified and had a bunch of questions. The one thing that’s absolutely certain is that the default Perl time API will use subsecond resolution by default.

I’ve noticed that, every time you start to discuss how computers handle “human” things such as time, dates, or writing systems, people often seem to have very strong and deeply held ideas of the Right Way of doing things, and those Right Ways are almost all different. Larry’s job is probably going to be to work out the Least Wrong Way. (If you’ve not heard Dave Rolsky’s talks about the underlying reasons for writing DateTime (MP3) and the headaches it gave him, then I suggest you seek it out.)

Autogenerated Attribute Accessor Names

MetaModel maker Stevan Little wondered what to do when attribute names clashed, as in:

class Foo { has; has $.bar; }

No answers yet.

Acknowledgements, Adverts, Apologies, and Alliteration

Summarizing a week is definitely way easier than summarizing a fortnight.

I’m apologizing in advance for the fact that, for those of you who read this via the mailing list, some of the links probably don’t work yet. The thing is, the thread links are generated directly from the message-ids because that’s the information I have access to and, so far as I know, Google Groups is the only archive that has a RESTful search interface that lets me use message-ids as my key. If you know of an archive site that does this, but is more timely in its archiving of perl6-language in particular, then please let me know and I’ll start using that instead. Ideally, it should allow me to directly address a message complete with its thread context.

If you haven’t already done so, you really should pay a visit to Geeksunite. For the life of me, I can’t see what I would have done differently in Chip’s situation, and I’m staggered by what’s happened to him.

Right, back to our standard coda:

If you find these summaries useful or enjoyable, please consider contributing to the Perl Foundation to help support the development of Perl.



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