www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - "Avoid a Void" paper

reply bearophile <bearophileHUGS lycos.com> writes:
I've just found and read a paper, probably about one year old,
"Avoid a Void: The eradication of null dereferencing",
by Bertrand Meyer, Alexander Kogtenkov and Emmanuel Stapf:
http://se.ethz.ch/~meyer/publications/hoare/void-safety.pdf

The paper is about the introduction of void safety in a language that so far
has had void references on default. Having D2 missed the boat of a void-safety
design from the start, if it will want to become void-safe it will need to
transition as Eiffel will do. Such transition is a little painful, but in
theory it seems doable.


From the article:

This observation suggests a software design guideline: confine void references
to specific parts of a system, largely preserving the application-oriented
layers from having to worry about the issues discussed in this article. It also
confirms our expectation that the conversion of typical user applications will
require significantly less effort than our initial experiences, which involved
system-level libraries.<

So the allow void references/pointers in "system" modules, for example to represent the end of a linked list. While "safe" modules that contain most of the application code can be void-safe. This is a good compromise (but a high performance video game written in D risks having a higher percentage of "system" modules). Bye, bearophile
Mar 30 2010
parent reply BCS <none anon.com> writes:
Hello bearophile,

 So the allow void references/pointers in "system" modules, for example
 to represent the end of a linked list.

"void" == "null" or "void" == "pointer to untyped date" ??? -- ... <IXOYE><
Mar 30 2010
parent bearophile <bearophileHUGS lycos.com> writes:
BCS:
 So the allow void references/pointers in "system" modules, for example
 to represent the end of a linked list.

or "void" == "pointer to untyped date"

You are right, I am sorry for the little confusion. In Eiffel the D null is named "void". Bye, bearophile
Mar 30 2010