Noweb

Noweb

noweb is a free literate programming tool,created in 1989-1999 by Norman Ramsey [http://www.eecs.harvard.edu/~nr/index.html] ,and designed to be simple, easily extensible and language independent.

Like in WEB and CWEBmain components of noweb are two programs:"notangle", which extracts 'machine' source code from the source texts,and "noweave", which produces nicely-formatted printable documentation.

noweb 'out of the box' supports TeX, LaTeX, HTML, and troff back ends and works with any programming language.Besides simplicity this is the main advantage over WEB, whichneeds different versions to support programming languagesother than Pascal.(Thus the necessity of CWEB, which supports C andsimilar languages.)

Noweb's input

A noweb input text contains program source code interleaved with documentation.It consists of so-called "chunks" that areeither "code-chunks" or "documentation-chunks".

It uses LaTeX code for "documentation chunks", but you mayeasily use any form you like.

"Code chunks" aren't treated speciallyby noweb's tools - they may be placed in any orderand when needed, they are just concatenated,chunk-references in code are dereferenced andthe whole requested source code is extracted.

Example of a simple noweb program

This is an example of a hello-world program(s) with documentation:

@ section{Hello world} Today I awakened and decided to write some code, so I started to write a Hello World in extsf C. <>= /* <> */ #include int main(int argc, char *argv [] ) { printf("Hello World! "); return 0; } @ oindent ldots then I did the same in PHP. <>= > */ echo "Hello world! "; ?> @ section{License} Later, same day some lawyer reminded me about licenses. So, here it is: <>= This work is placed in the public domain. @

Assuming that the above code is placed in a file named 'hello.noweb',the command to extract the human-readable document in HTML format is:

noweave -filter l2h -index -html hello.noweb | htmltoc > hello.html

... and in LaTeX format:

noweave -index -latex hello.noweb > hello.tex

To extract machine source code:

notangle -Rhello.c hello.noweb > hello.c

notangle -Rhello.php hello.noweb > hello.php

See also

*WEB
*CWEB

External links

* [http://www.eecs.harvard.edu/~nr/noweb/ Noweb home page]
* [http://www.eecs.harvard.edu/~nr/index.html Norman Ramsey's home page]
* [http://www.cs.virginia.edu/cgi-bin/manpage?section=1&topic=notangle notangle online man page]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • noweb — Original author(s) Norman Ramsey Initial release 1989, 21–22 years ago Stable release 2.11b Written in C Opera …   Wikipedia

  • Noweb — est un outils de programmation lettrée sous licence libre, créé entre 1989 1999 par Norman Ramsey [1]. noweb possède une syntaxe minimale, il est conçu pour être simple, facilement extensible et indépendant du langage de programmation utilisé. Il …   Wikipédia en Français

  • noweb — est un outil de programmation lettrée sous licence libre, créé entre 1989 1999 par Norman Ramsey [1]. noweb possède une syntaxe minimale, il est conçu pour être simple, facilement extensible et indépendant du langage de programmation utilisé. Il… …   Wikipédia en Français

  • Literate programming — is a philosophy of computer programming based on the premise that a computer program should be written similar to literature, with human readability as a primary goal. According to this philosophy, programmers should aim for a ldquo;literate… …   Wikipedia

  • Грамотное программирование — Стиль этой статьи неэнциклопедичен или нарушает нормы русского языка. Статью следует исправить согласно стилистическим правилам Википедии …   Википедия

  • Литературное программирование — или (английский термин намеренно двусмыслен) Грамотное программирование (англ. Literate Programming) концепция, методология программирования и документирования. Термин и саму концепцию разработал Дональд Кнут в 1981 году при разработке системы… …   Википедия

  • Programación literaria — La programación literaria es un paradigma de programación propuesto por Donald Knuth como alternativa al popular paradigma de programación estructurada en la década de 1970.[1] El paradigma de programación literaria, tal y como lo concibió Knuth …   Wikipedia Español

  • CWEB — is a computer programming system created by Donald Knuth and Silvio Levy as a follow up to Knuth s WEB literate programming system, using the C programming language (and to a lesser extent the C++ and Java programming languages) instead of Pascal …   Wikipedia

  • Literate programming — Mit literate programming (engl. mit literarisches Programmieren übersetzbar) bezeichnet man das Schreiben von Computerprogrammen in einer Form, so dass sie vor allem für Menschen lesbar sind. Dies steht im Gegensatz zur konventionellen Ansicht,… …   Deutsch Wikipedia

  • Programmation lettrée — La programmation lettrée (ou programmation littéraire) est une approche de la programmation préconisée par Donald Knuth, qui s est inspiré des travaux de l informaticien belge Pierre Arnoul de Marneffe. « Je crois que le temps est venu pour… …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”