The Perl 6 Summary for the fortnight ending 2004-06-06
Whee! There's a new graphics card in the G5, which means I can type this
at the big screen again, which makes me happy. Well, it would make me
far happier if the new card didn't leave horrible artifacts all over the
screen like some kind of incontinent puppy attempting to fulfil OpenGL
draw instructions. Maybe next week will see a third card in the box.
Dang! It looks like the G5 will be off receiving some TLC from an Apple
service centre while I'm on holiday next week. Which means that the
'weekly' summaries will continue on their fortnightly summer holiday
schedule for at least one more summary. But then the lists themselves
appear to be on summer footing anyway.
Ahem.
As you will probably have worked out by now, we start with
perl6-internals.
Library loading
Jens Rieks is working on library loading code that does all the nice
things we've come to expect from other languages. The plan being that
you'll be able to write (say)
use('some_library')
and Parrot will go off and search it's include paths for
some_library.(pbc|imc|pasm|whatever) and load it. As he noted, if you're
going to implement that kind of code in parrot assembler (or PIR, or
whatever), you need some way of loading the loading code. It's also a
good idea to have a working stat. Jens added a
Parrot_load_bytecode_direct function to the parrot core to support the
first part. His please for a functional (if not complete) stat were
answered by Dan who set about implementing the stat API he outlined a
few weeks ago.
http://xrl.us/b689
Embedding Parrot
Leo Ttsch and chromatic answered Paul Querna's questions from last
week about embedding Parrot.
http://xrl.us/b69a
Using PMCs as PerlHash keys
TOGoS wanted to know how he could use a PMC as a key in a PerlHash. Leo
replied that it was as simple as doing
$P2 = new Key
$P2 = key_string
$P0 = $P1[$P2]
Piers Cawley did some naive translation into PASM and got himself
horribly confused. Leo and TOGoS corrected him.
http://xrl.us/b69b
First draft of IO and event design
Remarking that events and IO are (kinda, sorta) the same thing, Dan
posted his first draft of a unified IO and events design and asked for
comments. This being p6i, he got several (though not as many as usual,
maybe everyone likes it).
Freeze, objects, crash, boom
Will Coleda tried to get freezing and objects to play well together and
failed. So he asked a bunch of questions. Leo didn't solve the problem,
but he did have some pointers to where it was coming from.
http://xrl.us/b69c
MMD table setup semantics
Possibly winning an award for the oldest rejuvenated thread, Nicholas
Clark had some questions about a post Dan made about MMD at the end of
April. He made a suggesting about how to calculate 'distance' for multi
dispatch. Dan pointed out that Larry had decreed that the 'distance'
would be the 'Manhattan Distance'. (Google has several definitions).
http://xrl.us/b69d
Compiler FAQ entry
Will Coleda posted a possible set of entries for the compiler writers'
FAQ. Leo had a few quibbles. Sterling Hughes suggested that having
small, runnable source code examples would be really helpful.
Layering PMCs
Dan kicked off a discussion on how to go about layering PMCs. The usual
suspects offered suggestions. The aim is to be able to layer behaviours
on top of PMCs without massive overhead or combinatorial explosion
problems. As usual with these things, there's several possible ways of
doing it, the debate is about choosing the best one.
http://xrl.us/b69e
IO Layers
Leo had some questions about the (not fully implemented)
ParrotIOLayerAPI. He laid out a proposal for implementing things. Uri
Guttman and Dan joined in a discussion of the issues. (Simple summary of
the issues: Asynchronous IO is hard. Possibly more accurate summary of
the issues: Asynchronous IO is *not* synchronous)
http://xrl.us/b69f
PIO_unix_pipe()
Leo's implemented a PIO_unix_pipe() method which allows you to run an
external program and capture the results with a Parrot IO handle. He
doctored the open opcode to use it
pipe = open /bin/ls -l, -|
Dan liked it, but proposed also adding a backtick operator.
http://xrl.us/b69g
Register spilling
Dan noted that it's possible to get the register allocator caught up in
an infinite loop (or as near infinite as makes no difference) as it
tries to work out a register spilling strategy. He proposed there be a
'slow but working' fallback method to use if the normal method goes
through too many iterations. Leo suggested an delightfully brute force
approach with some possible elaborations that Dan didn't think