Re: IL design?

Robert A Duff <>
12 Dec 2006 18:30:45 -0500

          From comp.compilers

Related articles
IL design? (2006-12-11)
Re: IL design? (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2006-12-11)
Re: IL design? (Robert A Duff) (2006-12-12)
Re: IL design? (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2006-12-13)
Re: IL design? (Robert A Duff) (2006-12-14)
Re: IL design? (Russ Cox) (2006-12-14)
Re: IL design? (Robert H) (2006-12-21)
| List of all articles for this month |

From: Robert A Duff <>
Newsgroups: comp.compilers
Date: 12 Dec 2006 18:30:45 -0500
Organization: The World Public Access UNIX, Brookline, MA
References: 06-12-049 06-12-052
Keywords: design, performance, C
Posted-Date: 12 Dec 2006 18:30:45 EST

Jürgen Kahrs <> writes:

> Not joking. C is a portable macro assembly language.

That's what everybody says, but I don't think it's true. I think an
"assembly language" is a language whose semantics are defined in terms
of what code gets generated. The presence of macros and whatnot does
not change this -- even with a macro assembler, the programmer has
complete (or nearly complete) control over the generated code.

A "higher level language" has semantics defined in terms of what the
program does. C is clearly this.

As to using C as the output of a compiler, well it has the advantage
of portability. But C is not really a particularly good language for
this task. There is no way in C to get at the hardware's overflow
detection features. There is no efficient way to implement exception
handlers in terms of C. It is very difficult to create source-level
analysis tools (debuggers and whatnot) if you feed everything through
a C compiler.

I've built compilers that generate C, and it can certainly work, but
it's far from ideal.

- Bob

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.