Forum Stats

  • 3,852,832 Users
  • 2,264,140 Discussions
  • 7,905,155 Comments

Discussions

.NET CLR generics proposal for comparison

843793
843793 Member Posts: 41,732 Green Ribbon
edited Sep 24, 2002 6:56AM in Generics
I've just been reading a paper about how Microsoft may put generics into the CLR and C#, which may be useful for comparison with the Java work.

Details are available at:

http://research.microsoft.com/projects/clrgen/

They've taken a different approach, including generics at the VM level. I'm sure it's not all applicable to Java, but it would be worth reading to see if there are any interesting ideas...

Jon

Comments

  • 843793
    843793 Member Posts: 41,732 Green Ribbon
    The obvious difference is that it does just about everything that one might wish for in generics at the expense of requiring significant changes in the VM and reduced backward compatibility. In a research exercise this isn't a problem. What happens when you release it once there is a significant body of existing code is another matter.
    The paper referred to says absolutely nothing (unless I missed something) about the backward compatibility implications of their proposal.
  • 843793
    843793 Member Posts: 41,732 Green Ribbon
    The obvious difference is that it does just about
    everything that one might wish for in generics at the
    expense of requiring significant changes in the VM and
    reduced backward compatibility. In a research exercise
    this isn't a problem. What happens when you release it
    once there is a significant body of existing code is
    another matter.
    I don't see a big issue here. It's not like old code will not execute in a new CLR.

    With Java, we already have the situation where code compiled by JDK 1.4 will (potentially) not run in a 1.3 or older VM. 1.5 will see still more changes.

    So what's so bad if MSFT releases CLRv2, and a new compiler that generates new code for CLRv2 if (and only if) the program uses generic types? It's no different from the situation today where users that want to run swing programs have to download a new runtime..
  • 843793
    843793 Member Posts: 41,732 Green Ribbon
    The compatibility problem is much easier for MS and the CLR --- far fewer existing apps and VMs and almost all of the VMs must be in Windows and thus updateable via a service pack. With Java by contrast there are many JVMs in devices like mobile phones where the update is not so easy.
  • 843793
    843793 Member Posts: 41,732 Green Ribbon
    Eventually it'll have to happen. Sun will just have to release the New Java (probably 3), which is incompatible and does all the things it should have done all along (and which were part of the Oak proposal :-)
This discussion has been closed.