Specifically about the stack allocation proposal, it has been withdrawn due to the vast complexity of referencing an object not lying on the heap, as well as the fact that TLAB allocation nowadays does exactly the same (increment a pointer, with around 5 (five) extra machine instructions to ensure TLAB has enough space), so stack allocation is both not very effective and efficient.
You know full well what they've implemented because you're active here and Microsoft's contributions to OpenJDK are mentioned frequently. In particular the Arm64 port was a major piece they've contributed.
At this point I think you're just commenting in bad faith.
Assuming that Valhalla, Loom and Panama ship soon™, what features would be JVM lacking that C# absolutely requires? (ie anything that's more than just syntax sugar)
Structs, Real generics are somewhat covered by Project Valhalla.
Generics could be emulated even now. (well, to some extends structs could too, you just wouldnt get the benefit of flattened arrays)
Properties as a runtime concept. (This isn't just syntactic sugar, a lot of libraries rely on this.)
Technically it is just a syntax sugar over some standarized concept. It doesn't absolutely need a runtmie support. That could be mapped to getters and setters silently. I think Kotlin does that already.
Pass by reference and ref return could be emulated.
overflow checking - syntax sugar over checked intrinsics
Delegates -> functional interfaces with one method, semantically it's just syntax sugar over that
Assemblies as a first class concept
but why? .NET assemblies is the most fake concept I have seen in computing. Just a thin wrapper around IL junk.
You could pack java bytecode wrapped inside a DLL in some standarized fashion, even expose a COM interface. Otherwise JVM just as CLR can be hosted inside native applicaton. (through JNI)
Making native executable launcher wrapper that automatically finds and runs JVM is a no-brainer though. It can be done.
internal and protected internal visibility (Ok, you make be able to fake these with annotations.)
depends on your goal, for package level visibility default access flag is that, for library level visibility you can use jigsaw modules, and as you said, you can resort to annotations if some corner case is not covered by either
pointers (not references, actual mutable pointers)
You can manipulate arbitrary memory addresses with Unsafe, this could be sugarified over that.
p/invoke (Might be covered by JNI)
Covered by project Panama. P/Invoke could use JNA for now.
For example, how are you going to emulate generics?
The same (more or less) way .NET runtime does. By creating an internal type for each generic type. In .NET, List<int> and List<double> are separate types internally, each has separate code substituted with actual generic type. It's just done in runtime.
As for availability of type argument, hidden field could do. The important thing is that semantics from the point of view of language look the same.
The whole MS journey is interesting. Open source/standards won, it just has a MS badge on it now. AWS, cross-browser web apps, GitHub, Spark, Python, Angular/React, node/npm are all examples of the industry leading and MS having no choice but to play catchup. I feel like the days of MS trying to achieve market dominance by going against everybody else are long past.
MS doesn't "love" open source, they just have no choice, like trying to fight a riptide.
MS makes a huge amount of money from Azure. It's in their best interest to make it as easy as possible to use their platform and part of that involves being good citizens of various communities like Java.
-2
u/barking_dead Nov 05 '21
No development effort and sabotage at the heart. The Halloween Documents have this scenario.