[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: compiler directives; (was: Re: cheerful static typing (was: Any and Every... (was: Eval)))
Guy Steele wrote:
> Let me suggest (with a sly grin) that the distinction between
> language construct and compiler directive is exactly as crisp
> as the distinction between language and library.
Sneaky! But there are some aspects here that can be defined fairly crisply,
aren't there? The crisp ones are correspondingly easy to categorize:
The purest compiler directive is one which affects the compilation process
without affecting the generated code at all: for example, setting the
warning level.
A less pure compiler directive can affect the compiled code, but without
affecting its meaning; for example, optimizations relating to size or speed
of the generated code.
I assume the above corresponds more or less to Dorai's pragmas/flags. Am I
wrong that these distinctions can be drawn crisply?
Anything other than these seems pretty fuzzy, since if a compiler directive
is allowed to (substantially?) affect the meaning of the generated program,
then macros and type declarations especially, but ultimately any program
statement, can be called a compiler directive, which is unhelpful. At this
level, a compiler directive is in the eye of the beholder (or language
designer).
Actually, it seems to me the operative distinction here is that between code
and data: a program is data for a compiler; a compiler could be said to be
"executing" some parts of the code during compilation, and translating other
parts; etc. No wonder it's fuzzy.
Anton