[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
compiler directives; (was: Re: cheerful static typing (was: Any and Every... (was: Eval)))
This brings up an interesting point. How do people on this list feel about
allowing compiler directives in programming languages? The argument I've
usually heard against them is that they would make the language too
difficult for Joe Average Programmer and thus shouldn't be allowed. OTOH
for more advanced programmers it seems like they would add a lot of power
to the language. I would certainly like to be able to switch from "soft"
to "hard" static typing by changing a compiler directive once I move from
"prototyping" to "production" coding mode.
> Date: Wed, 09 Jan 2002 13:55:23 -0500
> From: Howard Stearns <firstname.lastname@example.org>
> Here's how we provide a choice of optimistic or pessimistic type
> checking in Curl:
> For a call to any operator (including the assignment and return
> operators, and the usual function calls), the compiler checks that the
> representation of each value matches that which is expected:
> 1. Various compiler directives may be used to reject the usage at
> compile time. If a given directive is active, static type declarations
> (e.g., signatures) are used to determine if a corresponding "information
> losing" behavior or error during execution might occur, and the usage is
> rejected. The default settings prohibit an enumerated list of
> "narrowing" conversions. Compiler directives can be specified for a
> lexical-scope or at top-level for a whole package of code.