M6 Macro Processor

In the historical references section of the M4 macro preprocessor, it says

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), 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 m4 line.

* emphasis added

The link has gone stale, but a copy of the report can be found here: http://highgate.comm.sfu.ca/pups/Documentation/TechReports/Bell_Labs/CSTRs/2.pdf (pdf, 7.3 MB)

A UNIX man page can be found here: http://squoze.net/UNIX/v5man/man6/m6.pdf (pdf, 3.5 KB)

A discussion on the Unix Heritage Society Mail List can be found here: [TUHS] History of m6? - Arnold Robbins

A note about the naming of M6 has been published by Chris Thornton: https://bitsbelow.us/p/7youil5f9/m6-naming-speculation@a4.pdf (pdf, 137 KB)

Is anyone aware of where could one find the original FORTRAN source?

*Apologies for the non-clickable links. As a new user I can use two links in a post.

1 Like

Nice finds! I’ve fixed up your links.

Edit: it looks like the V2 Unix sources should contain the M6 sources:

What distinguishes M6 from the rest is that it was shipped as a part of V2 UNIX.

From your link

Thanks for the fixed links and the tip.

I found a M6 source tree as part of the V6 UNIX here: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/m6. It is however already (re-)written in C.

The V3 UNIX contains an early man page: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man1/m6.1


In the Unix Heritage Society Mail List, I caught someone mention the original purpose of M6 was for porting the ALTRAN.

In the article introducing ALTRAN, Andrew D. Hall writes:

A macro processor called M6 [8] is included as a part of the ALTRAN system. This processor is written in the FORTRAN subset discussed above. The ALTRAN translator, interpreter and the FORTRAN part of the library are written in a machine independent macro extension of this subset, When these modules are processed by M6, the output is pure FORTRAN (in the subset), but is no longer machine independent. About 5 to 15 macro definitions must be supplied separately for each installation.

1 Like