A Literate Programming Example with Org Mode

Arne Babenhauserheide has posted a nice example of literate programming with Org mode. It's a bare-bones example but shows what you can do including stitching code blocks together.

Using Org mode for literate programming probably isn't as powerful as something like Knuth's CWEB but it does have the advantage of working with just about any language and of running the code directly from the (untangled) source file to insert results directly into the document.

Even if, like many people, you don't care for the literate programming paradigm, the idea of combining code and narrative is still very powerful. The approach used by (for example) John Kitchen to embed the code used for calculations and figure generation is a huge aid in reusing results, calculations, and figures and is a significant step towards reproducible research.

In any event, take a look at Babenhauserheide's example. It may give you some useful ideas and it certainly serves as another demonstration of the power of Org mode and Babel.

This entry was posted in General and tagged , . Bookmark the permalink.
  • Literate Programming requires you to 1) Really enjoy and invest in getting good at programming and 2) Really enjoy and invest in getting good at writing and finally 3) Learn a Literate Programming tool. Emacs happens to make it easier to do all three of these things.