6 ms·
I don't think the runtime is "much more advanced", the JVM has had most of these optimizations for years.
by sbinder 1y ago
I don't think the runtime is "much more advanced", the JVM has had most of these optimizations for years.
- grumpyprole 1y agoThe JVM famously boxes everything though, probably because it was originally designed to run a dynamic language. An array list of floats is an array list of pointers. This created an entire cottage industry of alternative collections libraries with concrete array list implementations.
- ysleepy 1y agoA float[] is packed and not a list of pointers in the jvm. An ArrayList<Float> is a list of pointers though.
- grumpyprole 1y agoArrays have a static fixed size though, making them far less useful in practice. Anything one builds with generics is boxed. Dotnet doesn't have this problem.
- pjmlp 1y agoCurrently you can get around this with Panama, even if the API is kind of verbose for the purpose. Eventually value classes might close the gap, finally available as EA.
- mrsmrtss 1y agoValhalla is over 10 years in the works already and there is still no clear date when or if at all it would be released. It's very difficult to change (or fix) such fundamental things so late in the game.
- pjmlp 1y agoBecause it is a huge engineering effort to add value types without breaking existing binary libraries. Doing a Python 3 would mean no one wanted going to adopt it. Yes it is long process. Some of the JEP in the last versions are the initial baby steps for integration.
- vips7L 1y agoThey're famously working on changing that. I think we're all hopeful that we'll start seeing the changes from Valhalla roll in post-25.
- dtech 1y agoAlmost none of this is in the JVM. Escape analysis is extremely limited on the standard JVM, and it's one of GraalVM's "enterprise" features. You have to pay for it.
- doikor 1y ago> one of GraalVM's "enterprise" features. You have to pay for it. Free for some (most?) use cases these days. Basically enterprise edition does not exist anymore as it became the "Oracle GraalVM" with a new license. https://www.graalvm.org/faq/ https://www.graalvm.org/faq/