On 06/05/2011 3:53 AM, Marijn Haverbeke wrote:
That might be even hairier, though.
Not necessarily. Eloquent JavaScript chapters are actually literate
programs that can be automatically extracted and run, without doing
any violence to the flow of the text. It'll be a bit harder to do this
in a static language, but certainly possible.
Yeah. I hope there is some sweet spot we can get to by exploring blends
of integrated unit-test harness and inline documentation, a la
doctest[1]. I'd be happy to see the compiler (or a next-to-the-compiler
tool shipping standard with the compiler) grow this capability, perhaps
as a natural extension of a scribble[2]-like "documentation-oriented
grammar" for expressions? Not sure. Worth trying a few things though.
As for "straight" literate programming a la web/noweb, I feel it's a bit
too documentation-orthodox for my programmer mentality; I explore a
problem by writing the code, primarily, and have a hard time coming at a
problem doing "documentation first". It's easier for me to do a
post-coding "narration" through the code, a la codenar[3].
-Graydon
[1] http://docs.python.org/library/doctest.html
[2] http://docs.racket-lang.org/scribble/index.html
[3] http://orenbenkiki.github.com/codnar/
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev