Jesse Phillips:

> Casting to and from string/char[] is very dangerous, even through 
> assumeUnique. AssumeUnique is intended to be used for returning a mutable as 
> immutable from a function. Casting is often a no-op for the CPU and as you 
> discovered removes any safety provided by the type system.

A more expressive type system (uniqueness annotations, lending, linear types) 
allows to write that code in a safe way, but introduces some new complexities 
too.

The GHC Haskell compiler has some experimental extensions (mostly to its type 
system) disabled on default (you need to add an annotation in your programs to 
switch each extension on), to experiment and debug/engineer ideas like that. I 
presume Walter is too much busy to do this in D, but I'd like something similar.

On the other hand we'll probably have a Phobos package for "experimental" 
standard modules.

Bye,
bearophile

Reply via email to