by margorczynski · 9y ago · 0 comments
Also - any plans for Streaming?
I'm a big Scala user and fan (Haskell of course too) and would like to try out Rust but I really don't see myself going back to structural/object oriented-programming
[1]: http://smallcultfollowing.com/babysteps/blog/2016/11/02/asso...
[2]: https://github.com/rust-lang/rfcs/pull/1598
[3]: http://smallcultfollowing.com/babysteps/blog/2017/01/26/lowe...
It is unlikely you will ever see non-zero cost abstractions in idiomatic Rust.
That said, at some point, we'll be getting ATC, which is equivalent to HKT in many cases, but feels more Rusty.
- HKT: Higher-Kinded Types
- ATC: Alternative Type Constructors
From what I remember from the theory, higher-kinded types lead to a genuinely more difficult type inference problem (going from easy first-order unification to undecidable higher-order unification), while associated types are simply existential types (and in particular no more difficult than higher-rank polymorphism).
Re "extra", I'm not sure what you mean - does it mean that the abstraction is implemented efficiently, but still has the cost that is usually associated with that abstraction? For example, dynamic dispatch is as fast as a DIY dynamic dispatch in assembly?
The borrow checker, AFAIU, has a cost in that it forbids some (more efficient) shared data accesses that it can't prove safe but still are.