[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)))

> From: "Christopher Barber" <cbarber@curl.com>
> Date: Wed, 9 Jan 2002 16:57:54 -0500
> Content-Type: text/plain;
> 	charset="US-ASCII"
> X-Priority: 3 (Normal)
> X-MSMail-Priority: Normal
> Importance: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
> Sender: owner-ll1-discuss@ai.mit.edu
> Precedence: bulk
> > Michael Vanier wrote:
> >
> > > This brings up an interesting point.  How do people on this
> > list feel about
> > > allowing compiler directives in programming languages?
> >
> > Isn't every expression in a program a compiler directive?
> No.  The term "compiler directive" refers to meta instructions to the
> compiler that may affect how it works in some way, but aren't officially
> part of the program (although a directive might be required for a program to
> compile, link or run properly).  Typical examples are directives that enable
> or disable compilation errors or warnings, affect how code is generated, and
> so on.  Some languages allow compiler directives to be specified in the
> code.  Others force you to specify directives in the development
> environment, for example as command line flags.
> - Christopher

FWIW, python has been resolutely against compiler directives from a
philosophical point but now has them in the form of "from __future__ import
X" features which overload the import mechanism to provide new features
that are being phased in.  In this case it absolutely *does* affect the
language semantics, the notion being that it's a nice way to transition
from old, broken semantics to new, unbroken semantics.  Examples include
lexical scoping and proper integer division.  However, my idea of compiler
directives is more in line with the Curl approach.  Changing the semantics
effectively means making a new language, which may be worthwhile in some
circumstances as well but is much more radical (imagine if scheme had a
"lazy evaluation" compiler directive...).