| From: | Stephen Cross |
| Date: | 1 Apr 1993 |
| From: | Lee Wittenberg |
| Date: | 2 Apr 1993 |
It's a nice approach, but it isn't exactly "tangling," as the latter involves rearranging the code chunks from an human ordering (the sections in a web are supposed to be organized in a way that is easy for the human reader to grasp) into a machine ordering (something a compiler can accept). Your approach has the advantage of being able to interleave code and documentation, but it has the disadvantage that the code must still be presented in an order dictated by the machine. (cf. Dijkstra's "... I want the program written down as I can understand it, I want it written down as I would like to explain it to someone." ["Notes on Structured Programming", in "Structured_Programming", Academic Press, 1972]).
| From: | Sriram Srinivasan |
| Date: | 25 Oct 1993 |
I can achieve the same using FrameMaker or most other word processing tools, which allow you to tag paragraph types. So, I can have a paragraph template called "Code", that identifies the Code sections. Now, I can intermix graphics, tables, all kinds of formatting like automatic line numbering, cross-referencing, indexes etc. What I see on the screen is the final output, uncluttered by meta-information. Separating the code from the chaff is very easy, once a Frame file is converted to a MIF file (an awk script is given below). The $(10^6) question: is this idea worth exploring further? I would dearly like your comments on this subject. I am absolutely new to literate programming, and haven't read much beyond the FAQ, and some examples. I would think this can be achieved in say, Word for windows etc. which can save to an RTF format.
BEGIN {
code = 0
}
/<PgfTag \`Code\'/ {
code = 1
next
}
/<PgfTag/ {
code = 0
next
}
(code == 1) && /^ *<String \`/{
# Ignore all other paragraph formats, and get only strings from
# Code formats.
# Need to strip this, for example ..
# <String `printf (\xd2 Hello World\\n\xd3);'>
# Strip junk in front
sub(/^[ ]*<String `/,"")
# Trailing junk
sub(/'>$/,"")
# Convert smart quotes to standard quotes
sub(/\\xd2/,"\"")
sub(/\\xd3/,"\"")
print
next
}
| From: | Charles Bass |
| Date: | 25 Oct 1993 |
| From: | Ralph Johnson |
| Date: | 25 Oct 1993 |
| From: | Lee Wittenberg |
| Date: | 26 Oct 1993 |
I can achieve the same using FrameMaker or most other word processing tools, which allow you to tag paragraph types. So, I can have a paragraph template called "Code", that identifies the Code sections. Now, I can intermix graphics, tables, all kinds of formatting like automatic line numbering, cross-referencing, indexes etc. What I see on the screen is the final output, uncluttered by meta-information. Separating the code from the chaff is very easy, once a Frame file is converted to a MIF file (an awk script is given below). The $(10^6) question: is this idea worth exploring further? I would dearly like your comments on this subject. I am absolutely new to literate programming, and haven't read much beyond the FAQ, and some examples. I would think this can be achieved in say, Word for windows etc. which can save to an RTF format.
Actually, what you propose is precisely the way WinWordWEB works, except that it uses internal Word macros instead of saving an RTF file. The idea of a CODE style paragraph that tools can recognize (and tangle and weave, as desired) seems to be the way to go. I recommend you forge on ahead. A lot of people have expressed interest in a FrameMaker-based literate programming tool.
| From: | Sven Utcke |
| Date: | 26 Oct 1993 |
Well, my pet concept is missing: the possibility to write the code in any order I could dream off.
I certainly like the idea. Although I am unlikely to ever use it myself (I am hooked on LaTeX and wouldn't even consider using one of nowadays WYSIWYG-formatter --- the output is much to ugly), it seems to be a good way to introduce more people to the concept of literate programming. If only the "chunk"-concept would be used (but that can't be so difficult). On the other hand: Isn't that what CLiP is doing?
| From: | Bob Collins |
| Date: | 27 Oct 1993 |
FrameMaker also has an easy to use book concept with multiple chapters. This is the most logical way to break up a large document. FrameMaker will maintain and regenerate all sorts of links across documents. No need to write obscure macros. No need to modify these macros. FrameMaker allows all sorts of tagging (invisible to the eye but denoted in the bottom margin) of paragraphs and text. Uses of these can be so that lists can be generated and text extracted. This is how one can an automatic cross-reference and make it a hypertext cross-reference. There will no need to use cryptic marks in the text to indicate special things (like the continuation of the body of a code fragment. Use tags and a special typographic standard. Use variables to say "continued." All of these are easily feasible.
Sven Utcke objects that he would no longer be able to write code in an arbitrary fashion. Well, he may have misunderstood Sriram Srinivasan who claimed that with almost no effort one can use FrameMaker for literate programming. [Indeed, using conditional text for code, within FrameMaker one can view just the code using a simple dialog box. This requires no work at all.] Don't forget that the Knuth system involves running programs to put code fragments together in the correct order. One can also write a program to do a similar thing to MIF output of FrameMaker documents. MIF is Maker Interchange Format, a TeX- or RTF- like marked ASCII text.
I have been reading this group for some time. I agree with all those who say the biggest drawback to literate programming is learning a new language -- TeX. TeX, written in the late 70's and popularized in the 80's is very much a 60's product in its interface. Granted it does things that were not done in the 60's. But it sure feels like JCL. Knuth, a wise and witty man, is a hacker at heart. He thinks obscurely and at a low level. He chooses low-level assembly language to describe algorithms. I cannot figure out how he has such a delightful sense of humor and an assembly language mentality. We seem to apotheosize the one person who least practices the things that make literate programming such a nice idea. [Knuth reminds me of a story (apocryphal?) about John von Neumann. At a party von Neumann was asked the puzzle: two trains 100 miles apart are approaching each other at 50 mph. A bumblebee, starting at one train, travels between trains at 25 mph, reversing directions when reaching an approaching train. How far does the bumblebee travel before being crushed? von Neumann thought a short moment and promptly answered 25 miles. When asked if he knew the trick, he acted puzzled and said that he summed the infinite series.]
The only advantages of TeX that I know of are that it does mathematical typesetting nicely and it's free. FrameMaker does mathematical typesetting sufficiently well for literate programming.
| From: | Sriram Srinivasan |
| Date: | 27 Oct 1993 |
[ FrameMaker plug deleted ....] I have been reading this group for some time. I agree with all those who say the biggest drawback to literate programming is learning a new language -- TeX. TeX, written in the late 70's and popularized in the 80's is very much a 60's product in its interface.
You can say this again!
Now, for the downside of using Frame, or any other word processor. Note that I am definitely not in favor of TeX still. 1) Speed of development - I am a power Emacs/Vi user, and Frame or WFW simply doesn't cut it in terms of development speed. 2) All my text processing tools can't be used - egrep, class browsers, awk, sed, sdiff, tags, and a zillion others. I managed to fix my mifToCode script to generate the correct line numbers, so that GDB isn't confused - but you see the point - I now have to worry about issues that weren't in text-land. 3) SCCS isn't very happy either. Have to move my stuff over to RCS, to be able to check in or out stuff. Either that, or have to convert all files to MIF before using SCCS. 4) Integrating this with other code in a production development environment seems to be a pain (I tried). (Other code - stuff already developed). 5) Using TeX and remaining in text-mode is a concept I find very painful. I do not want to think formatting when I am into development. Bob Collins has already said all I would have wanted to.
I guess I need a powerful argument for undergoing these hassles, especially the development cycle speed, before I really change my ways. Practically, how does it payback? Does it result in fewer edit/compile/run cycles? Has anyone used it for projects that have, say, 2 million lines of code, and has to be pushed out, say, yesterday? (Someone other than Knuth, that is!) Meanwhile, I convinced one of my friends to use my scripts and paragraph formats for a book he's working on. At the very least, we can test out the code that is going into the book by extracting all of it and compiling it. He's not completely in favor of doing development inside Frame yet.
| From: | Joachim Schrod |
| Date: | 28 Oct 1993 |
How? Simple: he's a scientist. How do you do exact analysis of run-time behavior without an exact notion of the cost of basic operations? Give me the answer, and then we can see if we can get rid of MIX. BTW, Vol. 4 won't have MIX any more.
How do you edit your FrameMaker documents on more than 40 different operating systems, ranging from 8086 PCs to Crays? How do you use FrameMaker in a convenient way as a background system? How do you use many languages? (Remember: Not everyone writes in English...) Don't get me wrong: FrameMaker is surely one of the better commercial systems around -- but your evaluation of the differences between TeX and FrameMaker is not even.
| From: | Mark Friedman |
| Date: | 28 Oct 1993 |
I will add 2 even "lower-end" systems to the editing list --- I often take notes & revise drafts on an ancient Tandy T102 (not even MS-DOS, but it can spit out ASCII), and I have 3 daughters (ages 11 to 18) that "share" an 80286 to (La)TeX documents created on a trio of (also ancient) Apple ]['s. The point, of course is quite simple --- if it can produce ASCII output, anything can be used for entry & editing.
As for the oft cited difficulty of learning LaTeX, my daughters have done all their school reports since 3rd grade as well as lots of other "documents" (my 15 year old produces Girl Scout troop meeting minutes, plans & budgets), in English, French, German, Spanish and even ASL (American Sign Language --- a one-off report using a wonderful `hands' METAFONT file). Overkill? Absolutely, but they happen to love it (they're even more critical of sloppy or ugly documents that I am, and I thought I was the perfectionist in the family). It has also led to various amusing incidents, like when my oldest was in 7th grade her English teacher stated that there was "only one right way to format a bibliography". Allyson's response was to take my copy of the Chicago Manual of Style to school, along with about a dozen versions of her assignment's bibliography, all formatted by different .bst styles, and ask which one was the "right" one...
| From: | Bob Collins |
| Date: | 29 Oct 1993 |
FrameMaker is available on all the major platforms that can support it, that is, that have sufficient power and memory and that allow bitmap displays. This means most Unix systems, Macs, and MS Windows. Don't blame FrameMaker if it doesn't work on an AT. One cannot have its power for free. TeX is a filter -- all it does is translate from one form to another, like a compiler. Therefore it needs far fewer resources. FrameMaker integrates what TeX does, what your favorite editor does, what previewers do, what drawing programs do, and what dvi2lp utilities do. Face it -- how many of you wished that you could edit your preview when you found some error that you overlooked? How many of you preview on an 8086?
FrameMaker (on Unix) has both a macro system and a batch system. Both allow background processing. [In a silly moment I might ask, how do you allow foreground processing of TeX commands while you edit?]
Last I checked, FrameMaker is available in 11 languages. (12, if you separate American English and Proper English.) This support is available in the dictionaries, thesaurus, system variables (like dates), and numbering schemes.
One can import text into FrameMaker. FrameMaker will even get rid of extraneous spaces and turn straight quote marks into curly ones while it imports (if you want). In addition, FrameMaker supports MML import. MML stands for Maker Mark-up Language and is a SGML-like form for typographic conventions. So your kids can edit their instructions in their text, read it into FrameMaker, and then edit the preview-like display.
Well, Mr. Friedman has a smart set of kids. I congratulate them and him. I have my own set of computer-literate kid stories, and I will be pleased to share them. I wish all children had entire to computer-wise parents and equipment at the earliest age. It would help me as a university professor. [My favorite kid story is how my son, when 5, learned how to use a paint program by memorizing what the menus did. He could not read, but he knew the alphabet.]
However, I have gone through the hassle of trying to help graduate students try to write using LaTeX. The learning curve is steep. In fact, some of our faculty couldn't figure out how to get rid of a space before a grammar production in our comprehensive examination question list. The number of macros (written by different folks) confused the issue. The smartest people can get turned off by TeX. Is literate programming closed to them?
Let's get serious, however. For those who know, TeX works great. Just like punch cards for editing. However, most people found interactive editing much easier. And those who were used to punch cards sometimes found it difficult or unnecessary to change. And they were right. You can do anything you want with a punch card. Make a wish list for literate programming. Don't worry about how it can be accomplished, or how the typesetting is done. I think that most of us would like to edit the finished product rather than the marked-up product. [I would like to do it by voice, e.g., Bob Collins: Show me the code fragment for the input loop. Computer: Did you mean code fragment or chunk?] At the least, this means interactive TeX. Let's aim for that. Meanwhile, I think that FrameMaker offers a reasonable alternative. These are my final words. Flame on.
| From: | Jim Rudolf |
| Date: | 29 Oct 1993 |
Personally, I think using FrameMaker is a good idea, but not necessarily by editing in FrameMaker. We are just a bunch of programmers who use vi and work fast in it. We want to be able to document our code too, and embedding the doc in the source code (keeping in mind the readability of the source for us programmers, of course) means we are more likely to update the doc when we update the code. Our solution was to write a couple Perl scripts to do documentation generation for us. One script scans the source file for a few keywords that can describe the entire module or individual procedures. Once all the info for a file is collected, another set of scripts will create a file either in man page or MML format. The two formats are quite different, as the man page format is used internally, and the MML format is used to make a FrameMaker book for customers. Other back-end scripts could easily be written when needed. We've found this to be a good combination for us. Has anyone else had any experience (good or otherwise) with this approach?
| From: | Michael Koopman |
| Date: | 29 Oct 1993 |
I don't believe you'll see an uprising from your comments on TeX. I have not heard anyone pining over the punch card machine nor against an interactive TeX editor/previewer. The TeX hacks promote the capability, portability and succinctness of the language. Whether or not FrameMaker is as clever as TeX seems somewhat irrelevant. If you want a FrameMaker web then what qualities of the web are critical and which of these 'requirements' are met by FrameMaker and not met by TeX. That is, why does literate programming in FrameMaker detract from literate programming in TeX? Does FrameMaker read TeX input, or more importantly, can FrameMaker read a CWEB, FWEB, etc. web and not munge it beyond recognition? Let's not hack each other up in religious wars over the "right" editor or typesetting mechanism. Let's focus on the benefits and needed improvements in the literate programming techniques at hand, instead. Peace be with the Literati.
| From: | Osman Buyukisik |
| Date: | 29 Oct 1993 |
| From: | Uttam Narsu |
| Date: | 7 Apr 1994 |
The FAQ mentions two tools that would almost be useful: CLiP and WordWeb. Alas, CLiP is written in ISO Pascal, which is useless to me since I don't have a Pascal compiler for my SGI. WordWeb is completely dependent on Microsoft Word, so no help there. As a last resort, if anyone knows of any filters between TeX and Frame MIF files, that would be helpful.
| From: | Jacob Nielsen |
| Date: | 7 Apr 1994 |
Some time back, there was someone who had done literate programming using FrameMaker, anyone got that posting?. In the meantime take a look at nuweb. You can tell nuweb to only produce the code files and not output the documentation. The downside is that you have to look at scraps like this in the FrameMaker document:
@o test.c
@{
@<Include files for the test@>
@<Defines for the test@>
@<All the rest...@>
@}
If you can save the FrameMaker document, so that you have text like this, you should be home free using nuweb.
| From: | Sriram Srinivasan |
| Date: | 9 Apr 1994 |
BEGIN {
code = 0
}
/<PgfTag \`Code\'/ {
code = 1
next
}
/<PgfTag/ {
code = 0
next
}
(code == 1) && /^ *<String \`/{
# Ignore all other paragraph formats, and get only strings from
# Code formats.
# Need to strip this, for example ..
# <String `printf (\xd2 Hello World\\n\xd3);'>
# Strip junk in front
sub(/^[ ]*<String `/,"")
# Trailing junk
sub(/'>$/,"")
# Convert smart quotes to standard quotes
sub(/\\xd2/,"\"")
sub(/\\xd3/,"\"")
print
next
}
4. If you want pieces of code to go to different files, one can always have a special paragraph type ("File") that identifies a specific file type.
| From: | William Clodius |
| Date: | 18 Oct 1994 |
| From: | Eric van Ammers |
| Date: | 25 Oct 1994 |