|
|
|
|
|
by deredede
761 days ago
|
|
> Classes exist at runtime Not necessarily, depending on the language. Functional languages and system languages such as OCaml, Haskell, Rust, but also C (painfully) and C++ can represent wrapper types within a nominal type system at no runtime cost. |
|
https://okmij.org/ftp/Computation/typeclass.html#dict
In Rust, using trait objects also generates a vtable for dynamic dispatch so in that case traits are not fully erased:
https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/sh...