Re:Why Go Is Not Good (2014)
by vardump on Wednesday December 09, 2015 @02:38PM
(#10706154)
Java doesn't actually have runtime generics. Just type erasure syntactic sugar. ArrayList<Integer> is the same type at runtime as ArrayList<Foo>.
[ Parent
| on HN ]
Sure, but I'll take it if that means I can at least use some type of generics. :)
In my experience it's decent, even if not as powerful as C++ templates. Being able to specialize containers is a basic comfort for me.
Re:Why Go Is Not Good (2014)
by omginternets on Wednesday December 09, 2015 @02:42PM
(#10706176)
This strikes me as a distinction without a difference, in the present case. How is this meaningfully different from the programmer's perspective?
You can't distinguish them at runtime from each other.
Your memory consumption is higher, because type erasure requires elementary types to be boxed. Since the boxed value is itself allocated somewhere else, there's indirection. Indirection means CPU stalls. Another consequence is data cache pollution. There are just 512 of 64 byte L1D cache lines.
Other than that, I guess nothing.
Re:Why Go Is Not Good (2014)
by AnimalMuppet on Wednesday December 09, 2015 @03:45PM
(#10706602)
But if you're worried about that amount of memory consumption, why are you using Java? If you need that much control over memory, Java may not be the language for you.
Ditto if you're worried about the performance hit from cache misses.