4 ms·
Questioning the reality of generics
- shasta 16y agoHe envisions a bunch of languages in the future, all of which are similar enough to use the exact same data model? Surely, if we really need different languages, they will be different enough to have different data models, and an encoding of the data from one language will be required for interoperability. For example, a dynamic language can be encoded into a more static language by passing along extra meta-data. And BTW, this has performance benefits over his idea of making the underlying VM as dynamic as the lowest common denominator language. Good luck with that idea if you have IO in your language stack. I also disagree with the apparently widely held belief that we really need to have many different full languages in use. Such a state of affairs may be useful for competition, but the overhead of interoperability hurts productivity. It's analogous to the situation with Buffalo. Here, let me switch to Navajo to make the analogy, since it has better words for Buffalo. BIH TA-ZI-KWA-I-BE-KA-DI COH-NAI-ALI-BAHN-SI ALTH-AH-A-TEH TKAL-CLA-YI-YAH.
- scott_s 16y agoHe presented the problem well, then concluded without much support. That is, he did not explain to me why wanting reified generics makes me a language egoist. Does it really make the job of supporting multiple languages that much more difficult? It also wasn't clear to me if his conclusion is just for the JVM (which has almost two decades of baggage), or for any given VM.
- jister 16y ago>> Java and C# both added generic types at roughly the same time Really? I thought Java added generics a year after it was added in C# or am I wrong?
- bfung 16y agoother way around, Generics came in java 1.5 and c# 2.0: http://en.wikipedia.org/wiki/Java_version_history#J2SE_5.0_.28September_30.2C_2004.29 http://en.wikipedia.org/wiki/Java_version_history#J2SE_5.0_.... http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Versions http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#... but that's only from a programmer standpoint, and matters very, very little. The bytecode level is where the real difference comes. Sun hacked generics into the java compiler so it loses the type information (type erasure) in the byte code. By rumor, the CLR vm/bytecode was also designed by roughly the same group of people, lured away from sun by microsoft. the CLR keeps the type information around so it allows some more reflection magic to be implemented.
- deleted 16y ago[deleted]