-
Notifications
You must be signed in to change notification settings - Fork 2
/
ARNOLD
155 lines (113 loc) · 5.6 KB
/
ARNOLD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Things to read to learn about the internal pipeline and the Hackers' Guide
The nwbuffer.nw and nwbuffer-lua.nw modules. The implementation of
nwbuffer.nw is not too important, but the interface is.
The ipipe.nw and ipipe-lua.nw interfaces.
In my current doc.nw these are sections 5, 6, 8, 9, and 12.
Possibly the xpipe.nw and mpipe.nw interfaces. Sections 15, 21,
22.1, 23.1, 24.1, 25.1. The function MPipe_open in chunk 139b.
lua/stripconds.nw
lua/xchunks.nw
This should probably be enough lua, but if you have appetite for
more, try function Stages.elideuse in lua/elide.nw
It may also be worth looking at one of the back ends, e.g.,
notangle lua/tohtml.nw | less
not for the details but to see the overall structure (case statement
inside loop).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Guide to the ultimate structure of the noweb 3 distribution
Outputs directories with defaults:
LIB /usr/local/noweb/lib external stages and Lua scripts
BIN /usr/local/noweb/bin executable binaries (e.g., no, htmltoc)
MAN /usr/local/noweb/man man-page hierarchy
TEXINPUTS /usr/share/texmf/tex/latex/local place for noweb.sty, nwmac.tex
ELISP /dev/null place for emacs lisp files
I'd like your opinion about whether to have a single LIB directory for
both external pipeline stages and Lua scripts. My inclination is yes.
Most of these directories will contain what they contain under noweb 2,
so I haven't answered your request for a list. Instead, I'll just ask
you to install noweb 2 in a pristine place and you can see for yourself
what files go where. Below I've given considerable play to the
differences in noweb 3.
Here's also a considerable discussion of the sources.
I'd like your opinion about whether it's a good idea to replicate the
structure of the Noweb 2 distribution, which was two layers with src
below dist, or whether dist and src should be flattened into a single
directory.
The stuff in dist in v2 is
binaries Pre-built binaries
contrib contributed software
examples examples
src the source code
What's in the v3 src dir is
lua-2.5+nw Lua-2.5+nw, a modified Lua 2.5 (from PUC-Rio, Brasil)
cii CII, from Dave Hanson, stripped down to Noweb's needs only.
c C source code for Noweb
lua Lua source code for Noweb commands and pipeline stages
nocond A filter to help build Noweb 3 from sources.
xdoc Documentation, especially the revised Hacker's Guide
Makefile Top-level Makefile.
nwconfig Configuration information (directories and such)
Directories c and lua contain .nw files. The distribution will have
to contain the derived sources, much as is done in the `make tar'
target in Noweb 2.
A student worked on nwconfig. Please see if some of those targets
(e.g., POSIX, POPEN) can be removed, perhaps by making suitable
adjustments in sources elsewhere. Also please note missing variables
from the Noweb 2 Makefile.
The following Makefile targets are needed:
all build everything
install install everything
install-* install some things
source Builds derived sources
tar build tar file for distribution
tarnames compute names that go in distribution
www Puts documentation and examples in my web directory
clean Removes unwanted files but keeps derived sources
clobber Removes unwanted files *and* derived sources -- need
noweb to rebuild
touch update timestamps
versioncheck support checking of proper version number in docs and sources
emacscheck make sure emacs lisp is consistent with my personal edits
nwsrcfilter build tool to rearrange distribution
FAQ.html copy the FAQ from my web directory (I know this is insane)
FAQ build the ascii FAQ
Makefile generate Makefile
DATE rebuilds DATE with the current version and date
checkin --- obsolete and should be removed ---
The work of installation should change considerably in version 3:
Regarding binaries:
* weave and tangle are now in lua
* web, defs, and roots should be ported to lua
* untangle and cpif are obsolete and won't be in v3
* nuweb2noweb probably needs to be rewritten in Lua
* htmltoc stays
Regarding filters in lib:
* port to lua if not ported already: btdefn, emptydefn, unmarkup
* port to lua: nwmtime (will require a bit of C code), pipedocs
* unclear: h2a (port if sensible for pipedocs)
* delay porting as low priority: toascii.nw
The lib directory should go away eventually.
Regarding filters in awk:
* Not sure if noindex is ported: if not, it needs to be.
* Other filters are ported.
The awk directory should go away.
Regarding filters in Icon:
* A few have been ported to Lua. The others will stay.
In particular it seems unlikely that the *defs filters
or l2h will ever be ported.
N.B. pipedocs pipes document chunks, *as* *source*, through a shell
command. Writing it in Lua should speed it up considerably---a
consummation most devoutly to be wished. The conversion guide needs
to explain how pipedocs is used with docs2comments to replace
nountangle.
no weave -filter 'docs2comments -ml' -filter 'pipedocs "sl2h | h2a"'
might do it.
About the external filters callable from the command line: we probably
need a `no filter' script to run internal filters as external ones.
The old external filters should be replaced by one-line scripts as
appropriate. E.g., markup might become
#!/bin/sh
case $# in
0) exec no filter Stages.markup ;;
*) exec no filter Stages.markup "$@" ;;
esac