Hacker News new | ask | show | jobs
by pjmlp 38 days ago
Additionally, there are many JVMs to chose from, many always make the mistake to equate JVM with OpenJDK, which is like talking about C and only considering GCC or something.

Other JVMs have plenty of goodies, some of them have AOT for about 20 years now, others real time GC, other ones JIT caches before Project Leyden was even an idea, others actual value types as experiment (ObjectLayout on Azul), pauseless GC, cloud based JIT compilers, bare metal deployments, ART also has its goodies somehow despite everything, there is a whole world that is lost when people focus too much on JVM == OpenJDK.

1 comments

On the other hand, the JVM spec may prohibit some optimizations you are after. It's very dynamic after all!
Not really, that is the usual argument why CPython is slow.

If anything runtimes like the various JVM implementations, alongside the CLR and JS engines as well, are the bleeding edge of dynamic compiler optimizations with dynamic runtimes.

That is something that gets lost when talking about Java, yes the programming language looks like C++, however the JVM itself is heavily inspired by Smalltalk and Objective-C dynamic semantics.

Coming back to the spec, you will notice that it doesn't mention how threads are implemented, what kind of AOT/JIT are available, or what GC algorithms to implement, leaving enough room space for implementations.

One area where you are actually right, that I just remembered while typing this, are the way reflection or unsafe code hinders some optimizations, hence the ongoing steps that enabling JNI or FFM has to be explicit at startup, dynamic agents also have to be expliclity enabled, and the upcoming final means final (no more changing final fields via reflection).

what really matters is :

how far can i get in X programming language by writing just idiomatic code?

how much of SDK and community libs, frameworks help me run my program at bare metal speed ?

What sort of change i have to do exisitng libs, frameworks and my legacy code for CPU, IO and memory efficiency as a migrate to new version ?

That is only part of the picture, the other part that seems quite forgotten nowadays is:

- how much people actually care about algorithms and data structures

- do they actually know what options their tools have available

- have they ever spend at least an hour reading the man pages, info page or HTML documentations

- have they ever used a profiler, a graphical debugger, an advanced IDE