Rant after trying Rust a bit

Bienlein via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 26 04:20:00 PDT 2015


>>I think the ability to express an interface without buying into 
>>inheritance is the >>right move. The alternative in D is 
>>specifying the behavior as a template and >>verifying the 
>>contract in a unittest for the type.

>>Rust only has structs. I'm not as familiar with them so it's 
>>not as clear how they >>overlap with D's structs and classes. 
>>It seems like you can put Rust structs on the >>stack or heap.

What some people call "interface inheritance" in Rust is not 
inheritance in the sense of OOP whewre an inherited method can be 
overwritten. Rust is here the same as Go. Some people sometimes 
get confused and don't see that without the possibility of 
overwriting an inherited method delegation applies and not 
inheritance. This is also explained in this blog: 
http://objectscape.blogspot.de/search/label/Go See the section 
titled "Inheritance".

-- Bienlein


More information about the Digitalmars-d mailing list