Re: The D Programming Language
Andrei Alexandrescu (See Website For Email) wrote:
James Kanze wrote:
AJ wrote:
One other serious legacy flaw in D (inherited from C/C++) is that it
doesn't do away with undefined behavior. It's close, I think, but it's
unfortunate that the holes aren't closed entirely.
No language manages to completely do away with undefined
behavior. Although C++ could surely do better in this regard;
there's a lot of unnecessary undefined behavior.
(Late in the thread, but this cannot be let slip away.) Whatever
happened to all languages that do manage to completely do away with
undefined behavior?
Name one. I'm unaware of any.
I'm asking this again: it would be best if we all refrained from "I'll
qualify it on-demand" statements.
Well, I suppose that if you exclude support for threading, it
might be possible. But as far as I know, no language even comes
close. If nothing else, most older languages don't define the
case of insufficient ressources---some dialects of Lisp, for
example, say that in case of overflow in integral arithmetic,
they switch to an extended format, but they don't say what
happens when the extended format gets too big to fit in memory.
And most modern languages support threads, and I'm fairly
convinced that it is currently impossible to support threads
without undefined behavior---it would mean being able to
statically diagnose thread-safety.
And of course, any language which tries to support low level
programming must have some sort of undefined behavior, in order
to allow the language to access the machine itself. Ideally,
such places should be clearly marked---unsafe modules in the
Modula family, reinterpret_cast in C++ (but of course, C++
doesn't impose the use of reinterpret_cast to get undefined
behavior).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]