[Haskell-cafe] Literate programming

Phyx lonetiger at gmail.com
Sat Jun 12 17:56:37 EDT 2010


>I've experimented with LHS, NoWeb, and NuWeb. LHS is useless -- you can achieve the exact same effect with standard comments. I can't figure out why it exists. NuWeb is nice, but immature -- I >had trouble getting it to generate correct output without jumping through hoops.
>NoWeb is my current preference for literate programming with Haskell.

This is not true. You can't have for instance a HTML documentation mixed with your source with just plain comments, style code blocks etc and only have to maintain one source.

>I'm writing my own preprocessor, designed for Haskell, though it's more of a "something to avoid washing the dishes" project than a "this will ever be released or useful" project.

>All commentary is marked up with LaTeX. I suppose you could use reStructuredText or HTML, but LaTeX has better support for embedding maths.

So... You're basically recreating LHS. You do know that LHS supports latex style documentation. LHS is far from useless since It's a good way to for instance write a paper. I've seen a great deal of papers written in LHS, the advantage is that when you change the code, you don't have to update a separate file. (see lhs2tex)

>Something to note is that Cabal really can't handle literate programming well. Its preprocessor support assumes a 1:1 correspondence for generated files, which is not present in any non-trivial ?>project. This can be worked around by using Make to run the preprocessor, and distributing the generated files in Hackage tarballs.

>I've tried using Leksah, but it doesn't display tabs, which obviously makes formatting rather difficult / impossible. I wonder how anybody can use it -- do they just use spaces and avoid indenting >completely?

This one completely confused me. You need to see a tab to know how the formatting would look? Or how the indented line looks? 

>GEdit and Vim both work well.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list