Another opportunity for a major design win has presented itself

bearophile bearophileHUGS at lycos.com
Thu Feb 7 12:37:39 PST 2013


Walter Bright:

> (b) improve language safety without degrading efficiency

This request is a bit too much vague. Please explain better what 
do you mean.

(And in what cases? Maybe just in release mode, or in all kinds 
of releases?)

There are many different ways to do this. Some of them need type 
system improvements (region analysis, removing some undefined 
situations, introducing a bit of flow analysis, introduce 
not-nullables, etc), some other of them ask for some kind of 
static analysis tool inside all the distributions of D compilers. 
Implementing a good library-defined Typedef (that the compiler is 
able to optimize away as much as possible) is a simple but useful 
improvement. In some cases safety comes from improving parts of 
D, like improving its Contracts, like this:

http://d.puremagic.com/issues/show_bug.cgi?id=9454

Or adding the "old" (pre-state) to contracts, to make them more 
usable. Other ways to do it is to add a bit of analysis to be 
able to remove some array bound in non-release builds.

If the request of not "degrading efficiency" is meant only in 
release mode, then there are many more ways to do it without 
making the type system more complex.

General rule to keep in mind: if you accept no degraded 
efficiency then you need a more complex&refined type system, that 
usually is also more fussy and less easy to use.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list