RE: Issues with literate programming DSSSL Script

Subject: RE: Issues with literate programming DSSSL Script
From: "Frank A. Christoph" <christo@xxxxxxxxxxxxxxxxxx>
Date: Wed, 29 Dec 1999 09:59:19 +0900
> Quoting Wroth, Mark <MARK.WROTH@xxxxxxxxxxx>:
> > If I correctly understand what Javadoc does, LaTeX has a mode
> like this also
> > (called 'doc'), intended for documenting LaTeX class and style
> files.  But
> > unless I'm missing something, it does not have a mechanism for
> re-ordering
> > the input in the "tangle" phase (which is essentially
> non-existent with this
> > approach).  With some languages this is not a serious problem
> (DSSSL, for
> > example). But I would have thought that it was an issue for Java.
> >
>    I'm not that familiar with the formal details of literate
> programming, per se, so what, exactly, is the "tangle" phase all
> about?
>    I can't imagine why you'd want a literate programming system to
> re-order anything in your code, particularly in Java.  *shrug*

I don't remember the syntax for it exactly, but for example if you want
abstract out a subroutine, or present a series of datatype declarations when
you would need "forward declarations":

  @<< build a whatsit and foo the bar >>=
  whatsit bar = buildMyWhatsit();
  foo(bar); // foo that bastard!
  @

  @<< main procedure >>=
  int main(void) {
    initialize();
    << build a whatsit and foo the bar >>
    finalize();
  }
  @

Most modern languages don't really need chunk reordering, (each block above
is called a chunk; an ordering of chunks is called a ribbon) but Knuth was
way ahead of his time, and needed to do real work with stone age tools. He
also used WEB to do things like macros and source versioning (via so-called
change files). Don't forget TeX was originally written in Pascal...!

--FAC


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread