On Nov 11, 4:06 pm, Carl Jokl <[email protected]> wrote: > When you say user defined types on the stack do you mean .net Structs > or are other types supported? I know that .Net has more options as > regards passing things by type and by reference. Extra flexibility at > the cost of more complexity.
C# has value types, so you can do stuff like allocate a large array of structs on the stack, which is of course much cheaper than on the heap since you avoid GC and (unless you do silly things) also boxing. > Many of the basic byte code operations seem fairly comparable from > basic examples from wikipedia but that may not tell the whole story. Except that JVM bytecodes carry type information in order to speed up the initial interpretation which the JVM still relies on. On the CLR they chose always to do *some* compilation, so that means the compiler can infer types during this step instead. A consequence of this JVM design is that we're running out of instruction space. > The memory management concept is interesting because I thought that > the CLR does not unload classes to free up memory when the are not > needed. This behaviour might actually just be for mono. I know > something along those lines was mentioned in some Second Life > technical talks about the technicalities of making the Second Life > scripting engine run on Mono. I believe it's a CLR thing, once a class is loaded it's loaded! The memory model appears to be simpler i.e. you'll never run into PermGenSpace problems. Mono just replaced their old Boehm GC with a generational, but I do believe the JVM's remain superior (albeit much more complex, hence the PermGenSpace issue). > I get the impression that it is more or less possible to convert Java > byte code to IL but the reverse is not wholly true because of the > presence of some features in IL which do not exist in Java byte code. I'd agree with that, the CLR is a lower common denominator (some claim not low enough), whereas the JVM was never really intended for anything but Java - regardless of how many languages have been implemented on top. Generics is reified on the CLR, meaning it's not just a compile time concept - you can actually say implements Comparable[T], Comparable[G] for the same type. It also means they can share code for generic base classes. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
