m4-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prehistory of m4


From: Paul Eggert
Subject: Re: prehistory of m4
Date: Wed, 14 Nov 2012 18:01:42 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

Prof. McIlroy, thanks for your email dated May 30 about m4's prehistory
<http://lists.gnu.org/archive/html/m4-discuss/2012-05/msg00004.html>.
Sorry I didn't get to it earlier; I just now ran across it.

I wrote up a patch to the m4 manual and installed it into
the GNU repository (branch-1.4), where I expect it will eventually
make its way into the next GNU m4 release.  In the patch I couldn't
resist citing your 1960 paper on the topic, so I threw that in too.
It's not often that I can refer to pioneering papers with numbers
as low as CACM volume 3 and CSTR #2!

The revised text is below; please let me know of any corrections
or further improvements.  Hope you don't mind the texinfo markup;
I can send the processed output if you prefer.  The full patch
can be found at
<http://git.savannah.gnu.org/cgit/m4.git/commit/?h=branch-1.4&id=d4017710b79aef691f1eb04f438ec7fe1b5cfc50>.

And thanks again.

===

Macro languages were invented early in the history of computing.  In the
1950s Alan Perlis suggested that the macro language be independent of the
language being processed.  Techniques such as conditional and recursive
macros, and using macros to define other macros, were described by Doug
McIlroy of Bell Labs in ``Macro Instruction Extensions of Compiler
Languages'', @emph{Communications of the ACM} 3, 4 (1960), 214--20,
@url{http://dx.doi.org/10.1145/367177.367223}.

An important precursor of @code{m4} was GPM; see C. Strachey,
@c The title uses lower case and has no space between "macro" and "generator".
``A general purpose macrogenerator'', @emph{Computer Journal} 8, 3
(1965), 225--41, @url{http://dx.doi.org/10.1093/comjnl/8.3.225}.  GPM is
also succinctly described in David Gries's book @emph{Compiler
Construction for Digital Computers}, Wiley (1971).  Strachey was a
brilliant programmer: GPM fit into 250 machine instructions!

Inspired by GPM while visiting Strachey's Lab in 1968, McIlroy wrote a
model preprocessor in that fit into a page of Snobol 3 code, and McIlroy
and Robert Morris developed a series of further models at Bell Labs.
Andrew D. Hall followed up with M6, a general purpose macro processor
used to port the Fortran source code of the Altran computer algebra
system; see Hall's ``The M6 Macro Processor'', Computing Science
Technical Report #2, Bell Labs (1972),
@url{http://cm.bell-labs.com/cm/cs/cstr/2.pdf}.  M6's source code
consisted of about 600 Fortran statements.  Its name was the first of
the @code{m4} line.

The Brian Kernighan and P.J. Plauger book @emph{Software Tools},
Addison-Wesley (1976), describes and implements a Unix
macro-processor language, which inspired Dennis Ritchie to write
@code{m3}, a macro processor for the AP-3 minicomputer.

Kernighan and Ritchie then joined forces to develop the original
@code{m4}, described in ``The M4 Macro Processor'', Bell Laboratories
(1977), @url{http://wolfram.schneider.org/bsd/7thEdManVol2/m4/m4.pdf}.
It had only 21 builtin macros.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]