Today was a short day for me; the first 5 hours are spent on travelling to Hualian, then the post-conference fatigue kicked in right after dinner, so I took a nap, woke up to write this journal, and about to sleep again.
However, I did spend some time playing with GADTs, for the upcoming
IMC compiler and
Eval.hs refactoring. It is a very powerful
feature introduced in GHC 6.4, along with Software Transactional Memory
(lock-free, composable, atomic threaded code) and
Template Haskell v2 (which allows for type-safe BEGIN blocks in Haskell code
that can lexically rebind the builtins based on console input -- extremely
What are GADTs good for? Well, In most ASTs, it is possible to construct a "nonsense" AST that would not be detected until the runtime. For example, here is a valid Pugs AST:
# Representing the nonsense program: ++[42=]
Syn "" [ App "&infix:++"   ] [ Syn "=" [ Val (VInt 42) ]
Furthermore, the compiler and evaluator spent lots of dead code on unpacking
Exp structure and repacking them into the
structure. GADTs solve all this by give each node in AST a well-typed
representation, so it becomes impossible to construct invalid ASTs,
which greatly simplifies the compiler and evaluator. More details are
available in the Wobbly Types paper, and the upcoming Pugs Apocryphon 2:
Hualian is evidently a great place for hacking. clkao and obra worked tirelessly on getting svk 1.0rc1 out, with a huge list of changes. svk was the reason why Pugs can adopt a wiki-style development model, and I owe a lot of my productivity to svk. Hopefully one day Pugs can pay back by freeing clkao from the Swig/XS mess, and put an end of this written in Perl, so gets no respect situation.
In other Hualian news, mugwump and ingy worked on Perldoc, their new name for the unified framework that includes POD, Kwid and other inline DOM structures. Magically they managed to agree with each other, producing a detailed process flow document, as well as a comprehensive set of modules for the Perldoc toolchain. Excellent work!
Oh, and mugwump continued to make sense out of the Perl 6 OO model. I love his comments in Class.hs, e.g.:
∃ MetaCategory C₁, C₂ : C₁.catPair = C₂ ∧ C₁.catIsComposite
Other developments from across the world:
Pod::Streamermodule. He also wrote a README explaining his plan on hacking our way out of the Stone Age.
pugs -I, and noticed that
~~was broken when the right hand side is a variable; I fixed it promptly.
perl6.vim, bringing it up to speed with today's Perl 6.
%?CONFIGhash, and hacked in support for
That's it for today. See you tomorrow!