This Fortnight in Perl 6, Feb. 23 - March 7, 2005

By Matt Fowles on March 10, 2005 12:00 AM

All~

Welcome to yet another fortnight summary, once again brought to you by
chocolate chips. This does have the distinction of being the first summary
written on a Mac, so if I break into random swear words, just bear with me.

Off-list Development

In more related news, someone pointed out to me that development goes on off-list on places like IRC. I briefly contemplated quitting my job and tracking
such things full time, but then I decided that it would be better to accept
brief submissions for the summary. Thus I will be adding a fourth section to
the summaries based on contributions. If you would like to make a contribution,
email me with a brief summary. Please include the name by which you would like
me to attribute you (though sadly the process I use will likely to mangle any
Unicode characters). Please make all links full. I will shorten them.
Thanks!

Perl 6 Language

It turns out that not() (with no arguments) made Perl 5 core
dump for a while, and it took us five years to figure that out. In Perl 6 it
will be a list op. Calling it with no arguments will return a null list or an
undef depending on context.

I had hoped that last week someone would have addressed the concerns about
threading. I was disappointed in this. A new crop of concerns surfaced and died down fairly
quickly (as the chief proponent, Damian, was away).

Somehow the discussion of junctions morphed into a discussion of sets, which
morphed back into junctions, which morphed into a discussion of serialization
to different languages. Interesting stuff, but I wouldn't hold my breath for
it.

Adam Preble posted an offer to develop some benchmarks for Perl 6.
Unfortunately, I think he posted it to Google Groups. Also, he probably should
have posted it to p6c or p6i as the language folk tend to wave their hands and
say "magic occurs but correctness is preserved" when it comes to
optimization.

Autrijus posted an example using junctions, instead of parents, to solve the
classic

SEND MORE + ===== MONEY

problem. Markus Laire asked for a clarification, and Rod Adams pointed out
that he felt that it would not work as it did not capture the interdependence
of the "e"s. This lead to the question of how to write Prolog-like code
(including unification and backtracking) in Perl 6. No one offered answers.

Autrijus wanted to know if hash keys were still just strings or if they
could be more. The answer is that by default they are strings, but you can
declare them as having a different shape . This led to a
discussion of hashing techniques such as the .bits,
.canonicalize, or .hash methods.

Dave Whipp wanted to make "dynamically-scoped dynamic scopes". My head hurt,
but apparently Larry's didn't. He replied, "Piece of cake, the syntax [and
implementation] are left as an exercise for the would-be module author."

Rod Adams asked how he could specify arguments to rules so they could be
more function-like. Larry explained that there were several syntaxes, each of
which can coerce its arguments in slightly different ways. He then mused that
perhaps there were too many. I agree. There are too many.

Ahbijit Mahabal wondered how type checking will work for cases where it is
not easy to determine the types at compile time. The answer: checking will be
deferred to run time. In the end it seems that Perl 6 will blur the line between
run time and compile time heavily. Perhaps it will provide nifty support for
staged programming. Meta-Perl 6 here we come.

Brian Ingerson asked about the CONFIG hash and what sort of
secondary sigil it would have. Larry explained that $?CONFIG holds
the config for the machine compiling the program and $*CONFIG
holds the config for the machine running the program. Then he made some noise
about parsing, compiling, and running all on different machines. Then he
suggested that this way led to drug induced madness.

Luke Palmer wondered how optional arguments and slurpy ones would interact.
Brent and Larry explained that they would snap up whatever arguments they
could, but you can always beat them back by piping in your slurpy stuff with
==> .

Thomas Sandlaß wants to know how the type system and the class system
interrelate. He drew a happy tree of A, B, and its junctions. Really it
confused me, and I agree with him that I don't understand the value of the one
junction in the context of types.

Wolverian does not like any of the ways he can indent his long function
declaration when it uses traits. He wants to allow a comma in them to solve
this dilemma. Larry and others suggested a few alternatives. This led to a
discussion of module loading and header/module files. Larry admitted that he
would not mind if Perl 6 developed Ada-like module files.

Perl 6 Compiler

Pugs Releases and patches

Various Pugs Patches

Luke Palmer added more qq delimiters and fixed a unary
- bug. Yuval Kogman posted a fix that made anonymous blocks both
parse and run. Stevan Little un-TODOed a bunch of tests that started working;
he went on to add some new tests that do not yet pass. I suspect that he is
just providing more for him to un-TODO later. Yuval Kogman submitted several
patches including array interpolation, a CATCH {} test, a test for
an assignment bug, and a fix for a conditional of expected. Garrett Rooney
cleaned up given.t, added a test for %hash.kv, one for
declaring variables in a loop, and another for $?LINE and
$?FILE.

Abhijit Mahabal wondered if p6c was the correct place to post questions
about Pugs and bugs in Pugs. Patrick and Autrijus agreed that p6c was indeed
the correct place for most initial questions. Things will escalate to p6l only
when the Apocalypses|Exegeses|Synopses are not clear.

Garrett Rooney was having trouble using the &?SUB variable in pointy
subs. That is because they don't use it. &?SUB is only for full-fledged
subs. That way you can call &?SUB from within a for loop in a sub and get
the nice recursive behavior you likely want.

Autrijus asked Larry for clarification of which circumstances set
$_. Larry explained that -> topicalizes its first
argument but full subs undefine it until something else sets it, while methods
bind it to their first invocant.

Luke Palmer was having trouble getting for %hash.keys { ... }
to parse correctly. Larry replied that it is problematic if methods parse in
the same manner as subs. Fortunately, the parens are mandatory when there are
arguments in addition to invocants.

Darren Duncan has offered to start the ball rolling with Perl 6 integration
testing. He will translate a few modules he has written to Perl 6 so that they
can act as more holistic tests for Pugs and Perl 6. There is an interesting
conversation about CPAN and Perl 6 involved too.

Bernhard Schmalhofer asked about adding heredoc support to PIR. This led to
Melvin ranting that PIR is not a language for people to write. PIR's goal was
to be to be an intermediate language targeted by compilers and was not supposed
to have human niceties like heredoc. Of course, for PIR to reach that state, we
need a high level language that actually targets it.

Leo announced that he has merged Dan's string patch into the current CVS
head. Thanks go to Will Coleda for doing all the heavy lifting. String content
in assemblers now assume the iso-8859-1 charset, unless you specify
otherwise.