> * Delegates could be done in java albeit not trivially. They're essentially just syntactic sugar for a one-method class.*
No, there are many differences, both at the language and at the VM level, although you could emulate the behavior of delegates. You should look at the new MethodHandler from the JDK7 InvokeDynamic proposal ... they've added it for a reason ;)
> The CLI has true generics
The jury is still out on what constitutes "true generics" ... IMHO the C++ templates are more true than their C# equivalent ;)
But yeah, the Java generics system is a far cry from what it should've been. And it also sucks because there are exceptions ... arrays are reified, and the new MethodHandler from JDK7 is also reified.
That said ... you can add reified generics on top of the JVM. It is just a lot of hard work because you can't reuse the current generic types.
There are other features that are difficult to implement ... stack allocated values, the primitives that aren't mapping to the JVM types (decimal, ulong), pointers / unsafe code, PInvoke, tail-calls (although I know of a way to have tail-calls, but it's heavy).
You can implement anything on top of the JVM, but you will lose efficiency (not to mention of interoperability with Java code).
Note that neither the Microsoft C# compiler nor the Mono one emit tail calls. In practice, the MS .NET Just-In-Time compiler however transforms tail recursion to loops even if the compiler didn't ask for it if a number of conditions are met. I'm no JVM expert by any means but I don't see why the JVM couldn't do something similar, in theory or in practice.
Scala compiler does self-tail calls so in theory Java compiler should be able to do it. But IIUC doing tail calls between functions is not possible (or at least not worth the effort) on the JVM.
No, there are many differences, both at the language and at the VM level, although you could emulate the behavior of delegates. You should look at the new MethodHandler from the JDK7 InvokeDynamic proposal ... they've added it for a reason ;)
> The CLI has true generics
The jury is still out on what constitutes "true generics" ... IMHO the C++ templates are more true than their C# equivalent ;)
But yeah, the Java generics system is a far cry from what it should've been. And it also sucks because there are exceptions ... arrays are reified, and the new MethodHandler from JDK7 is also reified.
That said ... you can add reified generics on top of the JVM. It is just a lot of hard work because you can't reuse the current generic types.
There are other features that are difficult to implement ... stack allocated values, the primitives that aren't mapping to the JVM types (decimal, ulong), pointers / unsafe code, PInvoke, tail-calls (although I know of a way to have tail-calls, but it's heavy).
You can implement anything on top of the JVM, but you will lose efficiency (not to mention of interoperability with Java code).