Reddit: SafeD - The Safe Subset of D

Chris Miller chris at dprogramming.com
Tue Mar 25 04:56:56 PDT 2008


On Sat, 22 Mar 2008 21:47:59 -0700
Walter Bright <newshound1 at digitalmars.com> wrote:

> 
> http://reddit.com/r/programming/info/6d210/comments/

I think this calls for a compiler switch that forces bounds checking on, whether or not debug or release mode. You don't want to be shipping debug code.

Also, a pragma or similar would be helpful; if it could enable bounds-checking from that point until the end of the scope, you could completely rely on bounds checks in your code, like you can do in other modern languages.

Finally, would SafeD have to disallow destructors? If you're accessing garbage collected memory in a destructor, you're asking for trouble. It's not always as simple as directly disallowing access these fields. Calling functions can indirectly cause the memory to be accessed. However, if you're not accessing GC memory in a destructor, you're probably using some lower-level functions, which are generally untrustworthy.

-- 
Chris Miller <chris at dprogramming.com>


More information about the Digitalmars-d-announce mailing list