Week 5 of @rustlang:
Rust's native typeclasses/trait are easier to understand than Scala's implicit based typeclasses.
Rust is a smaller language than Scala or C++.
Maybe OOP classes generate a lot of language complexity.
Rust's learning curve is steep but short.
So far ...
:D
-
-
Replying to @Sami_Badawi @rustlang
yeah if you try to understand the reasoning behind the decisions of the language, it is gets easier
1 reply 0 retweets 1 like -
The OOP class is one of the most used and tested tools that programmers have. Classes work well. I panicked when I needed a class in Rust and it was not there. A day later I didn't miss classes. I still don't understand the complexity vs. utility trade off for the OOP class
2 replies 1 retweet 3 likes -
I've started to miss abstract classes when recently needing to specialize large base structs. Neither creating similar copies nor composing sub-structs with the common fields feel as elegant ...but, that's about the only OOP-longing I've had so far.
2 replies 0 retweets 0 likes -
Well you are still thinking of rust from an oop perspective. you can look at traits to perform a similar role.
1 reply 0 retweets 0 likes -
Well, in this case I'm doing it for structures for serialization so traits won't help. The trait system also needs serious work, really looking forward to trait returns without boxed trait objects, and maybe someday multi-trait inheritance without intermittent subtrait.
1 reply 0 retweets 0 likes -
Traits/interfaces is a place where dynamic runtimes have an advantage - they know what impls are loaded at runtime and do static dispatch if only single impl is used, so making code testable by using traits everywhere is free. Hopefully impl trait RFC can get Rust closer to that.
2 replies 0 retweets 0 likes -
there is a dynamic dispatch method right?
1 reply 0 retweets 0 likes -
fn foo<T: Trait>(t: T) is static fn foo(t: Box<T>) is dynamic
2 replies 0 retweets 0 likes -
Is that: fn foo(x: Box<Trait>){}?
1 reply 0 retweets 1 like
Yes, oops! Thanks 
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.