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
7
votes
1 answer

Has anyone tried literate programming for C#, with Lyx and noweb

I came across this blog post yesterday, and it once again made me want to give literate programming a try. Has anyone else tried doing literate programming for C#? I'm wondering about trying Lyx + noweb, but wondered if you might have other…
Benjol
  • 63,995
  • 54
  • 186
  • 268
7
votes
2 answers

How can I implicitly organize literate code with org-mode?

I'm developing a Stack Exchange mode for Emacs and I'm trying to use literate programming (with org-mode) to organize the project. I'm finding myself repeating a lot of information. I'm taking a (possibly over-) structured approach to the…
Sean Allred
  • 3,558
  • 3
  • 32
  • 71
6
votes
3 answers

How can I retain the initial white space in a line when writing Rd documentation?

In conjunction with trying to find a solution for myself in regards to this question, I find myself plunged into trying to write valid Rd markup. What I want is to add a section named Raw Function Code and put the code of the function under it. …
russellpierce
  • 4,583
  • 2
  • 32
  • 44
6
votes
5 answers

Does any literate programming environment support on the fly results?

I am currently writing lots of small reports. Most of them are just value dumps with some graphs and illustrative comments. Is there a literate programming environment that let's me write my reports in an easy format (preferably markdown/latex and…
fho
  • 6,787
  • 26
  • 71
6
votes
2 answers

Examples on Literate Programming with Racket scribble/lp

In addition to learning Racket I'm trying to learn literate programming. Unfortunately the Racket documentation is sparse to say the least with regards to scribble/lp. Could someone point me to some better resources on this subject or examples of…
ggelfond
  • 321
  • 1
  • 2
  • 5
6
votes
1 answer

noweb style weaving in org-babel

I'm using Emacs 23 with Org 7.8.04. My code structure is as follows: #+TITLE: hello, world! #+BEGIN_SRC python :tangle yes :noweb yes <> if __name__ == "__main__": go() #+END_SRC Define =go_function= as…
5
votes
8 answers

Help on a better way to parses digits from a String in Java

I have a string which contains digits and letters. I wish to split the string into contiguous chunks of digits and contiguous chunks of letters. Consider the String "34A312O5M444123A". I would like to output: ["34", "A", "312", "O", "5", "M",…
Ethan Heilman
  • 16,347
  • 11
  • 61
  • 88
5
votes
0 answers

Agda PDFs with colour

I am using lhs2TeX for my literate Agda files and I'd like them to be syntax highlighted. I know I can achieve some highlighting via %format instructions but that is a bit too much. I have tried using lhs2Tex-hl as instructed at…
Musa Al-hassy
  • 982
  • 1
  • 7
  • 12
5
votes
1 answer

Export code block names in cweb or noweb style?

When writing a literate program in Org mode, exporting is analogous to weaving in earlier literate programming tools such as cweb or noweb. Those tools would add a code block name to the woven (exported) output. In Org mode, it would look something…
user3654344
  • 316
  • 1
  • 5
5
votes
1 answer

Unresolved Links in scribble/lp document

I'm trying to write a small example program in Racket's scribble/lp. The source for the project is on Github. The problem I am experiencing is broken links in the woven html. I've provided it as a gh-page. for the project. When outputting the…
ben rudgers
  • 3,647
  • 2
  • 20
  • 32
5
votes
1 answer

Is there a way to do test-driven development with literate programming?

I'm learning to do my first unit tests with R, and I write my code in R Markdown files to make delivering short research reports easy. At the same time, I would like to test the functions I use in these files to make sure the results are…
bright-star
  • 6,016
  • 6
  • 42
  • 81
5
votes
2 answers

How to use `typed/racket` in `scribble/lp`

Is it possible to use other #langs in #lang scribble/lp for literate programming? For example, I want to use #lang typed/racket in #lang scribble/lp. How to realize that?
Ben
  • 3,612
  • 3
  • 19
  • 24
5
votes
2 answers

Natural Language Programming vs. Literate Programming

I can't see a difference between natural language programming and literate programming. If anyone explains, I would be grateful.
Ersin 101
  • 83
  • 6
5
votes
1 answer

How to set up vim's identation for literate Haskell programming?

When I turn on autoindent for a regular *.hs file, the after pressing Enter the new line is indented as expected. However, this doesn't work with literate Haskell *.lhs files whose code lines start with > (AKA "bird-tracks"). The cursor is always…
Petr
  • 62,528
  • 13
  • 153
  • 317
5
votes
2 answers

How to comment out lines in literate haskell

I am having trouble commenting out lines of code in an lhs-style haskell program, so both haskell and Latex ignore the line. When I use -- then my lh2tex will try to render the haskell code as a comment. But this often fails, because the code…
Martin Drautzburg
  • 5,143
  • 1
  • 27
  • 39
1 2
3
10 11