News for hackers. Stuff that matters.
Re:Concepts: The Future of Generic Programming [pdf] by pdpi on Wednesday December 21, 2016 @04:55PM (#13232978)
Actually, I think that it's because of how each syntax maps to other languages I've used before.

The parametrically polymorphic version reads a lot like Haskell, and both will monomorphise and use static dispatch:

    fn doStuff<T: Foo>(x: T) -> T
    doStuff :: Foo t => t -> t
Whereas the Trait Object syntax Reminds me more of Java's syntax, and both use dynamic dispatch:

    fn doStuff(x: &Foo)
    public void doSttuf(Foo x)
I don't think there's anything intrinsic about either syntax that suggests it _must_ use the dispatch style it does, but when I first started learning Rust, these similarities made it click for me which syntax went with what.

There are no comments on this comment yet.