4 ms·
AFAIK Rust generics are reified (where Java's are erased with typechecks inserted in various places) so the "generic type" exists at runtime, but there's no RTT
by masklinn 11y ago
AFAIK Rust generics are reified (where Java's are erased with typechecks inserted in various places) so the "generic type" exists at runtime, but there's no RTTI so whatever does exist is inaccessible at runtime.
- deleted 11y ago[deleted]
- geodel 11y agoSo for users who mostly write enterprise type applications do Rust generics have anything better to offer compared to Java?
- masklinn 11y agoI don't think so, at least until specialisation lands. When used as generic constraints they're statically dispatched which might mean better performances, but I believe the JVM is pretty good at devirtualisation so YMMV… The only advantage I can think of is probably a lack of surprise when trying to use reflection and discovering your generic types are missing (but that's because there is no reflection in rust)