4 ms·
Nonsense to you is wonderful to me. I don't think "I am unfamiliar with this syntax" is really a useful observation - Erlang has an extremely unfamiliar syntax,
by danieldk 9y ago
Nonsense to you is wonderful to me. I don't think "I am unfamiliar with this syntax" is really a useful observation - Erlang has an extremely unfamiliar syntax, but I don't think that makes it less suitable for building a service.
I do not think this is just about unfamiliarity. Doing static dispatch with generics + traits does add complexity to type signatures. E.g. consider using dynamic dispatch using trait objects
trait Frobber {
fn frob(&self, something: &OtherTrait);
}
versus static dispatch:
trait Frobber {
fn frob<S>(&self, something: &S) where S: OtherTrait;
}
Of course, static dispatch has large benefits (opportunities for inlining, possibly leading to other optimalizations). Rust adds correctness and deterministic performance (besides Rc/Arc misuse). But Rust also has the potential for 'macro/generics soup' and over-abstraction. I think it is a fair criticism of a language. Use sharp tools wisely.
(Disclaimer: writing Rust daily for work.)
- vertex-four 9y agoNote that `impl Trait` in argument position has been stabilised and should be in a beta soon, and stable after that - so your latter example can be simplified to: trait Frobber { fn frob(&self, something: &impl OtherTrait); }
- danieldk 9y agoI am not tracking development besides release notes, but that's great news!
- steveklabnik 9y ago1.25 is released Thursday, and has some good stuff. This is coming in 1.26, and it and 1.27 are going to be monster releases with so so so much good stuff. Get ready :)
- danieldk 9y agoJust read that SIMD intrinsics may also be stabilized for 1.27. Keep up the good work!