[comp.lang.functional] Is there WEB for SML?

olender@sor.CS.ColoState.Edu (Kurt Olender) (01/03/91)

The title says it all.  Any information on the existence of a WEB
that generates SML code would be appreciated.

lbn@iesd.auc.dk (Lars Bo Nielsen) (01/04/91)

Yes.

But first of all let me tell all of you what WEB is, cause I guess the
next question here will be: What is WEB ? (That was what happened when
I posted my first sml-mode for Emacs two years ago. People wanted to
know what SML was).

This introduction to WEB is taken from the 'CWEB user manual' by
Donald Knuth (A version of WEB for the C programming language):

] The philosophy behind WEB is that an experienced system programmer,
] who wants to provide the best possible documentation of so
ftware
] products, needs two things simultaneously: a language like TeX for
] formatting, and a language like C for programming. Neither type of
] language can provide the best documentation by itself. But when both
] are appropriately combined, we obtain a system that is much more
] useful than either language separately.
] 
] The structure of a software program may be thought of as a ``web''
] that is made up of many interconnected pieces. To document such a
] program, we want to explain each individual part of the web and how it
] relates to its neighbors. The typographic tools provided by TeX give
] us an opportunity to explain the local structure of each part by
] making that structure visible, and the programming tools provided by C
] make it possible for us to specify the algorithms formally and
] unambiguously. By combining the two, we can develop a style of
] programming that maximizes our ability to perceive the structure of a
] complex piece of software, and at the same time the documented
] programs can be mechanically translated into a working software system
] that matches the documentation.
] 
] The WEB system consists of two programs named WEAVE and TANGLE. More
] precisely, CWEB calls them CWEAVE and CTANGLE. When writing a CWEB
] program the user keeps the C code and the documentation in the same
] file, called the WEB file and generally named something.w. The command
] `cweave something' creates an output file something.tex, which can
] then be fed to TeX, yielding a ``pretty printed'' version of
] something.w that correctly handles typographic details like page
] layout and the use of indentation, italics, boldface, and mathematical
] symbols. The typeset output also includes extensive cross-index
] information that is gathered automatically.  Similarly, if you run the
] command `ctangle something' you will get a C file something.c, with
] can then be compiled to yield executable code.

If you substitute `C' in the previous quote with `SML', this is also
what a WEB for SML will be.

In my PhD work I have been programming a lot in SML, so I needed a
tool like WEB to document my SML code. I had been using WEB for C
(CWEB) a lot, and really like this way of structured/documented
programming.

Then I was told about a system called spider-web (developed by: Norman
Ramsey, nr@princeton.edu). This system allows one to make a WEB system
for any programming language. You *only* have to write a kind of
parser for the programming language.

I a couple of days I had my first running (buggy!) version of WEB for
SML running. I have worked a bit more on it from time to time. It
still needs a bit of fine tuning, but works fairly well.

I had planned to tell this group about it when it was more stabile,
and I had written some documentation, but now that Kurt Olender brings
up the subject...

What you need to get WEB for SML running:

	- Spider-web (get it from your favorite ftp cite).

	- My definition file for SML.

So, please drop me a letter if you would like to hack and be part of
the development of SMLWEB, and I will post you the definition file I
have now (as is).

When the joint efforts get a stabile WEB system running for SML, I
will post it to this group.

---
 Lars Bo Nielsen @ Aalborg University - Denmark
 lbn@iesd.auc.dk  -**-  {...}!uunet.iesd.auc.dk!lbn
---