February 02, 2010

Seven Days between the Parrot and the Camel

from Monday, January 18 to Sunday, January 24 in the year 2010

Considering the Language:

Synopsis 7 was updated to better define the notions of mostly lazy, mostly eager and strictly eager.

List assignment semantics have been refined: List assignment will be mostly eager, meaning that it will cause evaluation of the leading part of the right-hand side that is known to be finite. In any case, list assignment will evaluate enough elements to fill scalar slots in the signature, so ($one, $two, @many) = 1..* will eagerly calculate $one and $two. Portions of a list that end with an exact value will be treated as finite, even if it is infeasible to actually evaluate all elements up to that exact value.

There were several changes to types involved with sequential things (List, Seq, Parcel, Capture, Iterator):

The List role represents lazy access to a list. The iterator of a list is the list itself. Thus Iterator, the type of Perl lists, does the List role. However, types doing the List role will usually be hidden from casual view, as iteration is typically triggered by context, not by calling iterator methods.

List does no longer do the Positional role, but it gains a method new and a sub list for creating a List that visits all iterable elements of the given arguments.

Seq does the Iterable role and is allowed to generate its values lazily. The elements that have already been reified, however, will be considered immutable. (The Iterable role also replaces the Each role mentioned in sections about hyperoperators.)

In item context, a list is turned into a lazy Seq object. A Parcel also turns into a Seq object in item context.

The empty Parcel (called Nil) will evaluate to a null list in list context and to an empty Seq in slice context. As iterators can never return a Parcel, Nil will be used as the value that marks the end of iteration.

Array also gets a new method.

Blob does the Stringy role. Conjecturally Stringy might be split into two roles: a general one containing operations for dense sequences (which both Blob and Str are), and a specialized one for operations specific to characters (done only by Str).

The deletion criterion of KeyWeight was brought in line with the other containers. Keys will only be deleted when their weight goes exactly to zero. Implementations may complain, however, if a negative weight is used.



Considering Rakudo:

Patrick Michaud returned to Rakudo development and updated Rakudo to work with Parrot 2.0. He also enabled basic list assignment and in the process triggered refinements of the spec. He also prepared Rakudo development release #25.

Jonathan Worthington taught the ng branch the $foo.'methname'() syntax and the default *%_ parameter of methods, making the branch pass several tests of method invocations. He also improved the handling of has attributes.

Solomon Foster worked to make the ng branch pass some list-related tests.



Considering Parrot:

Parrot 2.0.0 was released on Wednesday, January 20 by chromatic. Major features are the merged CallContext PMC that also supports attribute-based introspection and the improvements of the PMC freeze code.

Right after the release, James Keenan merged the noalignptrs branch into trunk, removing a needless configuration step, and the no_running_make_test branch, which gets rid of an unused harness option.

IMCC now forbids the use of macro labels outside the macro definition, and thereby fixes a reported segfault.

Stephen Weeks worked on the pge_no_namespace_methods branch to fix method lookup in PGE.

1 comment:

  1. Thanks for this blog, Lithos. You do a better job of remembering what I do in a given week than I do!

    Jim Keenan

    ReplyDelete