Book here says MSIL does not get fully compiled to native?  
Author Message
redshock





PostPosted: Common Language Runtime, Book here says MSIL does not get fully compiled to native? Top

One of the earliest books in C# was "C#: The Complete Reference" by Herbert Schildt. His book suggests in the beginning that the MSIL code gets compiled to native "as needed," so it basically suggests it does the same thing as Java. Later, I remember reading that Microsoft was insisting that all of the MSIL code gets compiled to native, which would also mean there's no runtime processing of the garbage collection etc.

The reason why I doubt Microsoft in this case is because the front of the cover of this book has a quote from Prashant Sridharan, the the C# Product Manager from Microsoft, saying that this is a must-have resource for C# programmers. Doesn't this mean he would have reviewed the book first Why was he okay before with the book saying the code gets compiled to native as a "as needed" basis I'm not frustrated over the topic, but I'm curious why there are two stories here. One could suggest that Microsoft is advertising false information for marketing purposes, or that Mr. Sridaran didn't fully look at the book before recommending it.



.NET Development7  
 
 
Dasa





PostPosted: Common Language Runtime, Book here says MSIL does not get fully compiled to native? Top

Because garbage collection is implemented as a part of .NET CLR, not within your program that is compiled to IL I'm just guessing.

Btw, don't put much stock in endor****ts on book covers - much of that is sheer BS - much like resume references.


 
 
redshock





PostPosted: Common Language Runtime, Book here says MSIL does not get fully compiled to native? Top

I would agree, but this quote...

"Herb Schildt has written a must-have resource for all C# programmers"

- Prashant Sridharan, C# Product Manager, Microsoft

Sounds credable to me on a cover, but I would think he would have reviewed the first ten pages at least where this compilation process comes in. It seems like it was true in the beginning ,then Microsoft decided to say it was being compiled fully to native. Or, Mr. Sridaran missed this portion completely which it seems to be.


 
 
Mattias Sjogren





PostPosted: Common Language Runtime, Book here says MSIL does not get fully compiled to native? Top

The book is correct, IL normally gets compiled to native code on an "as needed" basis. You can however use the NGEN tool to compile an entire assembly at once and store the result on disk. Either way, garbage collection still happens.



 
 
redshock





PostPosted: Common Language Runtime, Book here says MSIL does not get fully compiled to native? Top

Thanks for the confirmation. I was suprised even Microsoft said there was no interpretation even though we understand it gets compiled "as is" now meaning there is various interpretation going on. If you look at this simple google search...

http://www.google.com/search hl=en&lr=&q=microsoft+C%23+is+not+interpreted

You can tell that Microsoft did put some marketing effort to think otherwise. Was this to draw in developers  I guess what I'm getting at is these folks seem to have "heard" It was compiled fully to native, in some cases you're correct with NGEN. Even a MSDN FAQ says this here...

Benefits and Goals:

"JIT compilation is not interpreted"

Source: http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnnetcomp/html/net_vs_netcf.asp

I understand marketing, but this is a bit wild.


 
 
Scott Allen





PostPosted: Common Language Runtime, Book here says MSIL does not get fully compiled to native? Top

I don't think it is a stretch to say "JIT compilation is not interpreted" from the perspective of classically interpreted languages like Smalltalk and Lisp. JIT compilers tend to blur this boundary.



 
 
Dasa





PostPosted: Common Language Runtime, Book here says MSIL does not get fully compiled to native? Top

It seems to be an issue of semantic: if a code is compiled to "native" that links to a dll that provides runtime service (GC), is it "fully compiled to native " The phrase "native compilation" can manifest in different shades of implementations.

Btw, NGEN-generated code, is it completely independent of CLR, or does it link to CLR in some way to provide runtime service (e.g., GC)


 
 
Mattias Sjogren





PostPosted: Common Language Runtime, Book here says MSIL does not get fully compiled to native? Top

Btw, NGEN-generated code, is it completely independent of CLR, or does it link to CLR in some way to provide runtime service (e.g., GC)

It's still very much dependent on the CLR.