What is Expressiveness in a Computer Language [off-topic]
David Hopwood
david.nospam.hopwood at blueyonder.co.uk
Mon Jun 26 10:49:12 EDT 2006
Matthias Blume wrote:
> I agree with Bob Harper about safety being language-specific and all
> that. But, with all due respect, I think his characterization of C is
> not accurate.
[...]
> AFAIC, C is C-unsafe by Bob's reasoning.
Agreed.
> Of course, C can be made safe quite easily:
>
> Define a state "undefined" that is considered "safe" and add a
> transition to "undefined" wherever necessary.
I wouldn't say that was "quite easy" at all.
C99 4 #2:
# If a "shall" or "shall not" requirement that appears outside of a constraint
# is violated, the behavior is undefined. Undefined behavior is otherwise
# indicated in this International Standard by the words "undefined behavior"
# *or by the omission of any explicit definition of behavior*. [...]
In other words, to fix C to be a safe language (compatible with Standard C89
or C99), you first have to resolve all the ambiguities in the standard where
the behaviour is *implicitly* undefined. There are a lot of them.
--
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>
More information about the Python-list
mailing list