The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] origin of C header files
@ 2017-12-31  2:32 Doug McIlroy
  0 siblings, 0 replies; 9+ messages in thread
From: Doug McIlroy @ 2017-12-31  2:32 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]

Warning: off-topic info

> I was told once that McIlroy and Morris invented macro instructions
> for assembly language.   And certainly they wrote the definitive
> paper on macros, with, as I recall, something like 10 decisions you
> needed to make about a macro processor and you could generate 1024
> different macro systems that way.  I wonder if that ever got
> published 

The suggestion that I invented macros can also be found on-line, but
it's not true. I learned of macros in 1957 or before. GE had added
a basic macro capability to an assembler; I don't know whether they
invented the idea or borrowed it. In 1959 George Mealy suggested
that Bell Labs install a similar facility in SAP (SHARE assembly
program). Doug Eastwood wrote the definition part and I handled
expansions.

Vic Vyssotsky later asked whether a macro could define a macro--a
neat idea that was obviously useful. When we went to demonstrate
it, we were chagrinned that it didn't work: definition happening
during expansion resulted in colliding calls to a low-level
string-handling subroutine that was not re-entrant. Once that
was fixed, Steve Johnson (as a high-school intern!) observed
that it allowed the macro table to serve as an addressable
memory, for which the store and load operations were MOP
(macro define) and MAC (macro call).

Probably before Steve's bright insight, Eastwood had folded
the separate macro table into the opcode table, and I had
implemented conditional assembly, iteration over a list, and
automatic generation of symbols. These features yielded
a clean Turing-complete language-extension mechanism. I
believe we were the first to achieve this power via macros.
However, with GPM, Christopher Strachey showed you don't need
conditionals; the ability to generate new macro names is
enough. It's conceivable, but unlikely, that this trick
could be done with earlier macro mechanisms.

As for publication, our macroprocessor inspired my CACM
paper, "Macro nstruction extension of compiler languages",
but the note that Steve remembers circulated only in the
Labs. A nontrivial example of our original macros in
action--a Turing machine simulator that ran completely within
the assembler--was reproduced in Peter Wegner's programming
book, so confusingly described that I am glad not to have
been acknowledged as the original author.

Doug


^ permalink raw reply	[flat|nested] 9+ messages in thread
* [TUHS] origin of C header files
@ 2018-01-12  8:44 Lars Brinkhoff
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Brinkhoff @ 2018-01-12  8:44 UTC (permalink / raw)


The book "Expert C Programming" claims Alan Snyder suggested the
addition of a preprocessor.


^ permalink raw reply	[flat|nested] 9+ messages in thread
* [TUHS] origin of C header files
@ 2017-12-29  8:26 Wesley Parish
  2017-12-29 10:58 ` Nigel Williams
  2017-12-29 19:28 ` Paul Winalski
  0 siblings, 2 replies; 9+ messages in thread
From: Wesley Parish @ 2017-12-29  8:26 UTC (permalink / raw)


Hi

I've just had an interesting experience, explaining C header files to
a nephew programmer who didn't understand them. I pointed him in the
direction of Minix as an example of a small well-engineered system
which would display their use.

Which raised the question: when did header files come into use? Who
was the first to use header files to store common system-wide or
application-wide data definitions? Was it used in any languages prior
to C?

Thanks

Wesley Parish


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-01-23  4:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-31  2:32 [TUHS] origin of C header files Doug McIlroy
  -- strict thread matches above, loose matches on Subject: below --
2018-01-12  8:44 Lars Brinkhoff
2017-12-29  8:26 Wesley Parish
2017-12-29 10:58 ` Nigel Williams
2017-12-29 19:28 ` Paul Winalski
2017-12-29 20:31   ` Clem Cole
2017-12-30  1:06     ` Steve Johnson
2017-12-30  1:52       ` Paul Winalski
2018-01-23  4:27         ` Steve Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).