Turns out Emacs' org-babel allows literate programming a la tangle and weave. Worth playing with this weekend (: