Mailing-List: contact mjd-book-help@plover.com; run by ezmlm
Delivered-To: mailing list mjd-book@plover.com
Received: (qmail 20161 invoked by uid 119); 19 Apr 2000 00:11:59 -0000
Date: 19 Apr 2000 00:11:59 -0000
Message-ID: <20000419001159.20160.qmail@plover.com>
From: mjd@plover.com
To: mjd-book@plover.com
Subject: First chapters of PATH submitted and avaiable online


Hi, folks.  You're getting this message because you subscribed to my
mailing list for announcements concerning my book.  It is not a
discussion list, and I've kept the list address a secret so that
nobody will send mail to the list by accident.  If you want to
unsubscribe, send an empty message to mjd-book-unsubscribe@plover.com.

Here is my second announcement:  Drafts of the first two chapters are
ready.  I've submitted them to MKP, and they are available on the
web.  (URL is below.)

The two chapters are about recursion (chapter I) and dispatch tables
(chapter II).  Note that I've renumbered the chapters; they now start
at I instead of at II.  I don't think I want the book to start by
having chapter I be a big manifesto.  I'll put the manifesto in the
introduction if I'm weak, and in the garbage can if I'm strong.  Gosh,
it sure it fun to write manifestos!  I have a directory with about
four of them already.

I was going to send the chapters last week, but I keep frittering
about whether to add more sections to each one.  I was originally
planning for the recursion chapter to have a discussion of automatic
tail-recursion elimination and manual recursion elimination generally,
and it might still get that before I'm through.  One nice idea I had
didn't pan out: I thought that maybe you could optimize a recursive
function in Perl by using the magical goto-& to turn the recursive
call into a jump.  (I originally wrote `manical' instead of `magical'
by mistake there.)

For example, instead of a recursive function like this:

        sub gcd {
          my ($a, $b) = @_;
          return $b if $a == 0;
          return gcd($b, $b%$a);
        }

you would replace the final line with a goto, like this:

        sub gcd {
          my ($a, $b) = @_;
          return $b if $a == 0;
          @_ = ($b, $b%$a); goto &gcd;
        }

Then when gcd finally gets to return, it returns $b directly to its
caller instead of returning one step up the stack to another gcd that
also has to return; this saves lots of returning.  Unfortunately,
goto-& takes so long that it eats up the gains, which were probably
pretty small anyway.  Oh well, it was an interesting idea.

The dispatch table chapter is also cut a little short.  I want to have
a section in it about state tables, but I'm having trouble selecting a
good example.  Lexing provides a million good example, but I don't
want it to be about lexing because I'm going to cover lexing to death
some time around chapter IX.  Kurt Starsinic had a good suggestion
that escapes me just now, and I might just bite the bullet and show
how to write an NNTP server.  I originally didn't want to, because
that's an awfully big project for chapter II, but at least nobody will
be able to claim that it isn't practical.  

The files on the web site are plain text, and my markup-to-plain-text
generator may have some bugs; please let me know if you discover any.
I think I just realized that I forgot to include a handler for the
footnote tag, so either the footnotes are missing or they're inline.
Oh well, I'll get it worked out.

I decided to go with my own markup language because I need to generate
at the very least HTML (for the web site), plain text (for you), and
something production-quality (for the publisher).  I was originally
planning to use `etex', which is a simple, powerful macro set for
Plain TeX, that I like much better than LaTeX.  But then I reflected
that I had gone to a lot of work to get permission to put the book on
my web site after it was published, and the thought of manually
converting 400 pages of etex to HTML made me wither in dismay.

I decided there was no point in having gotten the permission if I
wasn't going to be able to generate the HTML automatically somehow.
But if you want to generate TeX *and* HTML, you have a very limited
set of options.  I didn't want to use POD, because it's doesn't have a
lot of the stuff I need, like bulleted lists, footnotes,
cross-references, and indexing.  Also, some of the POD converters suck
rocks.  (I am thinking of pod2latex here.)  I looked into using SDF
until I found out that the SDF-to-LaTeX converter works by converting
SDF to POD and then invoking pod2latex.  

So I rolled my own markup language which looks podlike and comes with
its own generic, table-driven translator.  (Details of the translator
might end up in chapter II sometime later.)  Right now it only
converts to plain text.  Is anyone interested in helping me write a
converter that converts to HTML or eTeX or LaTeX?  I'd be grateful and
it wouldn't be that much work.

Anyway, enough yak yak.  The sample chapters are available at

     [ Sorry, draft chapters are available only to mailing list subscribers. 
       Send mail to 
             mjd-book-subscribe@plover.com
       to subscribe.
     ]

You absolutely must not distribute these to anyone else; I'd prefer if
you didn't even copy them off the web site.  I really don't want
copies of my old crappy drafts floating loose around the world.
Thanks.

Please feel free to advertise this list to other people.  In fact, I
wish you would do that.  I want lots of people to be anxiously
awaiting my book.  To subscribe, send an empty note to
mjd-book-subscribe@plover.com.

Thank you all for your interest.  I will send another message next
time something happens.



