Day 167..176 (r5895): Ten-day tea time of the soul.

autrijus on 2005-07-29T21:10:33

I have been away for ten days. I blame the first two days to the overly addictive The Sims engine; however, thanks to previous inoculation from NetHack, I eventually got out of it.

During the week that followed, my time was divided evenly between new $work, and ingesting thousands of pages of papers in the hope of coming up with a sane PIL design.

To that end, in addition to formal systems such as F<:, CoC (also Fw etc -- see an explanation in CubInt), vObj (including their very convincing solution to the expression problem ) and various module systems, I also surveyed the internal calculi of two classes of languages:

Typeful static languages with first-class functions and objects
O'Caml, Nice, Scala, rHaskell, Nemerle, Boo
Dynamic languages with reconstructable types
Cecil, CMUCL/SBCL, PyPy/Starkiller, Scheme (Widera), Chuck/Squeak (Garau)
The unifying feature between the two is type inference; I believe that Perl 6 will benefit from a design for incremental staticness, a form of annotation-directed complete type inferencing. See my p6c/p6l post from some initial ideas, and the previous post for a background.

However, that relies on Perl 6 observing a sound type system in its type annotations; see this post and two self-replies after it for a brief overview of the problem. I don't know if @Larry or p6l have discussed this before; to me, this issue decides whether PIL can use user's type annotations toward static typechecks.

Perl 6 has named, multi-parameter generics, known as hierarchical types, which brings with it the variance problem. Currently, there is no syntax in Perl 6 for variance annotation; I propose that we adopt variance inference in the style of O'Haskell, possibly overridable with definition-site annotations in the style of Scala.

As I was often reading those papers and experimenting PIL designs during work breaks, my work with current Perl 5 technologies (Catalyst, Test::Base, DBD::SQLite, PDF::API2) kept me firmly grounded. While Perl 6's better is better mentality makes hard things easier, we must not at any time make easy things harder.

I'm sorry that I can't get around to summarize the amazing developments in a much more advanced JavaScript backend, self-bootstrapping MetaModel, rich new modules for HTTP/CGI and Span/Recurrences, a YAML-based new build system tonight. Meanwhile, chromatic's article on Porting Test::Builder to Perl 6 is a good read; I'm glad I fixed the last showstopping bug two days before it's published. :-)