News for hackers. Stuff that matters.
Re:Abstraction without overhead: traits in Rust by dragonwriter on Monday May 11, 2015 @04:32PM (#9527654)
> So why not use "interface" keyword?

They aren't really interfaces. They can be like interfaces (just method signatures) or like classes without data (including definitions for some or all methods). Using a name distinct from either "class" or "interface" limits the degree to which incorrect expectations from similar-but-critically-different constructs in other language interfere with understanding of the Rust construct.

Re:Abstraction without overhead: traits in Rust by seanmcdirmid on Monday May 11, 2015 @05:03PM (#9527832)
Traits as defined in scala can actually have state and data.
Re:Abstraction without overhead: traits in Rust by Ygg2 on Monday May 11, 2015 @05:23PM (#9527951)
Do Scala's traits change behavior depending on order of definition?

That scares me tbh.

Re:Abstraction without overhead: traits in Rust by seanmcdirmid on Monday May 11, 2015 @05:40PM (#9528038)
There are ways to fix that, but I could never get Martin interested in my exclusive inheritance proposals. In particular, only one trait should be allowed to "implement" an abstract method in an object, although typical overriding is still unrestricted. It does require a new keyword (implement vs. override). As for overriding, traits could be ordered globally based on extension relationships and other fixed markers (e.g. Names).
Re:Abstraction without overhead: traits in Rust by lmm on Tuesday May 12, 2015 @07:40AM (#9530950)
Depending on order of inheritance? Yes. And yes, it should scare you (though IME problems are rare and are obvious when they do occur). I love Scala but it's very much a language of awkward compromises.