Fine, make me a blog

It's a blog, okay?
Follow What I Follow | My Book Reviews | About Me | Tweets

Aug 9

Planned Obsolesence

Donald Knuth, Ivan Sutherland, and Alan Kay have each made major contributions to programming.

Knuth: Literate Programming

Sutherland: Sketchpad

Kay: Object-Oriented Programming

I believe all three of these ideas are ready for an overhaul.

Start with Literate Programming, as it is the easiest to criticize in its current form.  Literate programming has not seen much, if any, radical innovation since Donald Knuth introduced the concept.

Literate Programming State-of-the-Art Limitations

Most literate programming tools, such as CWEB, are built for non-interactive programming languages such as C.  Programmers using languages such as C typically do not have an interactive interpretter that allows them to practice programming the way a painist practices for a concert.  A piano key provides immediate feedback, whereas a C edit-compile-debug cycle does not.

Innovations to CWEB do not try to make the programmer’s environment more interactive.  Instead, innovations focus on adding hooks for other languages.  In fact, most of the discussion on the USENET comp.programming.literate discussion group involves asking how to add support for an additional programming language to the literate programming tool.  As a result, the literate programming movement has been stuck in the incubator phase since its inception.

In my analysis, all literate programming tools have an interactivity barrier.  The primary culprit of this barrier is the use of TEX or LATEX for the document formatting portion of the toolchain.  Although TEX and LATEX are exceptional at formatting documents, they are batch processing tools.  There are What You See Is What You Mean (WYSIWYM) interactive LATEX editors for various platforms, but their behavior is still fundamentally monolithic, batch processing.  For example, a programmer cannot instaneously navigate to different sections of the document.

A much more interesting example of rich interaction would be basing documentation off of real-world examples, or driver programs.  Current TEX/LATEX-based LP tools cannot do this, because these tools have not abandoned the Knuth model of LP:

A CWEB document has two concurrent structures, a document structure and a program structure. The basic building block of the document structure, the bricks that build up our document, are called chunks. We use chunks to present one point of our work to our reader, the presentation has both informal (explanation) and formal parts (code). This is the essence of Literate Programming, that we tell each point twice, once on an abstract and once on a technical level.

A chunk consists of three parts: (1) the documentation part, (2) the definition part, and (3) the program part. Each of these parts can be empty. The documentation part is mostly text with LaTEX tags. In this text material from restricted program mode can appear. The definition part consists of a series of either macro or format definitions. The program part is one piece of a refinement, identified by a name.

Joachim Schrod, The cweb Class

Knuth coined the terms WEB, TANGLE, and WEAVE to describe the three main concepts in LP (Michael A. Guravage, page 2).

I’m suggesting that WEAVING is broken by design.  A friend of mine pointed out that some researchers are arguing that WEAVING outside of Literate Programming is an anti-pattern, although their argument is not fully fleshed out yet.  Essentially, these researchers feel the major problem with Aspect-Oriented Programming is that aspects are weaved.  Thus, they are looking at different ways to compose aspects.  The ideal answer here is that aspects should not be based on a black-box code generation model, because you cannot make programming more expressive and powerful while standing in the Turing tar pit.  Some researchers, like Dina Goldin and Peter Wegner, are proposing interactive models of computation for more powerful programming models, but there are no mainstream programming environments to date based on this approach.

Bottom line: WEB, TANGLE, and WEAVE is a throwback to the day when “coders” were punch card operators responsible for doing things that we had not yet imagined how to get computers capable of automating.