Mark P Jones wrote:
> 
> | Hugs supports the latexish "\begin{code} .. \end{code}" in .lhs files.
> |
> | by adding this code to "input.c" you could also support HTML
> | ...
> 
> It's a neat idea to encourage publication of Haskell code on the web.
> But, personally, I think that including \begin{code} ... \end{code}
> support in Hugs was a mistake, and I would rather remove that than add
> support for HTML (or for any other markup language you might choose).
> ...

I'd just like to mention that \begin{code} ... \end{code} isn't just
LaTeX, but also part of the markup language used by the Glasgow literate
programming tools. These are distributed with ghc and nearly the whole
source code of ghc is written with it.

These tools give you the flexibility that Mark wrote about: to translate
one document into LaTeX, Html, etc (including generation of an index /
hyper links, table of contents, etc).

However, the markup language is not used inside Haskell comments as Mark
suggests, but Haskell code is embedded into this markup language using
\begin{code} ... \end{code}, similar to Knuth's original WEB system.
Ghc uses a preprocessor lit2hs before the actual compilation and an
interpreter like Hugs needs to understand \begin{code} ... \end{code}.

I suppose both approaches have their merrits. Including the program code
inside a markup language makes the basic literate tool
language-independent (however, for any advanced features like an index /
hyper links you need language specific add ons). It also stresses that
the program code is the least part of the program ;-)
On the other hand, what are comments still any good for with such a
tool? (the Glasgow literate tools don't process Haskell comments at
all).

Olaf

-- 
OLAF CHITIL, Lehrstuhl fuer Informatik II, RWTH Aachen, 52056 Aachen,
Germany
             Tel: (+49/0)241/80-21212; Fax: (+49/0)241/8888-217
             URL: http://www-i2.informatik.rwth-aachen.de/~chitil/

Reply via email to