I always thought M4 was named with the “M” for “macro” and the “4” for being the fourth in a series of macro processors for UNIX. I thought this even though I wasn’t aware of any prior programs named M3, M2, M1, or M, or whatever this initial version would have been called. I’m not the only one to think this,1 and I wanted to know, is this folklore or fact?
So, let’s investigate if (1) the “M” in “M4” does stand for “macro”, and if (2) the “4” in “M4” is for being the fourth in a series of macro processors. Like any serious inquiry, let us begin with Wikipedia; the M4 entry says:2
[M4] is an extension of an earlier macro processor [M3], written by [D.M. Ritchie] for an unknown AP-3 minicomputer.3
In [the] 1960s,6 an early general‐purpose macro processor [M6] was in use at AT&T Bell Laboratories[…]
However, this statement does not place M6 anywhere within the chronology of M4 predecessors. M6 simply existed as an early macro processor at Bell Laboratories but otherwise appears disconnected from M4 and M3 lineage.
The existence of an early macro processor named M6 does not fit the M4, M3, M2, and M narrative. In order to answer our two questions we must dig into the histories and influences behind M4 and each M4 predecessor recursively.
But uncovering all influences is impractical. Some influences exist only in the social sphere of the authors at the time and place the software was written and would require an extensive investigation to determine. Our search will be limited to stated influences only, and consequently reduce the scope of research. The term “stated influences” refers to the influences explicitly stated by the principal authors, irrespective of where the claim was made—in technical reports, mailing lists, books, memoirs, interviews, or anywhere else. We are assuming that stated influences have greater bearing over naming, at least in the cases where program names are increments of prior major versions—as seems to be the case with M4 and its immediate predecessor, M3. If the validity of this assumption does not hold then uncovering stated influences still serves as a starting point for further investigation.
The M4 macro processor is an extension of a macro processor called M3 which was written by D. M. Ritchie for the AP-3 minicomputer[…]
This is the source for the paraphrased sentence in the M4 Wikipedia entry.9
Little is known about M3. We do know D. M. Ritchie was the principal author of M3.8 We do not know if M3 was written in C—as M4 and many other programs by D. M. Ritchie. No known record of why D. M. Ritchie wrote M3 exists. No known record of exactly when D. M. Ritchie wrote M3 exists. No known record of who owned the AP-3 minicomputer exists.10 We don’t know if the “3” in “M3” is for being the third in a series of macro processors, or if it stood for “AP-3”, or something else.
Continuing onward, we uncover M3’s stated influence:8
[…] M3 was in turn based on a macro processor implemented for [the book Software Tools]
From Software Tools, we can see that M3 was based on the macro processor detailed in chapter 8, “Macro Processing”.11 The authors, B. W. Kernighan and P. J. Plauger, refer to this macro processor as macro.12
Interestingly, on the last page of chapter 8, B. W. Kernighan and P. J. Plauger write:13
The macro processor described in this chapter was originally designed and implemented in the language C by D. M. Ritchie; we are grateful to him for letting us steal it.
Thus, macro’s stated influence is another macro processor by D. M. Ritchie. Little is known about this macro processor. No known record of this macro processor exists beyond this single sentence in Software Tools. We don’t even know this macro processor’s name. I refer to D. M. Ritchie’s pre-macro macro processor as macro' (pronounced macro-prime). Since there is no known record detailing the stated influences of macro', we cannot recursively trace M4 and its predecessors’s stated influences any further. We do not know the stated influences of macro'—it may state M6, it may state several influences, or it may state no influences at all.
As we’ve traced M4’s stated influences this far, I think we have sufficient evidence to substantiate at least one claim: the “M” in “M4” likely stands for “macro”. We can claim this with a reasonable level of confidence since these programs process macros as their primary mode of operation, and because the M4 predecessor implemented in Software Tools has the name “macro”.
However, I don’t think the available evidence supports the claim that the “4” in “M4” is for being the fourth in a series of macro processors for UNIX. As we’ve traced the stated influences from M4 to M3 to macro then to macro', we count four macro processors in this series. It is tempting to conclude that these four macro processors make up the entirety of the series, but we know almost nothing of M3 and macro'. Moreover, if these four macro processors make up the series, then we exclude the earlier Bell Labs macro processor, M6, with deep similarities to M4.
Rather, the available evidence leads to the idea that the “4” in “M4” follows a progressional naming pattern similar to that of the C programming language. The names of both languages—C and M4—are increments of prior major versions. “C” is an increment of its predecessor’s name, “B”.14 However, B does not have a predecessor named A.15 The progressional naming pattern started with C. Likewise, the name “M4” is an increment of its predecessor’s name, “M3”, and M3 does not have a predecessor named M2. The progressional naming pattern started with M4.
Thanks to Andrew Healey <https: