[plt-scheme] Literate scribbling question

From: Eli Barzilay (eli at barzilay.org)
Date: Thu May 21 10:29:08 EDT 2009

On May 21, Noel Welsh wrote:
> I'm struck by the simplicity of literate Haskell:
> 
>   http://www.haskell.org/haskellwiki/Literate_programming
> 
>   In haskell, a literate program is one with the suffix .lhs rather
> than .hs. ... to distinguish between code and non-code portions ...
> prepend all code with a >

Right -- it's very simple, and could very easily be done in PLT with a
new reader.  There's no need for Scribble -- any language will do.
But...

> No weaving etc.

...there's that.  I've seen this called "semi-literate programming",
which is something *very* different that the non-semi version.  (IMO,
the relevant page on the Haskell wiki is very misleading in that.)

In addition, the hackish nature of this thing shows through in several
ways -- like the fact that empty lines are sometimes significant, and
the obscure ways that you're supposed to use if you want to hide some
block of text or a block of code from the documentation or the actual
code.  (Eg, commenting a whole part out of the text, or some code that
is only an example for the doc, or some internal code that should not
be documented.)


> Very simple to use. Haskell people sometimes write blog posts in
> this style, so you can just copy and paste the code to get it
> running. Sure, it is less powerful than the traditional LP, but
> perhaps people don't really need that power.

Right -- and personally I agree (I don't like the power of proper
LP).  But this is a different subject than what the scribble LP
library does.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.