I've been toying around with the idea of creating a structural markup language (like XML) with LaTeX-like syntax and a simple semantics. My idea is to let what are macros in (La)TeX become functions. Then the available functions and their types form the analogue to, say, XML Schemas. Giving a concrete implementation for the functions provides an interpretation to the document, for example transforming it into some other format (like XSLT). I wonder if people think this is a good idea; or would even like to help with its development. I have produced an initial scratch implementation of a parser in Haskell. There is also a function to transform the parsed document into a Haskell expression.
As a next step, I should add a little main routine for reading in a document and spitting out a simple Haskell module which
- imports some given module as an interpretation and
- exports the source document under that interpretation (through the conversion to an expression, as described).