The Perl 6 Summary for the week ending 20030105 Hello and welcome to the first summary of 2003, welcome to the future. This summary covers 2 weeks, but they've been quietish what with Christmas and the New Year.
So, starting as usual with perl6-internals A pile of patches to the Perl 6 compiler Joseph F. Ryan submitted a bunch of patches to the Perl 6 mini compiler, (found in the languages/perl6 subdirectory of your friendly neighbourhood parrot distribution) mostly implementing the the semantics for string and numeric literals discussed on perl6-documentation. Garbage Collection headaches Heads have been put together in an attempt to get Parrot's Garbage Collection system working efficiently and accurately (no destroying stuff before anyone's had a chance to use it, dammit!) It appears that there's still a good deal of head scratching to be done in this area (the chaps over on the LL1 list are wondering why we aren't just using the Boehm GC system...) I freely admit that GC makes my head hurt (especially as, in my current Perl 5 project I'm busy implementing mark and sweep collection for a persistent object store whilst also making sure that my random assortment of circular data structures has weakened references in just the right places so that stuff gets destroyed but only when it *should* be destroyed... Boy, am I looking forward to Perl 6 and not having to worry about this stuff ever again...) but I I'll have a go at summarizing the issues. The main problem appears to be that of 'Infant mortality', an issue that I will now attempt to explain. All the objects in memory can be represented as nodes in a graph, and the pointers between those objects can be represented as edges in that graph. The process of garbage collection involves taking a subset of those nodes (the rootset) and freeing (or marking as freeable) all those nodes in the graph which are not reachable from the rootset. Now, consider a function that sets up a new PMC, specifically a PMC that contains another PMC. The first step is grab the memory for our new PMC. Next we create the contained PMC, a process which allocates more memory... and there's the rub. Garbage Collection can get triggered at any point where we go to allocate more memory; unless the *containing* PMC is reachable from the rootset then it will get freed at the point. And that leads to badness. So the Infant Mortality problem can also be thought of as the problem of rootset maintenance. Which is, in theory, simple; just treat all C variables as members of the rootset. However, in practice it isn't that simple, mostly because hardware registers complicate the issue. Steve Fink offered an overview of the issues and some of the possible approaches to dealing with them, which sparked a fair amount of discussion amongst those who understood the issues. http://makeashorterlink.com/?K2FE52303 http://makeashorterlink.com/?Y20F32303 -- Steve's overview Variable/value vtable split Leo Tötsch posted a summary of where we stand on doing the variable/value vtable split, suggesting that he wanted to start feeding in patches soon. Mitchell N Charity supplied a handy dandy 'context' post with links to appropriate articles, and he and Leo did a certain amount of thrashing out of issues. http://makeashorterlink.com/?B11F21303 http://makeashorterlink.com/?G12F32303 Parrot gets another new language Ook! Jerome Quelin offered an implementation of the latest silly language, Ook! which can be thought of as brainf.ck for Librarians. Due to insanity, the Ook! compiler is implemented in Parrot assembly, and emits parrot assembly too, which led Jerome to ask for an 'eval' opcode. Which Leo promised to supply. And which Dan specced out in PDD6. All of which led Leo to comment that, for all these languages are toys, they do seem to be driving the implementation of important bits of Parrot. Nicholas Clark reminded everyone that a zcode interpreter would be another good thing to have a crack at because it would require a couple of other really useful bits of Parrot functionality. Ook! is now in the core. http://makeashorterlink.com/?R53F23303 Returning new PMCs David Robins wondered what was the resolution about creating and returning a new PMC in PMC ops that take a "PMC* dest" parameter. He and Dan discussed it back and forth and it became apparent that Dan really needs to get Parrot Objects defined... http://makeashorterlink.com/?Q24F21303 Fun with PerlHash Jerome Quelin noticed that you couldn't delete an item from a PerlHash. Leo fixed it. Jerome later asked how one could retrieve the keys of a PerlHash in Parrot assembly and wondered if there was a way to traverse a hash. Sadly the answer is 'not yet', but happily Aldo Calpini has something very nearly ready for prime time. http://makeashorterlink.com/?X15F25303 GC/DOD feedback & runtime tuning Dan has been playing some test programs and has found some major issues with resource allocation and added his stress test programs to the distribution so others could see if they could see how to fix things. Leo Tötsch (who else) made some inroads, reporting his progress to the list as he and Dan discussed ways forward. http://makeashorterlink.com/?H16F21303 Object Semantics Dan posted a sketch of how Parrot was going to deal with language level objects. And there was much rejoicing. Various people pointed out that Dan's assumption that 'real' languages only had reference type objects was incorrect; ruby has value types, so does smalltalk and C# and they're just the ones off the top of people's heads. http://makeashorterlink.com/?C57F22303 Meanwhile in perl6-language Not much was happening. The language folks seem to have taken their holidays seriously; the last fortnight saw all of 76 posts. Tree frobbing facilities in Perl 6 Rich Morin wondered what kind of facilities Perl 6 would have for monkeying about in trees, offering a discussion of the sort of thing he wanted to do and the problems he saw with doing that in Perl 5. Michael Schwern reckoned that "Doctor, it hurts when I do this." applied ("Well, don't do that then") and suggested other ways to handle Rich's problem. Simon Cozens, who should know better made a *terrible* joke about frobbing trees. Dave Whipp pointed out that continuations should make it easy to treat tree traversal just like traversing any other list. http://makeashorterlink.com/?P28F31303 PRE/POST in loops Arthur Bergman is this week's hero. He's busily writing Hook::Scope which will (eventually) implement Perl 6's "PRE/POST/FINALLY/CATCH" etc. In Perl 5. Yay Arthur. Anyway, Arthur wanted to know what happens with POST and PRE in loop scopes. Do they get called for every iteration, or merely at the beginning and end of the loop? Luke Palmer reckons that POST gets executed for every iteration (NEXT doesn't get executed on the last time through a loop. http://makeashorterlink.com/?C49F12303 "my int ( 1..31 ) $var" ? Murat Ünalan didn't like Damian's proposed "my $date is Integer(1..31);" (restricts $date to an integer between 1 and 31) and proposed using "my int(1..31) $date" instead. He didn't like my int ($pre, $in, $post) is constant = (0..2); either, proposing either of: my constant int ($pre, $in, $post) = (0..2); my int is constant ($pre, $in, $post) = (0..2); Murat argued that 'type and property' belong together. Damian disagreed, and pointed out that, if you *want* the specifiers close together you could write: my ($pre, $in, $post) returns int is constant = (0..2); I'm caricaturing (but only slightly) the rest of the discussion if I say that the rest of the thread ran along the lines of a pantomime argument ("Oh yes it is!" ... "Oh no it isn't!"), suffice to say I don't think either Damian or Murat convinced the other. Personally I'm on Damian's side -- sorry Murat. http://makeashorterlink.com/?G5AF24303 http://makeashorterlink.com/?N2BF21303 Variable Types vs Value Types Dave Whipp wondered if the type of a variable could vary independently of its value. I'm not sure I understand what Dave was driving at, which makes summarizing his post a little tricky (but I *think* there's confusion about the meaning of 'type'; A variable has what I will call a 'sigil type' and may also have a more specific 'declared type'. Thus, a declaration of the form "my Array $foo;" declares a scalar (sigil type) variable which points to (contains) an Array (declared type) object while one of the form "my Array @foo;" declares an array (sigil type) variable which contains a number of Array (declared type) objects. The meaning of "my Array %foo". This led into a discussion of the 'Everything is an object' principle, but more on that next week. http://makeashorterlink.com/?Z3CF51303 In Brief Leo Tötsch kept up his staggering patch generation rate. Does he ever sleep? Mitchell Charity supplied a script which generates a browseable list of Parrot file names with brief descriptions, which should prove useful to new developers who want to get a feel for the layout of Parrot. Dan agreed, and it's in the Parrot distribution now as tools/dev/extract_file_descriptions.pl. Jason Gloudon got Garbage collection working on IA-64 Linux, yay Jason. Bruce Gray sent in a bunch of cleanup and win32 patches. On a suggestion from Mitchell N Charity, Robert Spier has started work on getting a browseable, cross-referenced version of the Parrot source up on perl.org and asked to be pinged in a week or two if it hasn't happened. Jerome also improved the debugger. Leon 'bear of very little brain' Brocard added a couple of wishlist items: Objects, and a 'make install' that does something sensible. Who's Who in Perl 6? Who are you? A twenty-something coder, writer, and editor who thinks it's possible to improve the state of software and software development. What do you do for/with Perl 6? Random stuff: * argue language features with Allison, who lives very nearby * proofread documentation when I'm trying to read it * extending Parrot as an embedded platform for game scripting * overseeing the project to turn p6d documentation into executable test cases Maybe I need a Perl 6 Test Pumpking hat... Where are you coming from? Physically, Portland, Oregon or Sebastopol, California. Otherwise, I find that Perl 5 fits the way I think and expect Perl 6 to do the same, only much more so. When do you think Perl 6 will be released? In beta form within the next two years. Within five years, I think it will overtake Perl 5. (I expect a 5.12, though.) Why are you doing this? Someone has to do this. I'm blessed to be in a position where I have some ability to give back to the community that's given me so much and where I have financial compensation to spend some time participating in this community. I also believe that the way to write high quality software is to take quality seriously. We have the opportunity to test Perl 6 from the ground up, having learned lessons and built tools for Perl 5. If we do our job correctly, we'll even have tests in place before we have the language features in place. Hooray for test-driven development! You have 5 words. Describe yourself. I am not really Schwern. Do you have anything to declare? So this camel and parrot walk into a bar... Acknowledgements Back to writing summaries on the train and in the armchair when I get distracted by almost anything (current distractions, writing a graphical TestRunner for the ObjcTest framework, Eliza Carthy's utterly wonderful *Anglicana* CD and the nsNet puzzle game...). I started writing this on Monday morning dammit. Proofreading was once more handled by Aspell and me. Thanks to chromatic for answering the questionnaire for me. The queue now has one (count it, one) entry left in it so please consider sending me your answers to <mailto:[EMAIL PROTECTED]> If you didn't like this summary, why are you still reading it? If you did like it, please consider one or more of the following options: * Send money to the Perl Foundation at http://donate.perl-foundation.org/ and help support the ongoing development of Perl 6. * Get involved in the Perl 6 process. The mailing lists are open to all. http://dev.perl.org/perl6/ and http://www.parrotcode.org/ are good starting points with links to the appropriate mailing lists. * Send feedback, flames, money and/or one of those enormous new Apple Powerbooks to <mailto:[EMAIL PROTECTED]> The fee paid for publication of these summaries on perl.com is paid directly to the Perl Foundation.