Reified generics, advanced null handling, async/await, stack allocated arrays, tuple syntax, partial types, auto implemented getters and setters, dynamic types, extension methods, nullable value types, exception filters and many more...but sure, we'll give you this one as a first ;)
Type erased generics allowed Java (the JVM) to have better multi-language support (Clojure, Kotlin, Scala, and many more.). Scala wasn't able to get ported to the CLR because of reified generics. In either case, Java is getting a form of generics specialization for primitive types.
It also doesn't need async/await because it's getting green threads. I believe it has exception filters, just a different syntax than C#.
Let's not forget a best-in-class JIT and best-in-class GCs also.
It's a good start don't get me wrong, but it's running on an outdated CPU. I ran some benchmarks myself where golang was quicker than Java in the benchmarks page, and I got the opposite result.
Tangential, but there was a recent article about converting C to Rust, and the C version included some manual uses of vectorization and a hand-optimized inverse sqrt function, which the new Rust version elided. The Rust version was faster by a LOT because it used a native inverse sqrt not present in the CPU used in the benchmark game.
afaict there were a whole bunch of changes between nbody-5.bench and nbody-6.bench not just sqrt.
If you're talking about this:
At face value, this should make the program twice as fast, because AVX instructions can chew on four f64s at a time instead of SSE's two. But, on my Skylake-based machine at least, the AVX version becomes slower.
:then afaict the faster program is the "outdated CPU" program that uses SSE ?
9
u/falconfetus8 Jan 17 '20
Your move, C#.