This Week in Perl 6, April 20 - 26, 2005

The Perl 6 Summary for the Week Ending 2005-04-26

It's my turn again. What fun.

"What," I hear you all ask, "has been going on in the crazy, mixed-up world of Perl 6 design and development?" Read this summary and, beginning with perl6-compiler, I shall tell you.

This Week In perl6-compiler

Refactoring Test.pm

Stevan Little had an idea while he was refactoring Test.pm. He wondered whether to get rid of the various todo_* functions in favour of just using a t/force_todo file. This led him to wonder about doing away with t/force_todo in favour of a force_todo() function. He asked for opinions before he started making the change (which isn't exactly a refactoring).

General opinion seemed favorable, though I confess to feeling perturbed by the proposed release trick of proclaiming all failures, whether expected or not, to be TODOs. The current system generates an explicit list of tests that fail on "core" systems. The proposed solution seems to make all failures equal, so as not to catch even unexpected "platform" failures.

Weird Thing with say ++$

What do you know, say $i++, ++$i behaves weirdly.

Pugs 6.2.1 Released

Autrijus announced the availability of Pugs 6.2.1 which comes complete with much shininess.

This Week in perl6-language

Parrot Common Lisp

Cory Spencer's port of Common Lisp to Parrot received much admiration (it has some way to go before it's really Common Lisp, but it's a cracking start). Uwe Volker suggested porting Emacs to it, and Lars Balker Rasmussen promptly accused him of being Erik Naggum.

Cory acquired (or is acquiring) a committer bit.

State of the Tcl

Will Coleda gave the list a heads up on the state of ParTCL, the Parrot TCL port. It still fails some tests, apparently because of GC issues.

A few days later, these problems went away. We're not quite sure how, though.

alarm() and later()

Leo stated that Parrot provides subsecond timer resolution as well as alarm callbacks and multiple timers. Hurrah!

RFC assign Px, Py

Leo posted a discussion of the semantics of assign and set, with a proposed change to PIR syntax. Warnock applies.

RFC Unary Operations

In another RFC, Leo discussed changes to Parrot's unary operators and proposed other changes.

One More MMD: Assignment

Dan noted that he was writing a great deal of code in his set_pmc vtable methods that looked very MMD-like. He suggested that adding assignment to the list of MMD functions might be a good idea. Leo pointed him at his assignment RFC.

Fun with morph()

Nicholas Clark wondered about the responsibilities of the morph method with respect to handling PMC_struct_val. In the subsequent discussion it became apparent that morph can grow complicated. Bob Rogers supplied a bunch of extra complications and wondered about the feasibility of making Parrot morph-free. Leo agreed that it seemed feasible and is probably a good idea. Another subthread made my head hurt; I can understand this stuff much better when I sit 'round a table with people and we have a plentiful supply of drinks, notepaper and, in Leo's case, industrial quantities of tobacco. (Ah... YAPC::Paris!)

Building An Incomplete Code Generator into Parrot

rocko@adampreble.com (that's the only name I have) has started work on implementing a JIT backend for the AMD64 processor. He asked a few questions and Leo provided answers.

Calling Convention Abstraction

This thread continues to rumble on. Leo said that what he wants is for the HLL folks to create a workable scheme for abstract and extendable calling conventions that could express all the various HLL-specific semantics of function calling. He pointed out that unless we have this we can forget interoperability (or at least easy interoperability).

Alpha Development Box

Bob Rogers "has" an Alpha development box that open source projects can use. He wondered if the Parrot project could make use of it, and if so what was the best way of doing this. Some discussion occurred on the list, but I assume (hope) more happened offline.

Meanwhile, in perl6-language...

Calling Junctions of Closures

Brad Bowman wondered about calling junctions of closures. He guessed that the rule is "call 'em all and return a similarly structured junction", but wasn't sure. Thomas Sandlaß wasn't so sure.

My head hurts.

{ => } Autocomposition

Autrijus asked about the following fragment:

%ret = map { $_ => uc $_ }, split '', $text;

which give Pugs a massive headache.

From the ensuing discussion, it appears to cause Larry and Autrijus headaches, too. Also, it turns out that Larry's Perl 5 to Perl 5 translator has both madprops and madskills. Hurrah! Darren Duncan suggested that

%ret = map:{ $_ => uc $_ }, split '', $text;

should serve to say that the block is a block rather than a hash constructor. He thought that this came from one of the synopses, but couldn't remember which.

I wonder if:

%ret = map -> {$_ => uc $_}, split '', $text; 

wouldn't do the job. (Or did the syntax change on me when I wasn't looking?)

Embedding Languages in Perl 6

BÁRTHÁZI András had some questions about introducing different parsing rules in the middle of a Perl 6 program. Larry's answer was essentially, "All's fair if you predeclare", but with an interesting idea about using ` as a way of introducing a "self-terminating construct". So one could do:

use XML;

$a = `<elems><elem>Content #1</elem><elem>Content #2</elem></elems>;

or

use SQL;

$a = `select * from table`;

Various possibilities came up, but nothing set in stone.

Closure/Block/Sub Multiplier

Matt Creenan wondered about doing @names = &get_next(...) XX 5; (which, obviously, would call &get_next five times and shove the results into @names). Juerd pointed out some subtleties to do with functions that return closures. Later in the thread he decided that he controlled both the horizontal and the vertical, with particular reference to redefining true, false, and undef.

alarm() and later()

Remember the discussion of alarm and later in perl6-internals? It moved over to perl6-language. Larry agreed that Perl 6's time interfaces will favor floating point time values, but he wasn't quite sure if any of them will have the name alarm. Discussion ensued, both on the topic and on matters of naming style.

$?OS Globals, Etc.

Scott McWhirter proposed making the various $?OS, etc. variables into attributes of some GLOBAL class. Larry thought it was a good idea, but wasn't sure it was entirely right as proposed. This area is still under design.

Parens v. Subroutine Parameter

Autrijus had a question about how function signatures and various forms of paren magic interacted. He, Juerd, and Larry thrashed things out.

-Xs Auto-(Un)quoting

Michele Dondi had some questions/suggestions about the various file test operators. Larry answered and the thread spun off into a discussion of all sorts of aspects of these handy operators. Well, that was before it turned into a discussion of the semantics of <.foo>, or ^foo, or maybe _foo, or possibly ....foo. At this point, things grew a little heated. There's no decision yet. (Personally, I'm a fan of the scheme as originally proposed; .foo calls the method foo on the current topic, whatever that may be. If you need to hang on to old topics, give them a name. I appear to be in something of a minority on this.)

Unify cwd

It turns out that the "current working directory" isn't as obvious as it sounds. It also turns out that Larry would like to be able to pretend that it is until it turns out not to be.

Blocks, Continuations, and eval

When last we saw this thread, Larry had said that continuations would be available in Perl for people who ask specially, but that he wouldn't leave them lying around in the open where "some poor benighted pilgrim might trip over them, unaware." Wolverian asked what the interface would be. Larry thought it would probably start use Continuations;, or possibly use CONTINUATIONS;.

The thread prompted Stéphane Payrard to ask about the possibility of some of the more "out there" functional programming tricks making it into Perl 6. Once again, all's fair if you predeclare, but it looks like Perl 6 already has core access to some pretty "out there" stuff.

Accepted Abbreviations

Juerd wondered if we could compile a list of standard abbreviations for various terms so as to apply them consistently. He kicked off with a list of his own. There was some discussion, but I somehow doubt that people will use his list rigorously.

Thunking Semantics of :=

Once someone starts to implement a language, you have a wonderful driver for design decisions that need to be made and for finding ambiguities that need to be ironed out. On this occasion, Autrijus needed some clarification of the semantics of the binding operator, :=. Now we have ironed out ambiguities and written implementations (and yes, I do mean implementations.)

for all(@foo) {...}

Brad Bowman had questions about the workings of for all(@foo) {...} based on S03. It turns out that the Synopsis is wrong. Larry explained how it really should work (which is how it already works in Pugs).

Lazy Lists + Mutable Arrays + Garbage Collection

Brad also had questions about the workings of lazy lists. In particular, he wondered about treating streams as mutable arrays. Warnock applies.

map { $_ => uc $_ }, @foo Again

Autrijus proposed a cunning plan to deal with the ambiguities inherent in:

map { $_ => uc $_ }, @foo;

by suggesting that using a block without the comma should force the interpretation of said block as a block rather than as a hash constructor. Larry wasn't sure, arguing that it was best to disambiguate with something just before or just inside the block (in the same way that pattern modifiers now go before the pattern.)

Passing Hash to a Sub Expecting Named Params

Carl Franks wondered if he could pass a splatted hash (*%hash) to a function that expects named arguments. Answer: yep.

Turning Off Warnings For a Function's Params?

David Storrs wanted to be able to selectively turn off some warnings when he's testing. He asked how to go about doing it. Luke and Juerd provided some answers.

How do I Tie Hashes/Arrays?

Discussion of how to tie hashes and arrays continued.

Surprising consequences

Juerd worried that code like if($foo) { say 'foo'} would throw syntax errors. It turns out that one of his givens wasn't quite as given as he thought, so it's not a syntax error.

Calls and Parens

Juerd posted a set of examples of the new rules for parsing parentheses in function calls and asked which of his assumptions were wrong. Luke Palmer reassured him.

Context and Index Expressions

Autrijus posted a set of examples of array indexes and asked if he had all the contexts right. There was no answer at the time of this writing.

Hmm...still fun. I could get used to this.

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

Or, you can check out my website. Maybe now that I'm back to writing stuff I'll start updating it.

There are also vaguely pretty photos by me.

See you all in a fortnight.

Visit the home of the Perl programming language: Perl.org

Sponsored by

Monthly Archives

Powered by Movable Type 5.13-en