[plt-scheme] Literate scribbling question

From: Anthony Cowley (acowley at seas.upenn.edu)
Date: Thu May 21 11:32:46 EDT 2009

Ack! My email was down for a few minutes and I missed the critical
part of the conversation here.

On Thu, May 21, 2009 at 10:29 AM, Eli Barzilay<eli at barzilay.org> wrote:
> 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...

This would be wonderful! It would be nice to take advantage of at
least some of the existing scribble tool chain, though.

> 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.)

It's not clear that mechanism for hiding code from the Haskell
compiler is the only viable option. It seems like an expedient bit of
engineering that happens to have survived the test of time, not a
necessity of the application.

>> 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.

The best part, to me, is being able to type check a document. For
Scheme code, I can envision including unit tests that are run but not
necessarily printed when compiling a document.

> 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.

I suppose this is the answer to my original grievances. I really want
something far closer to barely-literate than
reading-at-a-12th-grade-level.

Anthony


Posted on the users mailing list.