mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-02 01:20:54 +00:00
23 lines
1.2 KiB
Plaintext
23 lines
1.2 KiB
Plaintext
Literate programming has been introduced by D. E. Knuth in 1984. The
|
|
main idea is to put the code and its documentation in the same file
|
|
and to produce from it a document which is readable by a human, and
|
|
not only by a machine. Although ocamlweb borrows a lot of ideas from
|
|
Knuth's original tool (called WEB), there are big differences between
|
|
them. First, WEB allows you to present the pieces of your code in any
|
|
order, and this is quite useful when using poorly structured
|
|
languages, like Pascal or C. But Objective Caml is already highly
|
|
structured, and this is no more useful. Moreover, WEB requires the use
|
|
of a tool to produce the code from the WEB file, which greatly
|
|
complicates the use of your favorite source-based tools (dependencies
|
|
generator, debugger, emacs mode, etc.). When using ocamlweb, the
|
|
documentation is inserted in the code as comments (in the Caml sense),
|
|
and your code is not linked to the existence of ocamlweb in any way.
|
|
|
|
Currently, the task of ocamlweb may be seen as:
|
|
|
|
1. making a nice document with the code and its documentation;
|
|
2. generating a global index of cross-references, where each identifier
|
|
is associated to the lists of sections where it is defined or used.
|
|
|
|
WWW: http://www.lri.fr/~filliatr/ocamlweb/
|