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

By Piers Cawley on July 7, 2005 12:00 AM

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.

Meanwhile, in perl6-internals

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.

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.

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.

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.

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.

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.

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.

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.

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

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.

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!")

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.

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.

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.

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

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

class Foo { has @.bar; 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.