> In article <j6jp2c$fq4$1...@labrador.cs.tufts.edu>,
> Aaron W. Hsu <arc...@sacrideo.us> wrote:
>>Does anyone have examples of large literate programs other than TeX and
>>Metafont? Specifically ones that are available to be read?
>>
>> Aaron W. Hsu
>>
>>--
>>Programming is just another word for the Lost Art of Thinking.
>
> See the libadt source, written using literate techniques:
> http://adtinfo.org/index.html.
It's a large book but I'm not sure that it's a large program.
There's less than 25,000 lines of code and some of that is
mechanically generated by macro substitution.
--
"[Modern] war is waged by each ruling group against its own subjects,
and the object of the war is not to make or prevent conquests of territory,
but to keep the structure of society intact."
--George Orwell, _1984_
> arn...@skeeve.com (Aharon Robbins) writes:
>
>> In article <j6jp2c$fq4$1...@labrador.cs.tufts.edu>,
>> Aaron W. Hsu <arc...@sacrideo.us> wrote:
>>> Does anyone have examples of large literate programs other than TeX and
>>> Metafont? Specifically ones that are available to be read?
>>>
>>> Aaron W. Hsu
>>>
>>> --
>>> Programming is just another word for the Lost Art of Thinking.
>>
>> See the libadt source, written using literate techniques:
>> http://adtinfo.org/index.html.
>
> It's a large book but I'm not sure that it's a large program.
> There's less than 25,000 lines of code and some of that is
> mechanically generated by macro substitution.
I've never actually counted, but how many lines of code is TeX?
> It's a large book but I'm not sure that it's a large program.
> There's less than 25,000 lines of code and some of that is
> mechanically generated by macro substitution.
Answering my own question, the tangled source for TeX seems to be around
7000 lines of compressed Pascal? I imagine that if it were written
normally that would be closer to 8000 or 9000. My ChezWEB LP system is
about 45 pages of woven output, and about 700 lines of formatted Scheme
code. That seems to line up with the line count to page ratio in TeX, too.
This leads me to conclude that, theoretically, the largest TeX programs
are in the range of 10,000 to 30,000 lines of code, which would be
considered a large program by normal standards, too, I think, but wouldn't
be anywhere close to the really large programs. I just heard about a
system the other day that had about 15,000 or 20,000 lines of code in it
that actually generated about 150,000 lines of Java code as the end
product. Even that is lower than other programs of which I know have
500,000+ lines of code.
Extrapolating this out, if my math is correct, that means that such a
program might reasonably be a 35,000+ page book! That's an order of
magnitude larger than some of the largest books in print that I know of.
That's just mind-bogglingly big. The real question is, could such a task
be managed successfully? Could one reasonably scale literate programming
to this magnitude? Would you want to? Would it be better than the systems
already in place around such large projects?
>> See the libadt source, written using literate techniques:
>> http://adtinfo.org/index.html.
(I should be referencing the original artcle but my newsreader can't
find it, sorry)
This is from 'Reading the Code':
A TexiWEB document is a C program that has been cut into sections,
rearranged, and annotated, with the goal to make the program as a
whole as comprehensible as possible to a reader who starts at the
beginning and reads the entire program in order.
Do people in general find that LP is a way of documenting a program that
has already been (designed and) implemented rather than part of the
process of designing the program? I'd (naively) hoped for the latter!
This was my 1st literate program: http://home.scarlet.be/asld0009/Lisp/sal.pdf
It's 180 pages of pdf. The use of the literate paradigm has made the
program actually useful and the longevity increased considerably as a
result. The client considers it "bug-free" practically since
delivery. I would say that the use of the literate paradigm was
hugely beneficial to me the writer as well as the client, the user.
The program has run nearly continuously for 5 years now...
I hope this helps someone!
Ciao,
Bob
Sorry, I didn't see any body for this message other than quotes?
> Do people in general find that LP is a way of documenting a program that
> has already been (designed and) implemented rather than part of the
> process of designing the program? I'd (naively) hoped for the latter!
I almost always do a significant part of the writing with the programming.
That is, I see them as mutually beneficial. In this sense, it's part of
designing. However, I always attempt to gain some sort of grasp on the
concept and design before I just randomly sit down to program. Sometimes I
experiment with ideas, but in those cases, I'm usually encoding that
thought process into my program anways, at the documentation level.
So, I use it for both. What I don't ever do is start with a piece of
program text that I've just finished writing, and then think, "Now I'll
fill out the documentation." I might do this with some piece of
non-literate code that I have inherited, but whenever I start a program
from scratch, the prose and code grow together, and never separately.
> This was my 1st literate program:
> http://home.scarlet.be/asld0009/Lisp/sal.pdf
> It's 180 pages of pdf. The use of the literate paradigm has made the
> program actually useful and the longevity increased considerably as a
> result. The client considers it "bug-free" practically since
> delivery. I would say that the use of the literate paradigm was
> hugely beneficial to me the writer as well as the client, the user.
> The program has run nearly continuously for 5 years now...
Interesting stuff. It's nice to find other LP projects around.
Hi,
see the Axiom algebra system (written in Noweb):
http://en.wikipedia.org/wiki/Axiom_%28computer_algebra_system%29
Palo
[quoting what I wrote in the libavl book]
> This is from 'Reading the Code':
>
> A TexiWEB document is a C program that has been cut into sections,
> rearranged, and annotated, with the goal to make the program as a
> whole as comprehensible as possible to a reader who starts at the
> beginning and reads the entire program in order.
>
> Do people in general find that LP is a way of documenting a program that
> has already been (designed and) implemented rather than part of the
> process of designing the program? I'd (naively) hoped for the latter!
Maybe advanced practitioners do it the way that you prefer, but
I'm too used to the way that I already write code, and so I wrote
libavl the other way. Also, the libavl book was an evolution of
an existing library that had already been written in the ordinary
way, so it was natural to me to write it that way.
I was also implementing the TexiWEB language in parallel with
writing libavl with it.
--
Ben Pfaff
http://benpfaff.org
Thanks for the info.
I implemented one project by design-first; it was an Ada control package
over a C driver for a radar/graphics card, and it was really helpful to
have the mathematics, the C headers and glue, and the matching Ada
declarations in the same source document, not just for me as the
implementer but (I hope!) for the rest of the team.
The current project is much more like yours, for the same reasons. I'm
hoping that even it I'm not doing it "right" I'm at least going to end
up with a better product!