Am Mon, 21 Sep 2015 19:32:21 +0000
schrieb Ola Fosheim Grøstad <ola.fosheim.grostad+dl...@gmail.com>:
> On Monday, 21 September 2015 at 18:28:19 UTC, jmh530 wrote:
> > My understanding is that the key benefit of Rust's system is
> > that compile time checks don't have the runtime costs of smart
> > pointers.
> + aliasing information.
> If the compiler can prove that two pointers point to
> non-overlapping memory regions then the compiler can optimize
> better. This is one of the reasons why Fortran compilers managed
> to do better than C for a long time.
Unfortunately we have even weaker optimizations than C regarding
aliasing information. There's code in druntime and phobos which breaks C
aliasing rules (usually pointer type casts) and this caused real issues
on ARM systems with GDC. As the D spec doesn't state anything about
aliasing we simply disable strict aliasing rules. I guess there's also
lots of D user code which isn't compatible with strict aliasing rules.