The philosophy of literate programming is explained fully in the book
Literate Programming, which also
contains an extensive bibliography of the subject.
More than 30 example CWEB programs can be found in
The Stanford
GraphBase.
And I've made several additional
programs
available for downloading.
Fonte: http://www-cs-staff.Stanford.EDU/~knuth/cweb.html
Página de MAC 328 feita pelo Prof. José Augusto no ano passado. A página deste ano de MAC 328 é praticamente uma cópia da do ano passado.
Página da disciplina Análise de Algoritmos feita pelo Prof. Paulo Feofiloff no 1o. semestre deste
ano. Nesta disciplina foram estudados vários algoritmos em grafos.
Da página da disciplina: MAC 338 é disciplina obrigatória do
currículo do
Bacharelado
em Ciência da Computação da USP.
(Até recentemente, a disciplina era optativa
e seu nome oficial era Introdução à Análise de Algoritmos.)
A disciplina está sob a responsabilidade do
Departamento de Ciência da Computação
do Instituto de Matemática e Estatística
da USP.
Estas páginas contêm
informações sobre a edição 1999
(fevereiro a junho) da disciplina.
This award-winning
book demonstrates the art of literate programming with more than 30
examples. Each example is a programmatic essay: a short story that
can be read and enjoyed by human beings as readily as it can be read
and interpreted by machines. The programs contain state-of-the-art
explanations of many important algorithms and data structures. They
also define a workbench for combinatorial computing, and standard
sets of data that can be used for benchmark tests of competing
methods, as well as demonstration programs and games that make use of
the data.
Hundreds of example programs that use The Stanford GraphBase will be
distributed electronically as supplements to Volume 4 of The Art of
Computer Programming when that volume is available, because Knuth
will be using The Stanford GraphBase for many of the examples in that
book.
Errata. A list of corrections to all known errors in this
book appears in the file ftp://labrea.stanford.edu/pub/sgb/ERRATA.
With these corrections, the book should be error-free. But (sigh) it
probably isn't. Therefore I will gratefully pay $2.56 to the first
person who finds and reports anything that remains technically,
historically, typographically, or politically incorrect. Please send
suggested corrections to sgb@cs.stanford.edu, or
send snail mail to Prof. D. Knuth, Computer Science Department, Gates
Building 4B, Stanford University, Stanford, CA 94305-9045 USA.
CWEB is a version of WEB for documenting C, C++, and Java programs. WEB was adapted to C by Silvio Levy in 1987, and since then both Knuth and Levy have revised and enhanced the system in many ways, notably to support C++ and ANSI C. Thus CWEB combines TeX with today's most widely used professional programming languages.
If you are in the
software industry and do not use CWEB but your
competitors do, your competitors will soon overtake you---and
you'll miss out on a lot of fun besides.
download
the latest version of cweb.tar.gz
Literate programming is a methodology that combines a programming language with a documentation language, thereby making programs more robust, more portable, more easily maintained, and arguably more fun to write than programs that are written only in a high-level language. The main idea is to treat a program as a piece of literature, addressed to human beings rather than to a computer. The program is also viewed as a hypertext document, rather like the World Wide Web. (Indeed, I used the word WEB for this purpose long before CERN grabbed it!) This book is an anthology of essays including my early papers on related topics such as structured programming, as well as the article in The Computer Journal that launched Literate Programming itself. The articles have been revised, extended, and brought up to date.
Literate programming is an approach to programming which emphasises that programs should be written to be read by people as well as compilers. From a purist standpoint, a program could be considered a publishable-quality document that argues mathematically for its own correctness. A different approach is that a program could be a document that teaches programming to the reader through its own example. A more casual approach to literate programming would be that a program should be documented at least well enough that someone could maintain the code properly and make informed changes in a reasonable amount of time without direct help from the author. At the most casual level, a literate program should at least make its own workings plain to the author of the program so that at least the author can easily maintain the code over its lifetime.
I write lots of
CWEB programs, primarily for my own
edification. If there is sufficient interest, I'll make a large subset
of them available via the Internet. For now, I'm listing only a few.
The first two show (by quite different methods) that exactly 2,432,932
knight's tours are unchanged by 180-degree rotation of the chessboard.
The third was used to compute some of the tables in
Axioms and Hulls
that several people have asked about.
The fourth was used in one of my otherwise unpublished lectures in the
Computer Musings series. The next few were
requested by members of the Academy of Recreational Mathmaticians
in Japan. And so on.
Note: Many of my programs, including the first two samples, use
the conventions and library of
The Stanford GraphBase.
LEDA is a library of the data types and algorithms of combinatorial computing.
The main features are: