3 ms·
It really depends at what level -- because the erasure is done at the language level rather than the VM you _have_ to have a pile of runtime casts, even when th
by olliej 10y ago
It really depends at what level -- because the erasure is done at the language level rather than the VM you _have_ to have a pile of runtime casts, even when those casts are no-ops :-/
I agree it works, i just don't think it's as elegant :D
Of course eventually everything is running on an untyped CPU and everything is just an integer so it's all erased in the end. Unless you have one of those silly mid-90s java cpus right?
Or maybe a LISP-machine
- pjmlp 10y ago> silly mid-90s java cpus They are still quite actual, here is one example. http://www.imsystech.com/products/im3910-ic/ http://www.imsystech.com/products/im3910-ic/
- wtetzner 10y agoWell, that's a detail of how the VM works. My only point was that type erasure is not inherently bad, as plenty of languages do type erasure, like Haskell and OCaml. Of course you can always create conditions where it could become a problem. But the example with C# "doing it right" is a little odd in that case, since Microsoft had the opportunity to build something new, that didn't have the same issues the JVM had. And they did, in some ways, but that doesn't mean tracking type parameters at the VM level is the only way to do it "right".