Hi Nick

nick thomas wrote:

Well, that brings me to my next question. I'd like to start writing an editor, as I said I would. Will Epigram2's editor/elaborator interface be completely different from Epigram1's?


Yes. For a start, there'll be one! In Epigram 1, the editor just provides a rendering of the elaborator state. The elaborator is responsible for knowing where your cursor sits in a shed and other such details, a world away from typechecking: it was very cheap and it sort-of works, but it's very hard to build on. In fact, that's a fairly reasonable summary of the state of Epigram 1, more generally.

More to the point, would it be wasted effort to start hacking on Epigram1?


For all but the very cheapest experiments or tweaks, yes. Epigram 1 is inching towards the scrap heap.

If so, is the editor/elaborator interface for Epigram2 relatively fleshed out by now? Or, more to the point, would it be wasted effort to start hacking on Epigram2?


The basic shape is there, but it isn't very documented. Here's where to start looking:

 http://sneezy.cs.nott.ac.uk/epigram/current/doc/index.html

The basic picture is that Editor and Elaborator live in different threads and have a communication format based on the concrete syntax. The shared state is a big lump of concrete syntax with uniquely labelled nodes. The basic Editor-Elaborator message is 'replace node x with this piece of concrete syntax'. The basic Elaborator-Editor message is 'node x has been replaced by this piece of node-labelled concrete syntax'. The process kicks off with the Elaborator issuing the Editor with its root node. We don't fix any style of interaction: it could be batch-mode (replace root with whole program) or some fab asynchronous thing.

That said, the concrete syntax is already quite an evolved representation in the life of a program, so lots of 'front end' stuff has to happen in the Editor. However, we have a hierarchy of tools which refine input all the way from strings to tokens to 2D documents to syntax to syntax-with-resolved-scope (the Elaborator is never told the user's name choices!), which leaves it up to the Editor-author to choose what to trade in. An editor written in something other than Haskell would require a suitable Haskell stub.

Now, we're currently refactoring the guts of Epigram 2 as we shift over from cvs to darcs. House style is now to write lhs2TeX source, which should at least encourage better documentation. This effort should deliver a dummy elaborator fairly soon---one which communicates sensibly with an editor but doesn't actually typecheck anything. The real thing will take a bit longer. I wish I knew how long, but it's very hard to predict how much hacking we'll manage to fit in around everything else that's going on.

So, Epigram 2 would be the target to go for; the general set-up is already sketched out, so you could at least start planning; once the current move to is complete, we'll have better documentation; shortly after that, we'll have a thing (albeit a dummy) you can actually link to.

Thank you for your enthusiasm!

All the best

Conor

Reply via email to