Literate programming tool for any language

https://news.ycombinator.com/rss Hits: 11
Summary

Literate What is Literate programming? Literate programming is a style of programming invented by Donald Knuth, where the main idea is that a program's source code is made primarily to be read and understood by other people, and secondarily to be executed by the computer. This frees the programmer from the structure of a program imposed by the computer and means that the programmer can develop programs in the order of the flow of their thoughts. A Literate program generally consists of explanation of the code in a natural language such as English, interspersed with snippets of code to be executed. This means that Literate programs are very easy to understand and share, as all the code is well explained. Literate is a tool for creating literate programs. The goal of this project is to create a literate programming tool which keeps most, if not all of the features of Knuth and Levy's original CWEB system, but simplifies the system and adds even more features. You can view the main website about Literate here including a manual on how to use Literate. Features Supports any language including syntax highlighting and pretty printing in HTML Markdown based -- very easy to read and write Literate source. Reports syntax errors back from the compiler to the right line in the literate source Generates readable and commented code in the target language (the generated code is usable by others) Supports TeX equations with $ notation. notation. Literate source code is readable whether you are looking at the .lit file, or the generated HTML. file, or the generated HTML. Highly customizable (you can add your own HTML or CSS) Runs fast -- wc.lit compiled for me in 7ms for both code and HTML output Automatically generates hyperlinks between code sections Formatted output similar to CWEB Supported by micro (by default) Compatible with Vim (literate.vim) Example Here is a trivial example of a literate program saved in the file hello.lit . For a full example of a literate program, pleas...

First seen: 2025-06-19 23:21

Last seen: 2025-06-20 09:23