Slashdot Mirror


Literate Programming and Leo

jko9 writes "First proposed almost 20 years ago by Donald Knuth, the idea of Literate Programming is basically that of making program documentation primary, and embedding code in the documentation, rather than vice versa. Despite some obvious advantages apparent to anyone who has struggled to understand a poorly documented program, literate programming never really caught on. That all could change, however, with the release of a new program called Leo, written by Edward K. Ream. Leo supports standard literate programming languages like noweb and CWEB, but with a crucial difference - Leo adds outlines. The effect is striking: overall organization of a program is always visible and explicit. Much of the narrative of the documentation gets placed in the outline, making documentation simpler, and allowing viewers to approach the code at various levels of detail. Screenshots and tutorials for Leo are here - if that site gets slashdotted, you can download the visual tutorials in .chm form or html form from Leo's Sourceforge site. Leo is an open source program written in Python. Any current practioners of Literate Programming techniques out there? People who have tried it and given it up? Can the addition of outlines to Literate Programming make it more powerful / popular?"

7 of 358 comments (clear)

  1. look at the screenshot of pg 10 from the perl samp by Anonymous Coward · · Score: 1, Funny

    i never seen so many freakin task bar icons!

    i assume leo turns illiterate users into literate programmers?

  2. Re:Inline Documentation is evil by Anonymous Coward · · Score: 3, Funny

    Anyone can tell the output of this code

    Yes, it is :-


    error C2143: syntax error : missing ';' before 'constant'
    error C2146: syntax error : missing ';' before identifier 'endl'
    warning C4551: function call missing argument list

  3. Re:Programs as flat text files - why? by mystik · · Score: 3, Funny

    program in html/xml? Lisp/scheme lends itself nicely to this, witness:

    (display (+ 4 (+ 3 4)))

    becomes

    <display> <+>4 <+>3 4</+></+></display>

    --
    Why aren't you encrypting your e-mail?
  4. Been there, done that by devphil · · Score: 4, Funny
    It's wierd, when you think about it, that programming is still done in flat text files.

    Every compiler vendor who has sold a mainstream language compiler/IDE using a "program database" or some other such approach has tanked. (Note that I mean program database as the primary means of storing the code -- a replacement of flat files, not an addition to them.) So far, it's not really been a technological lack, it's just that programmers don't like it.

    I recall reading some papers written by the major language guys a decade ago, and one of the things they all wanted to see was per-function recompilation (instead of per-translation-unit), better program information (like "where is this function used?") and other things that would require a more database-like format. Still hasn't happened except in research environments. (Pity.)

    One could argue for programs in HTML, with the code bracketed in XML

    One could, but one would be a lunatic.

    (I'm too tired to write it all down now, but I'll just summarize by saying that XML is not a silver bullet.)

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  5. Re:Bogus by Anonymous Coward · · Score: 1, Funny

    "The goal of a programming language is to provide a machine with a set of instructions, ..."

    No. From SICP: "...a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute."

  6. Re:Just giving it a name... by Tablizer · · Score: 4, Funny

    If I were reading someone's code and saw:... // increment i ... i++; I'd rip his (or her) head off.

    I feel that punishment should mirror characteristics of the crime itself.

    Tie them to the ground, get a perm marker and write "eye" on their eyelids, "nose" on their nose, "neck" on their neck and so forth, and for a good summarizing comment, "STUPID!" on their forehead, and finally "Brain" on their ass.

  7. Re:Literate Programming by Anonymous Coward · · Score: 1, Funny

    I think we're talking about real engineers, not Sanitation Engineers, such as yourself.