Mon, 19 Dec 2011

Fourth Grant Report: Structured Error Messages

Merged the nom-exceptions Rakudo branch, so now you
can reliably throw Perl 6 objects as exceptions.

Implemented several error classes and roles in Rakudo

Started to throw typed errors both from runtime libraries and from
inside the compiler

Hacked the default exception printer Rakudo to be much more flexible,
for example you can now write exception classes that supress
backtraces from the standard handler.

Wrote tests for typed run time and compile time errors, and at the
same time developed a test function that makes it easy to write such
tests.

It's time for a quick review of how far I am along the various deliverables
in the original grant proposal.

D1: Specification. I think the hard work here is done already,
what remains to do is finding good default and how to manipulate them
(for example, how to generally switch on/off printing of
backtraces?).

D2: Error catalogue, tests: I've not worked on this one too much.
The error classes and roles so far mostly served to exercise the
implementation; going through the existing errors from the various
compilers and formalizing them will be quite a bit of work, but only
moderately complicated.

D3: Implementation, documentation. Like D1, the hard part is mostly
done. We can now
throw errors from within the compiler actions and from the setting,
next up will be the grammar. Then all places where errors are thrown
need to be changed to use the new error classes. Again that'll be much
work, but easy to do. Documentation is still missing.

All in all I feel I'm well on the way, and most complex decisions have been
made.