13 ms·
No value types, no generics, this forces all sort of hacks with arrays to pack memory layouts when you don't want to use reference types (think small vector str
by moonchrome 15y ago
No value types, no generics, this forces all sort of hacks with arrays to pack memory layouts when you don't want to use reference types (think small vector structures, tuples) and inefficient code generated for Java templates (essentially everything gets boxed to Object). Value types don't touch GC. Also on the low level Mono has SIMD vector support which is also useful, you can even turn off dynamic bound checking when you need extra performance and presumably already did the testing. Also native interop is better with PInvoke. This might not be relevant for web development (although jgit and twitter teams both mentioned they had problems with this), but I did game development before switching and this sort of thing really matters. .NET was bad on the JIT/inlining/optimization side but Mono fixes that with AOT compilation/using LLVM for code generation.
And .NET has better libraries to deal with asynchronous programming, Task uses continuation passing and each thread has it's own "event loop" with SynchronizationContext, it's really simple to switch between them, Java has all sort of mixes, some API's use pooling, some use continuations, and you have to mess around with Executors since there is no equivalent to SynchronizationContext. Also RX is a wonderful abstraction on event streams. Java can't even consider this sort of API's because it has no lambdas/extension methods, and this reflects in JVM libraries.
- justncase80 15y agoAlso, the CLR has had the ability to dynamic invoke delegates for years. Also dynamic compilation and assembly unloading.