James Tauber

journeyman of some

blog > 2005 > 12 > 02 >

Revisting Versioned Literate Programming

Greg Wilson asks about incremental display of source code.

His example shows somewhat the kind of thing I was thinking when I wrote about versioned literate aspect-oriented programming where I said that I'd like a literate programming tool for writing tutorials...

I could write a web and then tangle it to generate the [...] application and weave it to get the tutorial. But as features are incrementally added to the application over the course of the tutorial, conventional literate programming might not be enough. At the very least, some kind of versioning would need to be included.

Greg is talking more about animated display online using Javascript but from an authoring perspective, I think we're looking for a similar tool. Greg's example is really nice for demonstrating how code gets developed at certain insertion points. That starts to touch on the aspected-oriented element I was thinking of (although there are no cross-cutting concerns in his simple case)

Back in March 2004 when I wrote my original post, Dave Long commented:

Literate programming is composing a program source by pasting together a dag of (smaller) chunks.

Versioning, however, is composing a program source by pasting together a list of (sequential) edits.

The former is primarily spatial, and the latter primarily temporal, so it may not be too difficult to keep the two from interfering.

Heck; use the versioning capability to expand chunks in the appropriate environment of a configuration tree, and one would have self-documenting CM.

One thing that occurs to me is that the versioning in what I'm talking about isn't exactly the same kind of versioning you normally do with something like Subversion. It's not about keeping a history, it's about creating a history, so there'd be nothing wrong with going back and changing earlier versions.

I'm still wondering if anyone has built something like this. I haven't had the time :-)

Categories:
prev « software_craftsmanship » next

Comments (6)

Ian Bicking on Dec. 2, 2005:

I kind of did this in a tutorial before, putting function calls inside reST comments, all executed by doctest. So there'd be a command like "write this content to this file" in a comment (and the actual content also inserted into the documentation), and then we would procede "normal" programming with that new content.

It was awkward. But not impossibly horrible -- you could get a glimpse of a better solution from that point. In this case the documentation contained the code, not the other way around, and that's probably right -- for tutorials (where you want this) there's more narrative than code.

Anthony B. Coates on Dec. 3, 2005:

It's been ages since I've done anything with my xmLP LitProg tool
http://xmlp.sourceforge.net/
but one thing that people asked for was the ability to have code chunks appear inline where they referenced, rather than just as hyperlinked references to the original chunk elsewhere in the document. You could use this approach to allow you to re-use the same chunks throughout a tutorial as you incrementally add features to a piece of code. Just a thought, anyway.
Cheers, Tony.

Bill Peterson on Dec. 3, 2005:

Have you ever looked at Leo? http://webpages.charter.net/edreamleo/front.html

It may not be exactly what you're looking for, but it does allow you to set up as many different views of your text as you like.

James Tauber on Dec. 3, 2005:

Yes, I've looked at Leo (see http://www.jtauber.com/blog/2004/05/15/using_the_leo_outliner_as_a_pim for a completely different application of it)

I think Leo would be a great starting point. What would need to be added is just that extra dimension of time. It's not a trivial addition but Leo certainly has a lot of the pieces.

lkmhfvhze on Aug. 20, 2008:

WGRBTy <a href="http://lcjlsokcufiz.com/">lcjlsokcufiz</a>, [url=http://vbisaiqeqicg.com/]vbisaiqeqicg[/url], [link=http://yzfhjjmorcon.com/]yzfhjjmorcon[/link], http://hfdnjcigieyr.com/

etiunhqxphj on Aug. 21, 2008:

Dh5n28 <a href="http://fvhvszlqaioi.com/">fvhvszlqaioi</a>, [url=http://qhbjhgouoaux.com/]qhbjhgouoaux[/url], [link=http://qxzeqczbhywc.com/]qxzeqczbhywc[/link], http://cxooiwirfqdt.com/

Add a Comment

Created: Dec. 2, 2005
Last Modified: Dec. 2, 2005
Author: jtauber