3 ms·
Baggage: http://stackoverflow.com/questions/313584/what-is-the-concept-of-erasure-in-generics-in-java http://stackoverflow.com/questions/313584/what-is-the-conc
by bjourne 12y ago
Baggage: http://stackoverflow.com/questions/313584/what-is-the-concept-of-erasure-in-generics-in-java http://stackoverflow.com/questions/313584/what-is-the-concep...
Yes there are many JVM:s but most of them aren't any good.
- mike_hearn 12y agoThey're working on real generics for the JVM, but it's a lot of work, especially to preserve compatibility (which is why it wasn't done beforehand). If you throw out compatibility it's still a lot of work though, plus you no longer have any of the libraries. I guess if you mean by "not any good" they're slower/less featureful than the original HotSpot JVM, then, well, yes..... you get what you pay for (in terms of resource usage).
- bjourne 12y agoWhere have you heard that? Generics were implemented using type erasure long ago because it was deemed to hard and would break to much existing code to implement them correctly. What has change to make it feasible now? Not saying you're wrong but I haven't seen any mention of any work in that direction.
- mike_hearn 12y agoLook for project Valhalla. It's doing value types, which means you will be able to write List<int> amongst other things. Obviously that means the int type cannot be erased in that context. Nothing in particular has changed, but full generics C++ style imply value types, and value types are now on the table whereas before they were not (other higher priorities, I guess).