Modern Perl 1
One of the people who make me think that Perl is still worth knowing is chromatic, the ex-editor of O’Reilly’s perl.com. He’s one of the core team who are working to bring the Perl 6 Christmas, a vector of test infection, an extreme programming practitioner and, right now at least, no longer on Giles Bowkett’s christmas card list.
When I wrote the Healthcheck: Perl for (oh ghod, they’ve rebranded) The H, I mentioned that O’Reilly hadn’t announced Perl: The Good Parts yet. This was an allusion to something chromatic had said when I interviewed him for the article – at the time he was pitching that very book, but it seems he got knocked back.
So, he’s writing a book and a blog on Modern Perl, and a jolly good blog it is too. It reads like a manifesto in places, but it’s a good manifesto, so that’s okay. You should read him. If you’re a publisher, you should definitely talk to him. If you’re a ruby programmer, don’t be in the least bit surprised if he’s rude about the ruby community…
Ruby 'til 6 1
Oh, I say. It seems that Sam Ruby is another member of the “Ruby ’til [Perl] 6” club.
I like Ruby a lot. For the kind dynamic OO/Functional coding style that I espouse, it’s a better Perl than Perl simply because it’s so much less verbose (I got so tired of always unpacking the argument list, it tended to put me off applying the Composed Method pattern anywhere near often enough).
But it’s not my One True Language. Perl 6 looks like it might be an awful lot closer to it. If nothing else, it has Lisp style macros.
A good macro system, especially when it’s combined with an accessible and well abstracted runtime is an awfully useful thing. For instance, consider the Rails controller. In a rails controller, public methods are ‘visible’ as actions that can be accessed via the web (usually with a url of the form /:controller/:action). Protected and private methods aren’t accessible in the same way.
But sometimes it’s quite handy to have a method on the controller that shouldn’t be deemed to be an action, but which you might want to call from a model. The canonical example here is when you’re doing Double Dispatch. Here’s an example of bad code:
results = @search_results.collect do |item|
case item
when Comment: extract_comment_metadata(item)
when Trackback: extract_trackback_metadata(item)
else
fail "Oops!"
end
endLook, we’re using a case statement that dispatches on the class of another object! This is a job for Polymorphism. Let’s assume that the two extract_*_metadata methods need to do some of the things that only a controller can and can’t simply be replaced with extract_metadata on the Comment and Trackback objects. Here’s how I’d rejig the controller code:
results = @search_results.collect {|item| item.extract_metadata_for(self) }And the support code in the model classes looks like1
def Comment::extract_metadata_for(controller)
controller.extract_comment_metadata(self)
end
def Trackback::extract_metadata_for(controller)
controller.extract_trackback_metadata(self)
endAnd look! I’ve saved a line of code! Except, it doesn’t quite work like that. The extract_*_metadata methods aren’t public, we’re not supposed to call them from the model, so we’ll have to work around it:
def Comment::extract_metadata_for(controller)
controller.send :extract_comment_metadata, self
end
def Trackback::extract_metadata_for(controller)
controller.send :extract_trackback_metadata, self
endwhich isn’t the end of the world, but it does obfuscate an idiom that’s already unfamiliar to many readers. Not good.
If you were writing Rails in Smalltalk, you would just file your controllers web visible actions in an ‘actions’ protocol and have done with it. If you were writing it in Perl, you could use method properties, declaring actions with something like:
sub read :action { ... }Sadly, ruby doesn’t have method properties. What I’d like to be able to write is something like:
action read
...
endAnd have that define my action and do the housekeeping so that the rest of the framework knows that it can dispatch to this from a web request. About the nearest you could get to this with current Ruby is:
action :read do
...
endIt’s not awful, but it’s not pretty either.
A good macro system would make it let you write things that feel even more like part of the language than the many excellent things that Ruby on Rails already does in this area.
Another example: I would dearly love to be able to ‘unwind protect’ my controller’s filter methods, it’d be great if I could write:
pre_filter whatever
allocate_a_bunch_of_resources
true
unwind_protect
tidy_up_allocated_resources
endThe idea being that, if a filter block returns false, or throws an exception, we walk back up the stack of filters that have been called and execute their unwind_protect blocks. Admittedly, this sort of thing wouldn’t be terribly easy to write with a macro system, but I’m not sure it’s even possible to write without one because you need to preserve the value from just before the unwind_protect to return to the filter’s caller. You’d have to move your unwind_protect earlier in the code:
pre_filter :whatever
def whatever
unwind_protect do
tidy_up_allocated_resources
end
allocate_a_bunch_of_resources
true
endBut that feels arse about face, and I don’t know how you’re going to catch any exception thrown by allocate_a_bunch_of_resources. I suppose you could do:
pre_filter :whatever
def whatever
unwind_protect do
tidy_up_allocated_resources
end
allocate_a_bunch_of_resources
true
rescue Exception => e
tidy_up_allocated_resources
raise e
endBut by now we’re looking at code that only a mother could love, and even then she’d need a pretty high tolerance threshold.
Macro systems let you play these sorts of games, they’re just another tool for molding the language into something that makes it easy to solve the sorts of problems you face from day to day. One of the great things about using Ruby on Rails is that DHH and his cohorts have done a fabulous job of language design. Rails contains a host of handy domain specific languages (the most obvious being the stuff for declaring object relationships in ActiveRecord, but there’s some very handy stuff in the tag building and RJS support libraries as well) that work well together and allow the programmer to concentrate on solving his particular problem. It’s just that on occasion, it would be nice if they could go that one step further.
Perl 6 will let me take those sorts of steps.
I’d just like to say to any schemers/lispers who’ve made it this far: “Yes, I know.”
1 It doesn’t quite, I’ve taken liberties with the def syntax to preserve some vertical space…
The Perl 6 Summary for the week ending 2005-01-09
This week marks Matt Fowles’s first Summary posted on Just A Summary (here’s hoping it won’t be the last). We have been writing the Perl 6 Summary on alternate weeks since early last year when Piers returned from attempting to be a Maths teacher and had the time to write summaries again.
So, here’s Matt’s take on the week, complete with props to a troll. Now we know why the summary was late.
Welcome to another Perl 6 Summary. On a complete tangent, if you are playing World of Warcraft and see a troll hunter named Krynna, she rocks. She royally saved me. Be nice to her.
Perl 6 Compiler
PIL Containers and Roles
Audrey explained that she and Stevan have been putting in effort to allow Pugs and PIL to bootstrap Roles and eventually the entire object model.
Reference and Assignment Semantics
Audrey posted a brain dump focusing on the issues and implications of how containers, assignment, and auto dereferencing interact.
Table of Perl 6 “Types”
Stevan Little posted a summary of his understanding of Perl 6’s core type hierarchy. Larry replied with a few comments and corrections.
Parrot
Configure and Symlinks
Alberto Simoes wondered how the configuration system should handle symlinks. Warnock applies.
Removed NCI Types
Dan Sugalski wondered why the T and L parameters have been removed from NCI and how he should work around their absence. Leo suggested you ManagedStruct PMCs for it and pointed him to the SDL libraries.
mkdir test can fail
Bob rogers posted a patch fixing an unanchored regular expression in the mkdir test. Warnock applies.
Build html should use Pod::Find
Joshua Isom suggested that Pod::Find would make building html less error prone and more robust to changes the Pod structure. Warnock applies.
CWD on HP-UX
Nick Glencross posted a fix to os.pmc for HP-UX. Alberto Simıes applied the patch.
Alignment Issues on HP-UX
Nick Glencross posted a back trace from a test failing on HP_UX. His initial analysis indicates that it is an alignment issue. Warnock applies.
Tcl Todo
Will Coleda posted more todos for Tcl. Like last week, I won’t summarize them all. But I am very happy to see Tcl coming along again. I must say that I always like watching the test percentages climb.
Parrot 0.4.1
Leo announced the release of Parrot 0.4.1.
Sun’s Compiler No Like CRLF
Andy Dougherty noticed that Sun’s compiler was choking on coroutine.pmc because it had bad line endings. He fixed it, and Jerry Gay applied the patch.
atan2 issues
Joshua Hoblitt committed a possible fix for some atan2 issues occuring on openbsd, solaris, and cygwin. The fix didn’t help cygwin or solaris. No word on openbsd.
OS.pmc needs a few methods
Will Coleda created a few todo: OS.pmc needs an lstat method, and methods to set atime and mtime.
Vanishing Warnings
Will Coleda noticed that a few warnings disappeared. Leo admitted that he accidentally applied a fix some time ago.
Configure.pl and Optimize
Andy Dougherty noticed that Configure.pl --optimize no longer worked correctly. Joshua Hoblitt took the opportunity to clean up that portion of Configure.pl.
Event System Question
Klaas-Jan Stol wondered why events (unlike exceptions) are handled after a little time instead of immediately. Leo explained that this was due to the asynchronous nature of an events arrival and the inability to resume execution after a long jump.
CFLAGS missed two files
Andy Dougherty noticed that the core_ops source files missed come of the directory rearrangements. Jerry Gay applied the patch.
File::Temp Issue
Leo noticed an issue in t/run/options. Jerry tracked it down to an old version of Perl and the File::Temp module and fixed the problem.
Simple Namespace Question
Joshua Isom wondered how to separate namespaces for find_global calls. Leo explain that he should use a list like ['Foo'; 'Bar'].
Credits
The ever modest Nick Glencross updated his name in the credits file to be a little more understated. Oddly, no one applied the patch.
parrot config revisited
Nick Glencross posted a few questions, thoughts, and patches involving parrot_get_config. Leo agreed with most of it, but had a few comments.
pkgsrc build
Anders Nor Berle provided a few patches making thing work a little more smoothly with FreeBSD and pkgsrc. Jerry Gay reviewed the patches and Florian Ragwitz applied the relevant portions. In fact, 0.4.1 got added to pkgsrc for the curious.
static and shared libparrot
Florian Ragwitz provided a patch that fixed the issue with building both a shared and static libparrot. Nick Glencross applied the patch. Nick Glencross made OS X and HP-UX build shared parrots. Anders Nor Berle helped FreeBSD along. Jonathan Worthington brought MSVC into line. Nick Glencross also finished up the painful task of making it all work on Cygwin.
GC Bug with String Ops
Roger Browne was tracking a GC Bug involving string operations. Unfortunately, no one else could reproduce it. Doubtless, we will see it again.
Winter Cleaning
Jerry Gay, not content with his fall clean up, has done a winter clean up too. This time he went through and cleaned all the svn metadata.
Paper on Parrot
Klaas-Jan Stol posted a link to his paper on Parrot. It is not yet finished and, like most things documenting parrot, already out-of-date, but it can probably serve as a good introduction.
http://members.home.nl/joeijoei/parrot/paper.pdf
string_to_int issues
Roger Browne found and tried to fix a problem with string_to_int. Unfortunately Leo beat him to the fix. Fortunately, Roger found and fixed another problem with it.
Parrot for Windows Macros
Christian Lott wondered how hard it would be to write inter application macros in Parrot. Unfortunately, his wonderings didn’t seem to make it to the list. Warnock applies.
Installation of Include Files
Anders Nor Berle provided a patch which fixed parrot’s installation of include files. Warnock applies.
Parrot on Cygwin
Alberto Simıes wondered if he was doing something wrong while trying to get parrot to build on cygwin. Nick Glencross answered that it didn’t work yet, but he was on the job.
Clearing Exceptions Only in the Current Context
Bob Rogers provided a patch which makes clear_eh only clear exception handlers in the current context. Warnock applies.
Update Patch Instructions
Roger Browne posted a patch updating submissions.pod. Joshua Hoblitt applied and improved upon Roger’s patch.
File Copy
Will Coleda opened a can of worms when he asked for a copy file method on os.pmc. Chip had some good insights.
doc/ops Permission Issue
Joshua Isom posted a patch fixing some permissions issues with installed parrot docs. Warnock applies.
Smoke that Cross Site Scripting
Joshua Hoblitt noticed that the smoke system was not very health conscious about its input. Florian Ragwitz said that he was about to do a rewrite to fix the issue.
Patches Go to parrotbug
Joshua Hoblitt noticed that not all patches were making it into RT. So he posted a friendly reminder that everyone should submit patches through parrotbug.
TODO: make distcheck
Joshua Hoblitt created a TOD for distcheck.
META.yml Needed
Joshua Hoblitt also suggested that we generate a META.yml so CPAN can index it.
Muddle Cleanup
Bernhard Schmalhofer resurrected an old ticket when he posted his thoughts on how far our documentation muddle had progressed. Original ticket from Sep 2004.
optimize pmc2c.pl
Joshua Hoblitt noticed that pmc2c.pl could be fairly easily optimized. Anyone up for some low hanging fruit?
Dynamic Binding
Bob Rogers posted an RFC about dynamic binding. Leo and Steve Gunnell both provided comments.
svk-bootstrap-dump
Joshua Hoblitt noticed that svk’s bootstrap dump was a little old. We should probably automatically generate updated one for the SVK loving world.
Dyn Op Build Process
Jonathan Worthington committed some changes rationalizing and improving the dynops build process. Nick Glencross affirmed that it worked on cygwin.
COWs Eat Memory
Leo found an interesting example. By reversing a string in place using substr he can make Parrot consume memory like never before. This was causing a panic, which he fixed. But the core issue remains.
Bug Wranglers
Joshua Hoblitt posted a start to a bug wrangler document. Jerry Gay encouraged him to check it in.
http://video.google.com/videoplay?docid=4057591681481453187&q=cats+herding
Funny EDS Commercial – Cat Herding – Google Video
http://groups.google.com/group/perl.perl6.internals/browse_frm/thread/39c645e9a0c8d631/8864eae5becaac9a#8864eae5becaac9a
Lua2PIR Translator
Klaas-Jan Stol posted an update to his Lua2PIR translator.
Perl 6 Language
Environmental Variables
Luke Palmer suggested that $/ and $! should be made into environmental variables. Thomas Sandlass like the idea.
Implementing Several Signatures
Jonathan Lang wondered if there where a concise way to implement several function signatures at once. Fayland Lam pointed out the is commutative trait, but Miroslav Silovic warned that that actually generated another function which transposed the arguments.
Zip vs Each
Jonathan Lang noticed that S4 and S3 did not agree on the usage of zip. Larry clarified that S4 was out of date.
Junctions Again
Once more the perennial argument has returned. Junctions will either cure cancer, kill babies, or both. Odds are they won’t change this time.
Friendly Facades
Gaal Yahas wondered how to make “friendly facades” like use_ok. Yuval Kogman suggested making it a macro, and Luke Palmer suggested a powerful scope object.
Class vs Object Contradiction
Stevan Little posted a possible contradiction he saw from S12. Warnock applies.
Representation Types
Stevan Little wondered how to handle representation types other that P6opaque. Warnock applies.
The usual footer
To post to any of these mailing lists please subscribe by sending email to <perl6-internals-subscribe@perl.org>, <perl6-language-subscribe@perl.org>, or <perl6-compiler-subscribe@perl.org>. 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 send feedback to ubermatt@gmail.com
The Perl 6 Summary for the week ending 2006-01-01
Another year, another summary. You might think I’m going to summarize
the events of the whole year, but it turns out that chromatic’s
already done it. So in the spirit of laziness, I’ll just point you at
his year end summary.
http://www.oreillynet.com/pub/wlg/8894
Sadly for us all, he doesn’t go into enough detail on the events of
the last week for me to go straight into the coda. I shall have to
talk to him about next year.
This week sees a big non-technical change in the Pugs camp, lots of
roadmapping and implementation in the Parrot camp, and a more and more
concrete feel of what the language is going to look like in the
perl6-language camp.
Pretty much business as usual really.
This week in perl6-compiler
Runtime typecasting
Autrijus Tang is now Audrey Tang. Read her explanation on her
blog. Speaking personally I’m delighted that she’s found the courage
to make the change and wish her the best of luck and happiness in her
new/true identity.
http://pugs.blogs.com/audrey/2005/12/runtime_typecas.html
Pugs on Cygwin
There was a fair amount of discussion on getting pugs and parrot
running in the Cygwin environment this week. Last time I looked,
things were working again.
http://groups.google.com/groups?threadm=1d9a3f400512261400l2cf167eauc2825a1ba73b0c1b@mail.gmail.com
This week’s Pugs developments
Audrey’s taken to summarizing pugs developments on her blog and to
posting digests of these posts on the list. She wrote about PIL and
Rules this week.
Meanwhile, in perl6-internals
Threading PDD?
Patrick Michaud suggested, after a question from Klaas-Jan Stol, that
it might be a good idea to create a placeholder Threading PDD (Parrot
Design Document) noting that threading hasn’t been specced yet and
that a draft would be welcomed. Warnock applies.
http://groups.google.com/groups?threadm=20051226180251.GB18241@host.pmichaud.com
Pugs is the official Perl 6?
Or am I putting words into Luke’s mouth? Read, then decide.
http://groups.google.com/groups?threadm=7ca3f0160512272328w495ad815hecc409bd716fcbb7@mail.gmail.com
.imc or .pir? There can only be one
As part of the great Parrot reorganization, Chip declared that the IMC
vs PIR ambiguity had to be resolved. As he put it:
IMC vs. PIR
Two names enter
One name leaves
The name that left was PIR; any files you find with .imc extensions
should be cruelly laughed at while you kick sand in their faces.
http://groups.google.com/groups?threadm=1d9a3f400512281152u70a9726amb42b479c15be8bd0@mail.gmail.com
Dynamic binding patch
Bob Rogers offered up a patch to implement dynamic binding of globals
for the list’s consideration. Leo thought the patch was mostly sound,
but that the whole dynamic binding thing needed more thought and
infrastructure. Which is probably a broad hint to Chip and possibly
@Larry (said hint hasn’t been taken yet though, well, not in public).
http://groups.google.com/groups?threadm=17333.25927.15166.416455@rgrjr.dyndns.org
Smoke testing
Leo pointed everyone at the Perl Image Testing Architecture, which has
possibly the coolest acronym of any Perl project in recent years. He
thought it would be useful to use for additional Parrot platform
testing as well.
http://groups.google.com/groups?threadm=c52768167fd0624b66f97734cdf30d2b@toetsch.at
Lots and lots of TODOs
I’m not going to enumerate them here, but Will Coleda, Matt Diephouse
and others have been adding loads of TODO entries to the Parrot
bugtracker. Which is nice.
IMCC optimizer instruction duplication and opcode write/reads
Amos Robinson wanted to know how to go about duplicating instructions
and wondered about the correct semantics of in/out/inout
arguments. Leo came through with the answers.
http://groups.google.com/groups?threadm=cf7d0f370512310643s31ff2cf4n2d952aeb57c31f70@mail.gmail.com
Meanwhile in perl6-language
Iterating over complex structures
Rob Kinyon applied the ‘What does Ruby do?’ pattern to the problem of
iterating over complex structures. Mostly it looks good, but I’m
hoping that someone else considers applying the ‘What does Smalltalk
do?’ pattern as well. Subject to tuit supply, I might even do that
myself.
http://groups.google.com/groups?threadm=70384420512251808q3c3bc01cue2cd8af86062d9bb@mail.gmail.com
Match objects
“Who is Match, and to what does he object?”
Sorry. Couldn’t resist.
Patrick and Luke discussed the behaviour of match objects.
(Array) introspection
Ilmari Vacklin wondered about how to introspect on the structure of
arrays and other data structures. Warnock applies.
http://groups.google.com/groups?threadm=1135632846.7282.4.camel@localhost.localdomain
Array/list transformations
Rob Kinyon pointed out the difficulties of dealing with binding array
slices and other such goodies. Larry thought it wasn’t really that
difficult (from the point of view of the perl programmer, things might
be different for the implementers)
http://groups.google.com/groups?threadm=70384420512262110u4ce4861o628e3a0b585e8bae@mail.gmail.com
Relationship between slurpy parameters
Austin Frank wondered about the different uses of prefix:<*> in
parameter lists and elsewhere. Stuart Cook had answers. Piers Cawley
worried about the current behaviour of prefix:<*> in parameter
lists and about how eager its flattening should be.
http://groups.google.com/groups?threadm=43B332B9.2050400@gmail.com
Building the documentation that will ship with Perl 6 and Pugs
Andrew Savige outlined some off the issues that need addressing as we
move towards releasing a properly documented Pugs, and the Perl
6. After outlining issues, he called for volunteers. Nobody commented
on the list (yet), but I hope people will be taking up the challenge.
http://groups.google.com/groups?threadm=20051231014706.94262.qmail@web36103.mail.mud.yahoo.com
$/ and $! should be env
Luke proposed that we change $! and $/ into env
variables. Because almost nobody understands what an env variable is
(your summarizer had never even heard of ’em — I think I may have to
do some serious synopsis rereading and soon) Luke explained what they
were and why they should be used in this case. The usual Sunday
Warnocking applies — expect more detail next week.
http://groups.google.com/groups?threadm=7ca3f0160601011034m21da9f24h86f5888d77c0b4ad@mail.gmail.com
Rules should be independent of evaluation strategy
Luke talked about an idea for implementing different parsing engines
that use Perl rules but without necessarily doing recursive descent
style parsing. Nicholas Clark pointed out a typo, but the basic thrust
of the article remains in Sunday Warnock land.
http://groups.google.com/groups?threadm=7ca3f0160601011115l25d08592o930f4cb0d065b58d@mail.gmail.com
Acknowledgements, apologies and everything else
Happy new year everyone. I’ve just opened up a 4th annual subdirectory
in my summaries directory. I had hoped we’d have the real Perl 6 by
now, but these things take the time they need I guess. Things are
looking good for the future though. Here’s hoping that Audrey and the
other pugs people keep up their phenomenal rate of development.
I hope that, from next week you’ll be able to find Matt’s summaries in
the same place as mine,
http://www.bofh.org.uk/articles/category/perl-6-summaries.
Help Chip
The usual coda
If you find these summaries useful or enjoyable, please consider
contributing to the Perl Foundation to help support the development of
Perl.
The Perl Foundation Blog is an excellent source of news about the Perl
Foundation’s activities.
http://blog.perlfoundation.org/
Planet Perl Six is a handy news aggregator of several Perl 6 related
sources.
The Perl 6 Summary for the week ending 2005-12-18
Welcome to another Perl 6 summary. This has been a week of shootouts,
cleanups, relationships and cunning translations. Read on for the
details (or, this being a summary, pointers to the details).
This week in perl6-compiler
2 messages? Sometimes I wonder why I even bother summarizing this
list; I could just paste its contents in their entirety. However:
Call for a Pumpking: Do you want a Ponie?
Jesse announced that Nicholas Clark was retiring as Ponie’s Pumpking
following his departure from Fotango. So we’re looking for another
volunteer to take Ponie from its current state to a working Perl 5
runtime fully integrated with Parrot. If you’re a C programmer with a
good grasp of the Perl 5 internals and you’re interested in taking on
the job, ponie-pumpking@perl.org is eager to hear from you.
http://groups.google.com/groups?threadm=20051214225235.GR25436@bestpractical.com
Pugs, Javascript and Perl 5
Continuing Pugs’ tradition of linguistic mashup, Chia-liang Kao
announced that Pugs Javascript backend can now support Perl5.
http://groups.google.com/groups?threadm=20051214022446.GC9267@home.clkao.org
Meanwhile, in perl6-internals
Parrot Shootout
Work continued on implementing and optimizing Parrot’s entry for the
Language Shootout.
http://groups.google.com/groups?threadm=05D985D7-A48E-44A2-9CFF-B219A18DF864@pacbell.net
http://groups.google.com/groups?threadm=31247ad5226f5927031cabb213a483b2@ritalin.shout.net
http://groups.google.com/groups?threadm=8109939b614a9dd99df5b9b7387c16bb@ritalin.shout.net
http://groups.google.com/groups?threadm=942c27460512151539h691425e4x1cfd06e3a3278e9@mail.gmail.com
http://groups.google.com/groups?threadm=942c27460512151659h42872a66xa740809c47dd857a@mail.gmail.com
http://groups.google.com/groups?threadm=3bbbb64e9c99a66ec0d6f1b8bc693277@ritalin.shout.net
Variables, Aliasing and Undefined-ness
Matt Diephouse wondered how he should translate the following in to
PIR code:
Audrey “Autrijus” Tang suggested that allowing multiple LexInfo names
to point to the same underlying register would make this sort of thing
(and several Perl6isms) a good deal easier to implement. Leo pointed
out that it actually had been implemented, though I’m not sure if
Luthor includes this. (Pugs always targets the latest Parrot
release).
http://groups.google.com/groups?threadm=198c87380512150046o3efb9626x7c30588105b5b8e5@mail.gmail.com
Cleaning up the build process
Joshua Hoblitt went to town on RT posting a breakdown of proposed
refactorings of the Parrot build process
ParTCL shootout
Will Coleda suggested that it would be useful to set things up to run
the TCL shootout benchmarks on ParTCL. He’s not exactly sure that
they’d work just yet (or be fast, come to that), but they’d
certainly be a handy test/benchmark suite. After a couple of patches,
it seems that ParTCL can at least run the “hello” benchmark. Still,
a journey of a 1000 miles starts with but a single step and all that.
http://groups.google.com/groups?threadm=3FB91E50-040E-4CD7-83DF-FC8D4AEFBCE2@coleda.com
Parrot directory reorganization (phase 2 mark 3)
Jerry Gay’s reorganization of the Parrot distribution’s directory
structure continued apace. Reorganizing the JIT subdirectory and its
associated config system proved to be something of a sticking place,
but Joshua Hoblitt sorted things out.
http://groups.google.com/groups?threadm=1d9a3f400512121814m6e6a64d4gfccddfc95a9a5cfd@mail.gmail.com
Bug or feature?
Chip had some thoughts about PIR’s macro support and concluded that we
need a robust multi-line quoting convention in order to pass multiple
lines of code to macros. He outlined some suggested syntax. Discussion
ensued, mostly favourable.
http://groups.google.com/groups?threadm=20051212185501.GK6257@tytlal.topaz.cx
Building Parrot includes
Leo noted that the files in runtime/parrot/include/*.pasm are
created by configure. He argued that they should really be generated
by a Makefile rule, which would have the advantage of taking note of
dependencies. There followed a certain amount of quibbling with Joshua
Hoblitt, but I don’t think anyone disagrees with the gist of the proposal.
http://groups.google.com/groups?threadm=rt-3.0.11-37898-125569.9.16891768502722@perl.org
Library loading – no more duplicates
Leo announce that, as a of r10458, Parrot doesn’t load_bytecode
from the same file twice any more. Chip and Nicholas Clark applauded
the change and plotted ways to make it even more effective.
http://groups.google.com/groups?threadm=439D6A23.80305@toetsch.at
Fixing japhs
Not content with implementing shootout benchmarks, Joshua Isom has
also fixed a few of Parrot’s example japhs.
http://groups.google.com/groups?threadm=dcf0c8153462a13760cc9f0c6ccd0070@ritalin.shout.net
Q: String.get_integer
Leo had some questions about magical conversion between strings and
integers. Patrick and others reckoned that his proposed behaviour was
about right. Personally, I’m not convinced that the basic String PMC
should do any magic conversion, but PerlString definitely should.
http://groups.google.com/groups?threadm=43A2D3BD.6010203@toetsch.at
Parrot Borking
Steve Gunnell had a problems with Parrot throwing segfaults. Leo gave
him some pointers to tracking the issue down and recommended using the
SVN repository and not the CVS mirror.
http://groups.google.com/groups?threadm=1134899914.8669.11.camel@eldred.local
Meanwhile, in perl6-language
Relational data models and Perl 6
Darren Duncan’s been doing some thinking about Relational data models
and how to support working with them in Perl 6 and posted the results
of his thought on this to the list. Lots of discussion ensued. There
was a fair amount of quibbling over details, but the general tenor of
the discussion was in favour of supporting relational data models
(possibly as a separate module).
http://groups.google.com/groups?threadm=p06230900bfc66428a67e@[192.168.1.100]]
Handling undef better
Darren also had some ideas about making undef behave more like a
relational NULL. These were received a little less favourably — they
aren’t exactly compatible with autovivification, which is one of those
things that many people like about Perl.
So, a little later, Darren retracted his original proposal and posted
a new one which takes into account the various different ways in which
undef gets used in Perl programs.
http://groups.google.com/groups?threadm=p06230900bfc90d05004d@[192.168.1.100]]
http://groups.google.com/groups?threadm=p06230900bfca4b9752ed@[192.168.1.100]]
Transliteration preferring longest match
Brad Bowman wondered why the trans function described in Synopsis
05 specifies that the longest matching input sequence should be the
one that wins. He thought that a simple ‘first in order’ rule would be
more useful and flexible. The answer was that, because transliteration
matches literal strings, if you didn’t have ‘longest’ wins rules then,
depending on the order, you might as well simply remove the longer
literal because it’d never be used.
http://dev.perl.org/perl6/doc/design/syn/S05.html#Transliteration
http://groups.google.com/groups?threadm=43A1ACDB.2060603@bereft.net
Import/export and module configuration
Gaal Yahas had some questions about Perl 6’s import/export model and
the various hooks that get called in the process. Larry had many
answers and speculations. He also noted that he can now ‘translate
about 95% of random Perl 5 back to identical Perl 5’. Which probably
doesn’t sound like much at first glance, but it means he’s getting a
great deal closer to being able to translate random Perl 5 code into
equivalent Perl 6 code.
As Larry puts it, he is “now confident that we can hit the original
p5-to-p6 spec of translating 95% of scripts at least 95% accurately”.
http://groups.google.com/groups?threadm=20051213104247.GA4095@sike.forum2.org
Acknowledgements, apologies and everything else
Wow! It’s still Monday! The move went pretty smoothly and our lives
are slowly emerging from the boxes they had been packed in. We’re
still boggling at how many boxes of china there were though. At one
point I began to think we’d packed the country in there. I’m typing
this from my new office on the second (third if you’re American) floor
of our new (well, 178 years old, but new to us) house and wondering
how much of the stuff that’s spread out over two table tops is really
necessary.
Help Chip
http://geeksunite.org/ — Chip still needs help.
The usual coda
If you find these summaries useful or enjoyable, please consider
contributing to the Perl Foundation to help support the development of
Perl.
http://donate.perlfoundation.org/ — The Perl Foundation
The Perl Foundation Blog is an excellent source of news about the Perl
Foundation’s activities.
http://blog.perlfoundation.org/
Planet Perl Six is a handy news aggregator of several Perl 6 related
sources.
http://dev.perl.org/perl6/ — Perl 6 Development site
The Perl 6 Summary for the week ending 2005-12-04
I heard a rumour on the London.pm mailing list week. Apparently the Perl 6 Summaries are no longer being ublished. As I’m sure you can imagine, it came as something of a surprise to me.
This week has been all about Parrot, Leo’s got the new lexical scheme, calling conventions and exception handlers working and made Parrot stricter about arguments. The end of the week saw the release of ‘Luthor’, version 0.4.0 of Parrot.
Read on for more details…
This week in perl6-compiler
Um… one post in perl6-compiler this week. And that was crossposted to
perl6-language. And because it got posted at the end of the week, none of the
actual discussion occurred this week.
Moving swiftly on…
This week in perl6-internals
Much more going on here as everyone rushed towards the release of Parrot
0.4.0 “Luthor” at the end of the week.
Exception handlers and calling conventions
As I predicted last week, Leo’s brain dump about exception handling got
discussed this week. It was well liked, and after a small bit of sugar was
sprinkled on to make ParTCL’s life a little easier (and possibly unsprinkled
later) all manner of things were well.
http://groups.google.com/groups?threadm=5b4f21642641211939b10fe8548ea876@toetsch.at
Subs may not contain dynamic call info, ever
Chip posted a clarification of his comments on what data could and couldn’t be
hung off a Sub object at runtime. Let’s be reentrant people.
http://groups.google.com/groups?threadm=20051128035833.GD6446@tytlal.topaz.cx
PDD20 Tcl
Will Coleda announced that ParTCL is now working with the new lexically lovely
Parrot calling conventions. There was much rejoicing.
http://groups.google.com/groups?threadm=A235A03B-6CF1-4C5A-83FB-AB49805ED491@coleda.com
Test::More and Tests in PIR
Leo showed the love for chromatic’s shiny pure parrot implementation of
Test::More. So the patch was applied.
http://groups.google.com/groups?threadm=cbd309ab4fac265f6ceab71ccb2cd91d@toetsch.at
Upcoming changes
Leo announced the scratchpad’s impending doom and outlined the planned change
for comment. Nobody commented, and the changes went in.
http://groups.google.com/groups?threadm=5c3a3e2a9838b2e7ed45b7a0d03d52f7@toetsch.at
Parrot directory reorganization
Quick quiz: where would you expect to find tests in the parrot distribution?
How about generated source files?
Jerry Gay proposed a reorganization to make things a little more lovely.
The consensus seemed to be that a reorg along Jerry’s lines wouldn’t be a bad
idea, but Chip pointed out that, whatever gets done it should be done
‘cautiously so as to minimize unpleasantness’. So Jerry is proceeding
cautiously, starting with a host of new TODO tickets in RT.
http://groups.google.com/groups?threadm=1d9a3f400511281645s5e75a64fl529dfad83f8457af@mail.gmail.com
Solving = confusion: := for aliasing
There are those of us who are wondering why this one took so long…
Chip proposed that people start to spell aliasing as := and assignment as
=. I think it’s a really good idea, but then I don’t have a large amount of
PIR code to maintain so what do I know. Some other folks weren’t so sure, but
Chip is not to be denied. Discussion then span off into what language to write
the automagical translator in.
I believe this may involve writing it in PIR then converting it to PIL, which
would be converted to Perl 5 using pugs and then Larry’s Perl 5 to Perl 5
project could be used to convert it to XML, which could then be modified using
XSLT and converted back into PIR using some scary voodoo magic.
Or they could just write it in Perl 5. Prosaic, but possible right now.
http://groups.google.com/groups?threadm=20051129200801.GT6446@tytlal.topaz.cx
PDD03 Revisions
Chip announced that he’d put up another revision of PDD03 on Parrot calling
conventions. Most of the changes are simple clarifications and flag renaming,
but he’s also proposing a new READONLY flag for C
easy to support the default Perl 6 argument mode. Response was muted, but
favourable.
http://groups.google.com/groups?threadm=20051130030122.GL6446@tytlal.topaz.cx
PDD03 and Overflow/Underflow
It’s been mandated for ages that Parrot should throw an exception when
functions get called with the wrong number of arguments. It’s always been one
of those things that will be implemented ‘some day’. Well this week had a
someday in it as Leo made parrot do what it’s supposed to do. And broke PGE for
a while…
http://groups.google.com/groups?threadm=438D8A90.8070105@toetsch.at
PDD20 questions
Jonathan Sillito is a class act. He didn’t just ask a bunch of questions about
the new PDD20 on lexical variables, he promised to take the answers he received
and use them to patch PDD20 to make things clearer. Spurred on by this promise,
Chip was unstinting in his answers and clarifications of them. Which is nice.
http://groups.google.com/groups?threadm=8be166ff0511301202s4382b6efwc579d7d711419bc9@mail.gmail.com
PIR methods and local variables occupy the same ‘namespace’
Allison Randal used Snarks, Boojums and Thingies to demonstrate a possible
problem with the way Parrots local variable and method namespaces overlap. Leo
pointed out that this can sometimes be useful. So, for the time being, Parrot
continues as is in this area. If you go getting the bowsprit and the rudder
mixed up, it’s your own silly fault.
http://groups.google.com/groups?threadm=AB54429A-690E-47FA-805C-33FEEBAF9EB9@perl.org
Suddenly… Namespaces!
After “many months and lots of work,” Matt Diephouse returned from the mountain
top bearing a couple of stone tablets. One was labelled ‘Namespace Spec’ and the
other ‘[Draft]’. Muttering dark incantations about giving a discussion eyes, he
laid out their contents and asked for comments. And low, there were comments in
abundance. I would attempt to summarize both the spec and the ensuing
discussion but, alas, the margin here is narrow and my time is short. Suffice
it to say that if namespaces are your bag, you should read this thread.
http://groups.google.com/groups?threadm=198c87380512012231w42dee5a9y96c9c06508b55fbe@mail.gmail.com
HLL and autoboxing
Okay, who else has an image of two of those transformer robot things from the
Renault Megane advert punching each others’ lights out?
Ahem.
I’m afraid I didn’t quite understand François Perrad’s question about maps and
autoboxing. Luckily Roger Browne and Leo did.
http://groups.google.com/groups?threadm=5.1.0.14.2.20051202100324.02cfe6d8@pop.besancon.parkeon.com
Punie’s demo likes its memory
Jerry Gay worried that Punie is using way too much memory, running out of the
stuff on his 512Mb machine. He wondered if it was a bug or to be expected. Luke
thought it might be an issue with the algorithm used in the attribute grammar
implementation which is somewhat less than abstemious with memory. Nick
Glencross noted that, after he’d done a nuke of the distribution and rechecked
it out, the problem seemed to go away. So, it’s either fixed, or there was
something odd going on somewhere.
http://groups.google.com/groups?threadm=1d9a3f400512021414t6b789daev5c4bc5df089938da@mail.gmail.com
Parrot 0.4.0 “Luthor”
Leo announced the usual freezes and parrot proceeded smoothly down the road to
release. After the release he discussed goals for the next release and asked
for comments.
http://groups.google.com/groups?threadm=ed864ea1d4db3a436c7de6d6bf4046f8@toetsch.at
http://groups.google.com/groups?threadm=df23aee8ec07c676e2748102f6668d72@toetsch.at
Meanwhile, in perl6-language
A quiet week here too.
Capabilities in Perl 6
Rob Kinyon has read slides on CAPerl and had some thoughts about how to build
the idea into Perl 6. Larry and Yuval Kogman commented on it.
http://groups.google.com/groups?threadm=70384420512010754w1dbdc62cq5404a295da5b6e7e@mail.gmail.com
Acknowledgements, apologies and everything else
It’s not exactly Monday today is it? Well, I could lie and claim that I was waiting for the Perl Foundation blog to be announced before I posted the summary, but that would be Wrong. Instead I shall claim (with some justification) that there’s an awful lot of things that need sorting out when you’re moving house, and they take far longer than you expect.
My ankle and shin are progressing nicely, thanks for asking, and there has been a good deal less random swearing in the Cawley household this week.
http://blog.perlfoundation.org/ — The Perl Foundation blog
Help Chip
http://geeksunite.org/ — Chip still needs help.
The usual coda
If you find these summaries useful or enjoyable, please consider contributing to the Perl Foundation to help support the development of Perl.
http://donate.perlfoundation.org/ — The Perl Foundation
http://dev.perl.org/perl6/ — Perl 6 Development site
Vaguely pretty photos by me can be found at:
Perl 6 Summary: Week ending 2005-11-27
Another week passes. Another summary is written. Another sentence is written in the passive voice.
This week in perl6-compiler
Perl 5 tests for PGE::P5Regexp
Jerry Gay announced that he’d checked in a subset of perl 5.9.2’s regexp tests
to give PGE something to work on. Right now only 130 of 960 tests are running,
in part because the test harness he’s using can’t quite cope with the test file
syntax used for the original tests. I’m sure it won’t stay that way or long.
A couple of days later he announced that more tests were being converted and
that there were now 360 passing tests and a further 155 or so TODO tests.
Well done Jerry.
http://groups.google.com/groups?threadm=1d9a3f400511211939i134aa0fnefc86179431b96fd@mail.gmail.com
PDD 20 and :outer
Leo had some questions about the workings of lexical pads and :outer. He
showed a couple of examples in high level language and wondered if his parrot
conversions were right. Chip thought that Leo shouldn’t worry about
implementing the Perl 5 semantics of a named inner subroutine because the way
Perl 5 does it is a bug not a feature. Dave Mitchell wasn’t so sure.
http://groups.google.com/groups?threadm=43832AF2.2040402@toetsch.at
DynLexPad
Leo’s working on implementing a DynLexPad PMC to provide ‘a more dynamic
lexpad’ akin to the new deprecated ScratchPad PMC. He outlined his current
plans and asked for comments from HLL authors about what they needed.
http://groups.google.com/groups?threadm=43834203.2020209@toetsch.at
Punie to AST
Allison has checked in the code to transform PunieGrammar match objects into
Abstract Syntax Trees (ASTs). Apparently the set of AST node types she’s using
isn’t quite the same as the Pugs PIL. Hopefully one day we’ll have a common
AST format, and all manner of things shall be well.
http://groups.google.com/groups?threadm=FE692303-15F8-42D8-AF73-270BCEDA6EAD@perl.org
Meanwhile, in perl6-internals
RESPONSIBLE_PARTIES or ENTITIES_AT_FAULT?
Joshua Hoblitt suggested that Jerry Gay should be added to the
F
small amount of byplay suggesting the file be renamed, the nomination was
strongly seconded and Jerry’s name added to the list.
http://groups.google.com/groups?threadm=20051120210940.GB22898@ifa.hawaii.edu
Curses and parrot problems?
Josh Isam has been having problems with using the curses library under both
Darwin and freebsd. He wondered if anyone had any pointers for fixing
things. Leo thought it might be that the parrot ncurses support was getting a
function signature wrong somewhere and suggested Josh check that.
http://groups.google.com/groups?threadm=Pine.LNX.4.53.0511222245480.1385@ritalin.shout.net
Subs may not contain dynamic call info, ever
Repeat after Chip: “Subs don’t have callers. Call frames have callers.”
After a short discussion with Leo, Chip wrote a short treatise on the
relationships between Subs and Closures, noting that they should only hold
static information.
http://groups.google.com/groups?threadm=20051123180834.GF6095@tytlal.topaz.cx
Undefined labels
While working on TODO #37590 (catch illegal bsr at compile time), Leo’s made
parrot rather more picky about labels and how they are used. Essentially, if
you weren’t doing daft things with labels you’re probably all right. If you
were, you should probably check this post.
After Leo checked the fixes in (r10168), several PGE tests started
breaking. Less than 6 hours later, Patrick check version r10176 in and the
tests started passing again. Leo (and I) was impressed.
http://groups.google.com/groups?threadm=87bc76ce931e9c7e29ed9be192d32de4@toetsch.at
http://groups.google.com/groups?threadm=3a149d0a332aa57205267f928fe1544a@toetsch.at
Exception handlers and calling conventions
Leo posted a brain dump about how to get exception handling to work in
Parrot. In particular he wanted help with syntax (exception handling semantics
aren’t exactly rocket science when you’ve got a continuation based virtual
machine after all). Warnock applied (However, I am reliably informed that next
week’s summary will have some responses; anyone who suggests that that’s
because this summary is late will be annoyingly Right).
http://groups.google.com/groups?threadm=5b4f21642641211939b10fe8548ea876@toetsch.at
Test::More and tests in PIR
Not content with having a pure PIR implementation of Test::Builder, chromatic
posted his implementation of Test::More in pure parrot. Admittedly the current
version should likely be called Test::Less::Is::More, but the journey of 1000
cliches starts with a single step and all that. And that’s not all, the
fearlessly lowercased one intends to start work on the big daddy, Parrot::Test
with an eye to doing even more in Parrot. (Which makes a good deal of sense.
After all, the plan is to get Parrot to a point where it can be built without
needing a working perl installation)
http://groups.google.com/groups?threadm=1133039776.6474.48.camel@localhost
Meanwhile, in perl6-language
\x{123a 123b 123c}
Juerd had praised Ruud H.G. van Tol’s proposal of \x{123a 123b 123c} as a
replacement for \x{123a} \x{123b} \x{123c} in rules. Larry wasn’t so
sure. He suggested \x[123a,123b,123c] but still wasn’t exactly happy with
it. He also had some thoughts about character class syntax, and the meaning of
spaces within a character class spec. This being the language list, the
discussion spun off in various directions (all related to rules, just not
necessarily that much to do with the nominal subject). It was good stuff
though; threads with Larry, Damian, Patrick and Luke in them usually are.
One little tidbit that came out of this was a reminder that the best place to
read synopses and apocalypses is at svn.perl.org or dev.perl.org because they
are kept up to date, unlike the ones at perl.com.
http://groups.google.com/groups?threadm=20051120023217.GA507@wall.org
Multidimensional argument list binding
Ingo Blechschmidt’s question from the end of last week about multidimensional
argument list binding got addressed this week. He, Luke and Larry discussed
different aspects of slurpiness. Personally, I expect I’ll be using the
*;foo@ for almost all my slurpy needs.
http://groups.google.com/groups?threadm=dlql9i$bnf$1@sea.gmane.org
statement_control<foo>()
Ingo Blechschmidt had asserted that for is not strictly a Perl 6 keyword,
but is (conceptually at least) at statement control subroutine. Rob Kinyon
wondered what other ‘keywords’ were actually statement control subs. According
to Ingo, pretty much everything that’s used for control flow modification is a
statement control subroutine, but that they’ll almost certainly be optimised
away to ‘primitives’ of some sort (after all, it’s rather hard to come up with
a definition of if, say that isn’t at least slightly circular).
http://groups.google.com/groups?threadm=70384420511202024y223ac219h3ecea2cbd0feef8@mail.gmail.com
till
Perl 6’s stock of agricultural operators continues to grow apace. Not content
with gather, we now have C
.. (sorry beachware fans).
Larry had some thoughts on the detailed semantics in response to a question
from Ingo. Most of Ingo’s problems disappeared when he realised that till
would be a macro.
http://groups.google.com/groups?threadm=20051121062128.GA9451@wall.org
Ponie!
Joshua Gatcomb wondered what was happening to Ponie and if Fotango would
continue to fund it. Warnock applies.
http://groups.google.com/groups?threadm=941eab840511211220t1ee6952dpb578ed10259f29@mail.gmail.com
Dis-junctive patterns
Gaal Yahas found what looked like a bug in pugs. Larry agreed that it looks
pretty entomological. It’s probably already fixed in bleadpugs.
http://groups.google.com/groups?threadm=20051122073126.GE14252@sike.forum2.org
Type sigils and a new unary ^ operator
Larry announced that, after all the discussion of coming up with a type sigil
and searching for various possibilities, he’s ended up back at ::, which was
what it was before the discussion started. Apparently the tipping point came
when he realised that he wanted ^$x back as a unary operator that’s short
for 0..($x-1) which would make it easy to write things like:
without falling foul of fencepost errors etc. Some people didn’t like
it. Vocally. Larry stood firm. Yay Larry. (Impartial summarizer? What’s that
then?)
http://groups.google.com/groups?threadm=20051122223412.GA28366@wall.org
Lazy lists in Str context
Flavio S. Glock reckoned it would be nice if:
say substr( ~(1..Inf), 0, 10 )printed “1 2 3 4 5”. There was discussion, but I think we stayed firmly in “Not
going to happen.” Unless I completely misread the thread of course.
http://groups.google.com/groups?threadm=aa47605d0511230413p20173745k@mail.gmail.com
Binding of list slice elements
Ingo Blechschmidt is great at posting a few lines of not particularly
mind bending code and then following consequences through until either your mind
is broken, or you assume that Ingo’s must be (more usually the former than the
latter, to Ingo’s everlasting credit).
This time he followed through on the implications of binding array
slices. Nothing from @larry yet, but he posted at the end of the week.
http://groups.google.com/groups?threadm=dm4has$u3s$1@sea.gmane.org
Acknowledgements, apologies and everything else
This summary was made from the finest mailing list posts, each individually
plucked and filleted for your delight and elucidation. The alert among you will
have noted that today is Wednesday and not Monday, which means we’re a little
late. What can I say? It’s ready when it’s ready.
This summary was also brought to you through the labours of Piers Cawley and
not Matt Fowles as we had planned when, dewy eyed and innocent, I set off on
the long journey down to the wilds of London with the express intention of
attending the London Perl Workshop, the International Magic Convention, Sharp’s
folk club and divers fine gentlemen’s outfitters, jewellers, bookshops and
quality eating establishments.
All was proceeding flawlessly, until, on Saturday morning as the tube train
doors began to close in front of me, I attempted to stop running and discovered
that the soles of my shoes had other ideas and fell on my arse, twisted my
ankle and scraped an unfeasibly large amount of skin from my shin off on the
bottom of the aforementioned tube train. Luckily the driver noticed my plight
and did not drive off, taking my left foot with him. Instead he opened the
doors and waited for me to dust myself off and board his vehicle, which carried
me to Paddington where, after much hobbling and swearing I was bandaged and
deposited once more on London’s cold and unfeeling streets.
So, I hopped into a taxi (and I use the word hopped advisedly) and repaired
straightway to King’s Cross and thence home to Gateshead, where my discomfort
was somewhat ameliorated by the distraction of preparing this week’s summary. I
hope to be writing next week’s summary as well because the week after I’ll be
moving house and don’t quite know when I’ll have my bandwidth back.
Help Chip
http://geeksunite.org/ — Chip still needs help.
The usual coda
If you find these summaries useful or enjoyable, please consider
contributing to the Perl Foundation to help support the development of
Perl.
http://donate.perl-foundation.org/ — The Perl Foundation
http://dev.perl.org/perl6/ — Perl 6 Development site
Check out my website, it’s lovely.
Vaguely pretty photos by me can be found at:
Perl 6 Summary for the fortnight ending 2005-11-13
Welcome to another fortnight’s worth of summary. We’ll get back to a weekly
schedule one of these fine days, you see if we don’t.
This fortnight in perl6-compiler
There was a surprisingly large amount of activity on the list, but again, the
place to look for perl6 compiler news is the Planet Perl Six aggregator.
PGE improvements and changes
Patrick announced that he’d checked in some major changes to the PGE
internals. The changes include a shiny new shift-reduce operator precedence
parser which is used to parse the rules themselves. PGE finally has a
<p6rule> parsing rule which can be used to parse a valid Perl 6
rule. There are other changes, but those two are the headlines. Patrick asked
for the usual questions, comments, patches and tests.
A couple of days later, he posted a more comprehensive overview of the new and
shiny bits in PGE.
http://groups.google.com/groups?threadm=20051101062541.GA30198@host.pmichaud.com
http://groups.google.com/groups?threadm=20051104144923.GA12353@host.pmichaud.com
PGE problem with non-greedy quantifiers
Allison fell foul of some changes in the new PGE. This turned out to be a bug
in PGE, so Patrick fixed it.
http://groups.google.com/groups?threadm=ED559257-B0D9-4216-98E4-88C0AC3B4F0F@perl.org
The meaning of \n and \N
Noting that Synopsis 5 says that ‘\n now matches a logical (platform
independent) newline, not just \012’, Patrick asked the list for more
details about what that should mean so he could get on and implement it in
PGE. He offered up a suggested matching rule. Larry thought that the suggested
rule was close enough for jazz.
http://groups.google.com/groups?threadm=20051104155307.GA15393@host.pmichaud.com
[] and () on rule modifiers
Patrick continues to work on the PGE. This time he asked about the behaviour of
rule modifiers, with particular reference to the :w modifier. Larry had
answers.
http://groups.google.com/groups?threadm=20051104192614.GA30432@host.pmichaud.com
Parrot 0.3.1 “Wart” released
Leo announced the release of Parrot 0.3.1 “Wart”, complete with shiny new
features like variable sized register frames and no more spilling, a much
better PGE (see above) and other goodies. The latest release has more than 3000
tests, and that’s probably still not enough.
http://groups.google.com/groups?threadm=436E0DBB.8040300@toetsch.at
Octal in p6rules (and strings)
Patrick Continued his voyage of stringy discovery, this time asking about the
black art of specifying glyphs/bytes/whatever using octal notation. He wondered
about his assumption that the correct way to do it is with \o123 by analogy
with using 0o123 to specify a number in octal. He also wanted confirmation
that the \nnn notation had been dropped. A surprisingly long discussion
ensued as Larry did a good deal of thinking aloud and Patrick got on with
implementing the nailed down bits.
http://groups.google.com/groups?threadm=20051107165159.GA13344@host.pmichaud.com
Meanwhile, in perl6-internals
SWIGging Parrot
John Lenz is one of the developers a SWIG, which started off as the Python
equivalent to Perl’s XS. He had some questions about writing a SWIG module for
parrot and asked if there would be interest in having SWIG be one of the
‘official’ ways of doing native calls from Parrot. Leo thought not, pointing
out that Parrot’s NCI is fully dynamic and groovy.
http://groups.google.com/groups?threadm=35051.192.168.0.12.1130741345.squirrel@192.168.0.2
NCI using ffcall library
Garrett Goebel joined in the ongoing discussion of using ffcall to implement
the Parrot NCI (Native Call Interface) by pointing back to an earlier
discussion of using libffi to implement the Parrot NCI. Last time round, Dan
had pointed out that, because libffi is an external library, there still needs
to be a supported (if possibly hackish) way of doing NCI that comes with
Parrot, but that configure could probe for external libraries to use where they
are available.
http://groups.google.com/groups?threadm=E4901162278E99499731C168EC803B59991554@mail.scriptpro.com
Heredocs in function calls
Patrick wondered if there might be a convenient way to support heredoc
parameters in PIR function calls. Nicholas Clark wondered why one would bother
since most PIR code should be generated code.
Later on, Leo implemented them. About the only place they don’t work now is in
macro arguments.
http://groups.google.com/groups?threadm=20051101074509.GA1506@host.pmichaud.com
http://groups.google.com/groups?threadm=4369CBC7.1070407@toetsch.at
Simple register allocation
Summarizing a discussion on IRC, Patrick noted that it would be nice if the PIR
compiler had a way to use a very basic register allocation for .subs that only
use a small number of registers. After all, there’s little point in doing a
complex analysis of control flow if a sub uses (say) 5 registers at most. The
problem is that this analysis gets harder as the subs get longer (O(n) on the
length of the sub). In the case of PGE (for instance), the subs can get very
long, with lots of control flow statements, but use a maximum of 10 PMC, 9 int
and 4 string registers for the whole thing.
Warnock applies.
http://groups.google.com/groups?threadm=rt-3.0.11-37578-123722.7.0478443353673@perl.org
Careful with that bsr Eugene
Leo noted that, with the introduction of variable sized register frames, it is
no longer legal to bsr into a different .sub.
http://groups.google.com/groups?threadm=ce791f585f2d5b3ae727692fa6476666@toetsch.at
Reconfiguring configure
Joshua Hoblitt sketched out a route map for getting from our current ‘built to
throw away’ configuration system to the sunny uplands of the miniparrot based
config system. Everyone who commented sounded positive. Now, if someone could
just implement it…
http://groups.google.com/groups?threadm=20051103073105.GB16634@ifa.hawaii.edu
Shifting right by more than the width of int
Joshua Isam had problems doing a right shift of more than the width of an
integer. Which is no surprise really as the behaviour is officially undefined
in the C spec, which is the implementation that Parrot uses. There was some
discussion, but the consensus is that it’s best to stick with the C semantics
for integer registers and if the need arises for more complex semantics, it’s
always possible to write a new PMC.
http://groups.google.com/groups?threadm=740b6a05281f1e3f3b54cd7791838a51@ritalin.shout.net
Suspend and resume opcode
Tomo sent in a patch implementing suspend and resume opcodes. After a
certain amount of kerfuffle involving the mailing list software stripping troff
attachments and dodgy software deciding that a .t file full of tests was
actually a troff source, Leo rejected the patch and pointed Tomo in the
direction of coroutines.
The mailing list will now accept troff attachments. Hurrah.
http://groups.google.com/groups?threadm=436B403C.2000307@nekomimists.ddo.jp
Creeping up on ffcall NCI
Nick Glencross posted another update of his work on getting NCI to use the
ffcall library. He’s now added config smarts to detect the ffcall and other
handy features.
http://groups.google.com/groups?threadm=dcb629180511040927kd7042f2vdb722f49a4df2a9a@mail.gmail.com
Removing unmaintained languages from parrot tree
Jerry Gay noticed that there were an awful lot of unmaintained languages in the
Parrot tree. He recommended getting in touch with their last known authors and
eventually removing the dead languages.
http://groups.google.com/groups?threadm=rt-3.0.11-37611-123890.17.8232124086628@perl.org
Testing non-core PIR libraries with Parrot::Test
Allison outlined some of the problems she’d been having testing her tree
transformation engines outside of the parrot tree. It turns out that Parrot or
the Test tool require absolute paths to various libraries, which is no fun at
all. She suggested fixing Parrot::Test up so as to try and divine (and set) a
sensible load path for Parrot. Meanwhile, chromatic continues to beaver away at
implementing Test::More in PIR.
http://groups.google.com/groups?threadm=D3C8F121-06ED-40BF-B5E4-DB94D0414B12@perl.org
Updating parrotcode.org
Will Coleda announced that he’d been doing some tidying up of the
parrotcode.org website and asked for suggestions for an updated ‘where we are’
section. Various answers and suggestions were provided.
find_type considered dubious
Roger Browne was puzzled by the behaviour of the find_type opcode, which
works for both PMC types and native Parrot types. He thought that this was both
confusing and counter productive. Leo didn’t seem to agree with him.
http://groups.google.com/groups?threadm=1131544548.7662.9.camel@eiffel.demon.co.uk
Unicode strings and encodings
Leo announced that he’s going through the various string functions to make them
usable with all the string encodings we know about. He outlined what he
proposed to do solicited comments in case of insanity.
http://groups.google.com/groups?threadm=437353FF.5020106@toetsch.at
Legal names for PMCS
Roger Browne (whose name I keep wanting to use as a Clerihew) wondered what the
rules were for naming PMCs. Leo reckoned that, unless someone rejigs
pmc2c.pl to mangle non word characters appropriately, a PMC name should
follow the same rules as C identifiers.
http://groups.google.com/groups?threadm=1131707019.23357.6.camel@eiffel.demon.co.uk
string_bitwise_*
Noting that, with ICU installed, parrot has ‘rather complete support for
Unicode string manipulation’, Leo wondered about making the bitwise string
manipulations work. In particularly, he wondered how they should behave in the
face of charset and/or encoding mismatches. According to Leo, it seems to boil
down to a choice between throwing an exception or simply mashing everything
together and marking the ‘resulting bit mess’ as binary. Warnock applies.
http://groups.google.com/groups?threadm=4375E49D.5060405@toetsch.at
Parrot fink
Will Coleda passed on a query from the #parrot irc channel. Someone had
wondered if there was a Fink build of Parrot available. (Fink is an OS X open
source package manager along the lines of, well, pretty much every other
package manager). There isn’t, so Will wondered if there was anyone on the list
who could help put one together. Leo noted that Parrot is already Debianized
(yay!) which might help with the fink approach too. Joshua Isam worked on the
task.
http://groups.google.com/groups?threadm=AD8403CA-D106-414E-8D85-DE525AEA37BD@coleda.com
Changing default STDOUT/STDERR Filehandles for PIR code
One of the things that chromatic needs in order to write a pure PIR version of
Parrot::Test is a way to redirect STDOUT and STDERR within a section of PIR
code. He’s looked at the implementation of the ParrotIO PMC and the print
opcode, but can’t see where to begin. So, he asked for help. At close of play
on Sunday there had been no answer, but I’m sure someone will be along soon.
http://groups.google.com/groups?threadm=1131833503.24170.5.camel@localhost
PDD20: An idea: Call frames as PMCs
Chip led the applause for Leo’s implementation of the new lexical scheme in all
of a week. He then went on to outline an idea for turning call frames into
PMCs. Leo wasn’t sure, pointing out that the call frame would have the same
issues as promoting a continuation. I have to confess that I’d tended to
assume that the PMC that Chip’s proposing already exists, and it’s called a
continuation.
http://groups.google.com/groups?threadm=20051113034521.GC6553@tytlal.topaz.cx
:outer("foo") is working
Leo announced that :outer("foo") now works, with a couple of caveats.
http://groups.google.com/groups?threadm=437734FF.40203@toetsch.at
Meanwhile, in perl6-language
Ways to add behaviour
The problem with summarizing an ongoing thread that you’ve not really been
following is getting the context again. I have to confess that, when I returned
to the ‘Ways to add behaviour’ thread this week I was somewhat stumped. Thomas
Sandlass and Larry appeared to be having fun with terminology and type
algebra. I’m sure that we’ll end up with a more robust language as a result of
all this, but it doesn’t mean I could follow the discussion as it was
happening.
http://groups.google.com/groups?threadm=20051026173441.GB29341@wall.org
$_ defaulting for mutating ops
Remember last time? Juerd had proposed that mutating ops like ++ default to
mutating $_ in the absence of a left hand argument. It seems that the
discussion convinced Juerd that it wasn’t a good idea after all. But, this
being perl6-language, it also seemed to convince others that it is a good idea.
http://groups.google.com/groups?threadm=Pine.LNX.4.33.0510280955200.28049-100000@sharkey.morinda.com
Role method conflicts and disambiguation
Discussion of how to handle conflicting role methods and their disambiguation
continued. Unless I’m going soft in the head, I could have sworn that the
original Smalltalk ‘Traits’ paper (they’re called Roles in Perl 6 because we
already have Traits) dealt with disambiguation in a fairly straightforward
fashion. I continue to be reminded of the same joke as last week.
http://groups.google.com/groups?threadm=20051101091913.GB4058@woobling.org
Co/contra variance of roles/factories in theory.pod
Err… I haven’t the faintest idea what Luke and Thomas Sandlass are talking
about here. Luckily, it seems that Larry did understand it.
http://groups.google.com/groups?threadm=436A5291.7010205@orthogon.com
Perl 6 perlplexities
Michele Dondi worries that the increase in complexity of some aspects of Perl 6
is much bigger than the increase in functionality that the complexity buys
us. In particular Michele is concerned that the Perl 6 parameter passing and
signature stuff is going to be a big loss. People mostly disagreed with
him. Rob Kinyon made a remark that chimed strongly with me, pointing out that
Ruby’s OO system is substantially more complex than Perl 5’s, but that it’s
also a great deal easier to use. (Rob’s not alone in this, I am writing most of
my new OO code in Ruby. I fully expect to switch back to Perl 6 as soon as it
becomes good enough though).
Lots of good discussion here. I was convinced once again that Perl 6’s
signatures are going to be the best thing since sliced bread. Even if I do
still like Smalltalk method selectors best of all.
http://groups.google.com/groups?threadm=Pine.LNX.4.62.0510211140010.21523@spock.pcteor1.mi.infn.it
Implicitly doing a role
If a tree falls in a forest with no one to hear it, does it make a sound? If a
class implements the same interface as a role without saying that it does, does
it still do the role? One of these philosophical questions was asked by Austin
Frank. The other is a timeless wossname. Can you guess which is which?
Rob Kinyon thought that the answer to the second question was ‘no’. So did
chromatic, citing the usual Dog/Tree problem with ‘bark’. After further
thought, chromatic proposed that a class should create an implicit empty role
of the same name to make things easy for people writing mock objects and other
entertainingly different variants of the original class.
Decorated Dog anyone?
http://groups.google.com/groups?threadm=436BA54F.9040501@gmail.com
The new class sigil
Remember when the new class sigil was going to be ¢? Well, we’re still getting
one, but it’s called ^ now. I think.
http://groups.google.com/groups?threadm=436BB303.4080502@orthogon.com
Private methods and role composition
Jonathan Lang wondered if there was a way of declaring a method as private to a
role, and a role could reclassify a composed method as private. Larry answered
‘yes’ to the first question and ‘no’ to the second.
http://groups.google.com/groups?threadm=ef30550b0511051135q5fe874c7t5c2027b2e5a9c7f3@mail.gmail.com
=>’s container and binding semantics
Ingo Blechschmidt had some questions about modifying pair keys and values and
about the semantics of binding to a pair value. Larry had answers. And
interesting implicit questions.
http://groups.google.com/groups?threadm=dkl2t3$19o$1@sea.gmane.org
Default values for instance variables
Gaal Yahas thinks it’d be nice to supply default values to instance variables
at declaration time. Luke pointed out that it is actually legal to do just that
in Perl 6, but that pugs doesn’t yet implement it.
http://groups.google.com/groups?threadm=20051108160826.GD15437@debian
Proposal: rename ‘subtype’ declarator to ‘set’
Undeterred by the fact that the OED has eight distinct headword entries for
‘set’, covering four different parts of speech and a prefix form, Thomas
Sandlass proposed changing the subtype declarator to set. Larry agreed
that it might be a way forward, but worried about interference between the
declarative form and the verb ‘to set’. Stuart Cook thought that ‘subset’ might
be slightly less confusing, but Eric the Surnameless thought that that would be
more confusing.
http://groups.google.com/groups?threadm=4371EF61.10107@orthogon.com
Test case: Complex numbers
Jonathan Lang posted a skeleton implementation of complex numbers and their
associated arithmetic to the list as a possible test case of various Perl 6
goodies. Luke and Larry both offered comments and suggestions.
http://groups.google.com/groups?threadm=ef30550b0511091821r27f61704m852f3b1d5d31dcf1@mail.gmail.com
Given too little
Gaal Yahas seems to have found a possible bug in pugs when using when with an
expression that returns a boolean. It turns out that this might be a bug in the
spec. Getting the semantics of ~~ nailed down so that when always does the
Right Thing is Hard. Larry’s working on it. One fix seems to be to shove the
conditional code into a block. The block is then evaluated (possibly with the
$_ as an argument) and ~~ returns true if the block returns true.
http://groups.google.com/groups?threadm=20051110083149.GJ15437@debian
What’s the latest on Iterators
Joe Gottman is worried that the various synopses make plenty of references to
Iterators, but that Iterators aren’t actually defined anywhere. He asked for
clarification. Larry supplied some, and, after some prompting from Stéphane
Payrard declared that Perl 6’s would do lazy evaluation by default, would
guarantee some kind left to right evaluation, and that, if all else failed the
** steamroller would make things eager again.
http://groups.google.com/groups?threadm=000901c5e6c5$cbce7c20$841d4447@JoeGottman1
Acknowledgements, apologies and everything else
Matt Fowles was on holiday last week, and didn’t have time to write a
summary. Hopefully he was having a fabulous time instead. We hope to be back on
a weekly schedule from next week.
Thanks to the people who contacted me last week. I am still looking for work,
but I also have some leads to follow up on, which is a start. The summaries are
still looking for a sponsor though; if you’re interested drop me or Matt a
line, we’d be delighted to hear from you.
Help Chip
The usual coda
If you find these summaries useful or enjoyable, please consider
contributing to the Perl Foundation to help support the development of
Perl.
http://donate.perl-foundation.org/ — The Perl Foundation
http://dev.perl.org/perl6/ — Perl 6 Development site
Check out my website, it’s lovely.
Vaguely pretty photos by me can be found at:
Back from 'Dam
Well, I’m back from EuroOSCON, which was a pile of fun. I spent most of my time on the ‘hallway track’, occasionally dropping in on interesting talks and keynotes, but mostly just hanging around with interesting people. I took a pile of photos and still have a couple of rolls of film left to develop now I’m back home.
If you’re in Amsterdam and need a professional lab, allow me to recommend Kleurgamma. It’s always a little nerveracking taking negatives to a new lab, but they were exemplary. And they had some fantastic images hanging in their lobby…
Expect more articles about/inspired by the conference soonish.
Packing for EuroOSCON
My new combined laptop and camera bag arrived yesterday, a Crumpler December Quarter. It’s a little snug for my 17" Powerbook, but it’ll serve. The question now is, what cameras do I pack?
It turns out that Amsterdam is possessed of a pro lab that can do a 4 hour turnaround on black and white dev+contacts (and presumably not much longer for dev+scan).
So, do I take advantage of this, ditch the D100 and come armed solely with my F100, a couple of really nice lenses and a pile of Neopan 1600?
I think I do. I don’t want to start having to use the flash when I’m shooting indoors and, even with the kind of fast lenses I have to hand, I don’t trust the D100 over about 200 ISO so it’ll pretty much require flash assistance. Meanwhile, I know and trust Neopan 1600, it’s been my default film pretty much since I started taking photos and, whilst it may be grainy, it’s good grain. It worked for EuroFoo after all.
Looks like it’s decided. I’ll be the guy with the big camera who isn’t using flash.
