rust reaction to walter's talk on interfacing to C++

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 22 04:10:32 PDT 2016


On Tuesday, 22 March 2016 at 11:00:44 UTC, Jonathan M Davis wrote:
> we could pull it off), but whatever flaws D's const may have, 
> the transitivity is a huge plus overall IMHO, and I would have 
> said that the struct/class split was a huge win. It properly 
> segregates the inheritance stuff to reference types while not 
> forcing all user-defined types of any complexity to be 
> reference types.

Well, it could have been a win if structs were more restricted 
and acted like non-referenced types (pure functional values 
without identity, just like a CPU register) + if classes were put 
on the stack (or many objects were allocated as a group) by the 
compiler as an optimization.

The problem is that D is trying hard to be like C/C++ in terms of 
low-level semantics, and then just about all the advantages are 
lost.

> So, while I'm quite sure that Rust has advantages over D, I 
> would not have listed those among them.

The big win for Rust would be some of the basic semantics and the 
aliasing guarantees for their "unique_ptr" system. Rust can 
potentially support better optimization and better correctness 
guarantees than C++/D.

But Rust needs a faster compiler, since the Rust feature set 
matters more for large projects...



More information about the Digitalmars-d mailing list