I. Love. Swift.

The benefits of the JVM are outdated

Which benefits? Can you elaborate?

You say "JIT-compiled bytecode", but that's a bit of an oxymoron isn't it? Once the JVM has JIT'ed the code, it is native (i.e., not bytecode). The HotSpot compiler is actually a pretty great profile-based optimizing compiler. You do have to give it some time to "warm up", which means that its best suited to long-running processes like web servers, but once it gets going it's pretty fast. In fact, if you look at TechEmpower's latest round of benchmarks, you'll see Java and JVM-based frameworks well represented at the top of the list, right up there with frameworks written in C and C++. Swift will certainly get there someday, but that day has not yet arrived.

We can argue about the relative merits of garbage collection vs reference counting, but they're both valid methods for offloading the work of memory management. The JVM community has really pushed the boundaries of garbage collection. Azul Systems' Zing JVM, with its proprietary C4 collector, is used in high frequency trading platforms, where latency and jitter caused by unpredictable GC behavior can sink a company.

The main thing that's holding back JVM performance these days is the inability to control memory layout, which will hopefully be fixed in Java 10 with project Valhalla. Even so, people do heroic things with off-heap memory buffers and garbage-free algorithms. Check out LMAX disruptor for instance.

/r/apple Thread Parent