November 29, 2009

Seven Days between the Parrot and the Camel

from Monday, November 23, to Sunday, November 29, in the year 2009

Considering the Language:

Seeking a word that conveys both allness and nothingness, Larry Wall renamed the root of the Perl 6 type hierarchy to Mu, an allusion to the Zen concept of "no thing" or emptiness as the nature of all things. (Cows were also mentioned.)

The radical change to Mu was the outcome of a wider exploration: undef as a term becomes obsolete, as there will be no singleton undefined value in Perl 6, but rather various flavours, for example the most undefined Mu, other protoobjects carrying type information, failure objects (created with fail), or Nil.

Said Nil is no longer a type, but a name for the empty parcel (), which represents the absence of return values and resets containers to their initial value upon assignment (Mu for untyped scalar containers).

The sink prefix dissolves returned values to Nil, which can help trigger actions in case of empty lists as in "for @some || sink { warn "None!" } {...}".

The convenience macro .notdef and multi notdef will be useful for matching undefined values.

The chapter about enums in Synopsis 12 got expanded. Enum types are no longer roles, instead the types of enum values will just be guaranteed to be derived from and convertible to the enum's base type. Enum keys may be used as type names (each type containing a single enum value). The enum type itself appears like a typename package containing a set of constant declarations and supplies a .mapping method to get at the translation of symbolic values to enum values.

Considering Rakudo:

Patrick Michaud's reimplementation of "Not Quite Perl", nqp-rx, kept improving: Quoted strings can now be used as method names (including interpolation), regexes learned to heed :pos and :continue options, and Stephen Weeks contributed exception handling via try, CATCH, and CONTROL.

The rakudo ng branch continued climbing up the spectest curve, which turned out steeper than initially hoped for, as many test files require features beyond those actually targeted by the respective test.

Still the branch made good progress, as the Rakudo developers added eval, lazy signature binding, regexes, and parts of the meta-object protocol, which was the focus of Jonathan Worthington's Rakudo Day.

Considering Parrot:

Last week, chromatic had observed that in one of Rakudo's use cases the repeated marking of a modest number of long-lived objects consumed over 88% of total CPU time. This finding led to discussions about garbage collection this week, and to the general agreement that a generational garbage collector would be an important improvement. Allison Randal confirmed that garbage collection will become a likely focus of development after release 2.0.

Cotto committed an NQP port of the profiling script pprof2cg, noting, however, that it was 26.5 times slower than the Perl version.

Patches by bubaflub and kurahaupo converted further tests from Perl 5 to PIR.

Allison Randal sent a note about MMD to the parrot-dev list, outlining how hypercube graphs could be used for fast calculation of Manhattan distances during dispatch.

Plumage saw a lot of refactoring and glue code reduction as more features of nqp-rx became available. Geoffrey Broadwell proposed a naming scheme for plumage dependencies which seemed to be well received. Fran├žois Perrad continued work on his distutils package and contributed plumage metadata for several projects. As of this writing, the metadata base of plumage counts 23 projects.

November 22, 2009

Seven Days between the Parrot and the Camel

from Monday, November 16, to Sunday, November 22, in the year 2009

Considering Parrot:

The Parrot trunk remained mostly quiet after release 1.8.0 went out, while the Parrot developers finished the move from to the Trac issue tracker in a burst of activity. James Keenan, in particular, did a huge amount of ticket updates and documentation fixes.

Most notably, nqp-rx, Patrick Michaud's self-hosting reimplementation of "Not Quite Perl" and Perl 6 regexes, is now distributed along with Parrot and gaining new users. Among them is plumage which became the source of several nqp-rx feature requests.

Fran├žois Perrad's build system "distutils" saw many additions, among them an update step, smoke target, plumage target, and a Win32 Inno installer target.

Similar to PMCNULL, STRINGNULL is now available for representing the lack of a STRING.

Addressing the needs of HLL developers, chromatic implemented several performance improvements, squeezing over 12% [reporter's calculation] out of the nqp-rx benchmark. Most of this is due to the addition of a method cache in the Object PMC and special-casing of hot paths in the Hash PMC.

A new mailing list parrot-users (with group) was installed so language authors can seek assistance undisturbed by the sounds of Parrot's internal machinery.

Considering Rakudo:

Development release #23 "Lisbon" was cut from master, but most of this weeks activity took place on the new "ng" branch where Patrick Michaud and Jonathan Worthington are quickly rebuilding Rakudo's internals using nqp-rx. As more features become available, contributors are starting to implement parts of the core setting in Perl 6.

Considering the Language:

The seventh meta-operator S appears with the ability to attach a sequence point to any non-fiddly infix operator. The resulting operator guarantees that its operands are evaluated sequentially and that shortcuts are taken where applicable. Former also is now spelled S&, and the junctive sequential else -- which only made a brief occurrence -- is spelled S|.

An area that might still need some sorting out is the combination of the sequencing S with the reversal meta-operator R. Conjecturally, application of R reverses the sequence of evaluation along with the operands, i.e. a RS/ b evaluates a first and b second, while a SR/ b evaluates b first and a second.

The semantics of rational numbers were elaborated and balanced between precision and performance. FatRats joined the pack providing arbitrary precision in both numerator and denominator at any cost. The parametric Rational role serves as the general abstraction for rational numbers, analogous to Integral for integers.

The stringification prefix ~ got divorced from .Str. Unary ~ imposes a Stringy context and -- like Perl 5 stringification --, will turn undefined values into the empty string (with warning).

Slightly changing, constant now considers itself a type declarator, declaring a type that has a single value determined at BEGIN time (so the optimizer can inline its uses). Scope declarators as in my constant, has constant, etc. can be used to specify visibility and storage location. By default constants (like enums) get our scope.

A new scope declarator, anon, can be used to create anonymous subs with "of" type (i.e. anon Foo sub {...}), so you don't have to abuse my or our for this purpose.

The "void" context got tentatively renamed to "sink". (Like its big sister, Perl 6 has three main contexts (sink, item, and list) controlling whether an expression should yield none, one, or many of its values.)

Parcel semantics got some attention this week and the is ref parameter trait changed to is parcel. Larry encourages us to spell \$p instead of $p is parcel, however, as the trait is mainly meant for introspection. (As every language feature needs its antagonist, Parcels show up when context is not called for. They provide a way for passing data without imposing context.)

In other cont...areas the heavily overloaded word "context" was allowed to drop some of its burden: "contextual" variables became "dynamic" variables and are now accessible via the DYNAMIC pseudo-package. Things formerly known as "dynamic contexts" or "activation records" are now simply "call frames".