Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here is some nuance with Rust's OOP relative to java/go/c++: https://stevedonovan.github.io/rust-gentle-intro/object-orie...

If you know haskell, Rust's traits are very similar to type classes, except it also has c++-like generics (templates) and is primarily expression-based like ocaml.

traits vs haskell type classes:

trait -> class struct -> data instance -> impl



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: