The Pweb Literate Programming system

What Literate Programming

Literate Programming was invented by D.E. Knuth to implement TeX. The idea is that a program should read like an article.

A literate programming environment also called web-system consist of two programs called tangle and weave.

The tangle program extracts the source code of the web-file and generates an input file for the compiler (interpreter) of our programming language. It must resort the code from the human readable form into the machine readable form.

The weave program generates the input for a text processor. It must apply syntax highlighting to our code and generate an index, etc.

In principle you can use any text processing tool and any computer language as basis for a literate programming environment. In practice the weave and tangle program need some information about the destination language, so a specific literate programming environment support only few languages.

Pweb Design goals

When I started this project, I found that non of the existing literate programming systems satisfies exactly my needs. So I began with the development of a new literate programming tool. I called pweb, since its main part is a bunch of Perl scripts.

I designed pweb with the following goals in mind:

Pweb status

I use pweb for most of my programs and I have already done medium size project in pweb (see for example the population count program, joint work with Y. Edel). So it works, but I consider it still α-status.

Known Limitations


You can download the latest release of pweb here. A manual is here.