I use CWEB for C, not C++, so take the following comments with a grain of
salt or two.
mikolas <
mikolas...@gmail.com> writes:
>1) Tool support is not great. Emacs does not give me syntax highlighting an=
>d altogether seems to be acting as a plain text editor. VI is a little bett=
>er but still, word completion's not great.
CWEB has a cweb mode that you can install and use. It is commented with
some explanation of how one uses it, but fundamentally I think it is
more of a TeX mode than a C/C++ mode. I have never been a big user of
word completion, so I cannot comment there. I also use NEdit most of the
time, or ed(1), and not Vi or Emacs. I have a custom set of highlightings
that I use for CWEB + C in NEdit that works quite well.
>2) Introducing "@s" directives for every type is very annoying (I'm also n=
>ot sure how to reuse these directives between different files) .
I do not know how it works for C++, but most of the types declared in
a C based CWEB document do not require @s directives. I only need @s
directives if I refer to a type long before I typedef it or the like.
Otherwise, my types get formatted correctly.
>3) Imports of the form "using bar::foo" are not typeset correctly.
You may be able to use @s or another control code to set how you
want those forms typeset.
>5) I'm quite unclear on how one goes about bundling up a bigger project. I'=
>m putting each clause in a different ".w" file and eventually I will end up=
> with a bunch of documents with no inter-linkage.
Most of the time I stick to putting most things into a single file. But
this is C code. For example, usually, I have a one executable/shared library
per file organization. You can use the @i code to break these out into
separate pieces if you find that having the one large file difficult to
navigate, though I find bookmarks or other jump points, and the PDF
enough to manage that.
You may also want to look at the @( code, which allows sending to
multiple files. I usually use it only for auxiliary files like header
files, and not main files, but you may find it suitable for auxiliary
class files or the like.
You can also use some TeX macro hackery to take files that would normally
weave into separate documents and combine them together into a single
document, once you understand the TeX output by CWEB. I've not needed to
do this before, but I am sure that it can be done.
>6) A meta-complaint. The lack of proper support makes me very suspicious ab=
>out the number of people using the tools/approach.
I suspect that most literate programming tools do not see nearly the use
of something like, say, JavaDocs, but you're also assuming that most people
would want "tool support" in the way you are talking. CWEB is a mostly
frozen program (like TeX), barring large and unforeseen bugs. However, it
is quite stable and usable. I use it in conjunction with my own ChezWEB on
mostly all my projects. It's a good tool, but it's design and its users
are likely more text editor hacker types; I know I am. I don't use large
IDEs most of the time, or extra features like word completion (though
I sometimes use some other macros to call up man pages or something
equivalent).
Knuth's own workflow is, I believe, an Emacs buffer in cweb.el mode, so
at least that is somewhat how the system was designed, but that is also
for a C workflow. I don't know how good CWEB is at handling C++ features.
You can checkout the Stanford GraphBase for an example of a set of multiple
files that correspond to multiple features in C. I am not aware of a good
example of CWEB use in C++; maybe someone else can recommend something?
--
Aaron W. Hsu |
arc...@sacrideo.us |
http://www.sacrideo.us
Programming is just another word for the lost art of thinking.