Questions tagged [literate-programming]

A literate program embeds source code in an essay documenting the program.

Literate programming was introduced by Donald Knuth as an alternative to the structured programming. Literate programming encourages programmers to structure their programs by the flow of their thoughts, i.e., in a way that makes it easy to present and document.

158 questions
46
votes
7 answers

What's the best way to do literate programming in Python on Windows?

I've been playing with various ways of doing literate programming in Python. I like noweb, but I have two main problems with it: first, it is hard to build on Windows, where I spend about half my development time; and second, it requires me to…
JasonFruit
  • 7,764
  • 5
  • 46
  • 61
41
votes
2 answers

Literate Haskell (.lhs) and Haddock

At the moment I'm only using Haddock but after seeing some really interesting examples (e.g. this gist) of literate Haskell, I'm interested in trying it out in a project. The questions I got, are: What do you write as Haddock comments and what do…
finnsson
  • 4,037
  • 2
  • 35
  • 44
34
votes
4 answers

State of the Art for Clojure Documentation Tools

Over the last year or so I've seen various announcements on the Clojure discussion list and other places about tools for documenting Clojure code. These range from full-on literate programming systems like Marginalia, and the tool being used to…
rplevy
  • 5,393
  • 3
  • 32
  • 31
29
votes
11 answers

Sweave for python

I've recently started using Sweave* for creating reports of analyses run with R, and am now looking to do the same with my python scripts. I've found references to embedding python in Sweave docs, but that seems like a bit of a hack. Has anyone…
pufferfish
  • 16,651
  • 15
  • 56
  • 65
28
votes
5 answers

How do PStricks and TikZ compare for ease of learning and for quality of API design?

My group uses Literate Programming for most of our source code---this means that internal documentation is written using LaTeX. We have been using PStricks for fancy technical diagrams of the system, but have recently been recommended to use TikZ. …
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
21
votes
2 answers

How to escape % in roxygen literate programming?

The default value of a parameter of my function contains a "%". This seems to be a problem for roxygen, it produces a lot of warnings and R CMD check fails when trying to build latex documentation. How can I make this function (and its…
Karsten W.
  • 17,826
  • 11
  • 69
  • 103
19
votes
4 answers

How to set up org-babel for Haskell with Stack

I'm running: GNU Emacs 24.4.1 Stack Version 1.3.3 org-mode haskell-mode I've looked through: Emacs Org-Mode & Literate…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
18
votes
9 answers

Scaling Literate Programming?

Greetings. I have been looking at Literate Programming a bit now, and I do like the idea behind it: you basically write a little paper about your code and write down as much of the design decisions, the code probably surrounding the module, the…
Tetha
  • 4,826
  • 1
  • 16
  • 17
17
votes
1 answer

LHS and Markdown: Codeblocks

I happen to really like Markdown (probably because of SO) and I like programming in Haskell. I have recently discovered Literate Haskell (LHS) and I want to use Markdown and LHS together. Let me give you this dumb example: Crazy Literate…
Robert Massaioli
  • 13,379
  • 7
  • 57
  • 73
16
votes
1 answer

Literate Programming using org-babel

I am on a literate program using org-babel. My source is structured like so, -imports -utility fns -game structure - detailed explanations This is the normal structure of the code, what I would like to do is move explanations of the utility fns to…
Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241
16
votes
1 answer

Is literate programming in Haskell really "literate programming"?

I'm new to the concept of literate programming. I was reading Donald Knuth's paper (PDF) concerning this subject, and in the very beginning, in the Introduction, he says: Instead of imagining that our main task is to instruct a computer what to do,…
J. A. Corbal
  • 936
  • 9
  • 20
15
votes
1 answer

Literate Haskell: References And Indexing

Does Literate Haskell support indexing function names, typeclasses and variable references? Is there a filter I can run on Literate Haskell source that will do this and give me either a nice PDF manual or a hyperlinked HTML document. These are a…
Deech
  • 2,223
  • 15
  • 20
15
votes
4 answers

How to autogenerate API documentation from Express route mappings?

I am developing a REST API in nodejs + Express and I have been simultaneously documenting my API in the README file and I was wondering if it is possible to automate it. e.g. given: app.get('/path/to',…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
14
votes
7 answers

Use of Vertical Whitespace

My intention in this question is not to be pedantic, but rather to explore an overlooked axis of an important topic (the use of whitespace). Much debate and care has been put into the use of horizontal whitespace, indenting after a conditional, a…
Ethan Heilman
  • 16,347
  • 11
  • 61
  • 88
13
votes
2 answers

Why does Knuth use this clunky decrement?

I'm looking at some of Prof. Don Knuth's code, written in CWEB that is converted to C. A specific example is dlx1.w, available from Knuth's website At one stage, the .len value of a struct nd[cc] is decremented, and it is done in a clunky way: …
Ed Wynn
  • 295
  • 1
  • 8
1
2 3
10 11