Literate Programming With Org Babel

Howard Abrams recently gave a talk at the PDX Emacs Hangout in Portland. So far, there is no video of the talk but Abrams did write up his notes1. The talk was intended to be a workshop so you should work through his examples as you read the notes.

The idea of the workshop is using Org Babel for Literate Programming. Abrams demonstrates that you can do straight Literate Programming à la Knuth but the real power of the Org/Babel combination is the ability to mix languages, run the code in situ, and then incorporate the results of the program directly into the text.

Babel has many ways to accomplish those last two steps and the bulk of Abrams' workshop is devoted to exploring the different ways to input and export data to the code. The notes are an excellent summary of the capabilities of Org/Babel and worth bookmarking.

I've written before of how enjoyable using Org/Babel for writing papers and organizing projects is. You get all the benefits of reproducible research as well as a pleasant environment in which to work. Babel really is one of the killer features of Org mode even though it's less well known and appreciated than some of Org's other features. If you aren't familiar with it, take a look at Abrams notes and start feeling the power.

Footnotes:

1

Abrams says the notes are a “first draft” and that he will probably post them to Reddit or someplace similar later. Nevertheless, I found the notes reasonably complete and useful even in their preliminary state.

This entry was posted in General and tagged , . Bookmark the permalink.