Reputation: 7186
One thing that really interests me that I don’t see much written about or discussed in .NET circles is how the runtime takes our abstractions and implements them via the CLR. While there are a few books out there that discuss some of these issues (i.e. Richter’s CLR via C# or the very tragically ignored Advanced .NET Programming by Simon Robinson which I highly recommend if you haven't read even though it's out of print) there are significant parts of the puzzle that aren’t covered by anything I’ve been able to find.
At least to me, it is a truly remarkable achievement to take the abstractions we do in programming and map those into arrays of bits and bytes that not only are faithful representations of our abstractions but can also be manipulated in ways that generate new, creative abstractions themselves. I’m looking for resource to help me understand how this occurs.
As an example of what I’m looking at knowing more of is this: we developers think of classes and instances as a discreet whole. You have a class and you have instances. We might understand that the way that the instances are set up by the runtime is by a reference that holds the instance data so that two objects of the same type don’t share data (duh), but I doubt that very many developers understand that the CLR doesn’t have any single place where class information resides—it actually only has method information and instance information then links the two under the rubric of a ‘type’. I know this is quite a different implementation of classes by the CLR than I conceived of.
Has anyone found good resources that covers this sort of stuff? They don’t need to be explicitly .NET, though I’d be the most interested in .NET-specific ones. I'm not really versed in the type theory/implementation world but I would guess that .NET CLR is fairly typical in it's approach to handling mapping abstractions to bits so any book/website covering this would be appreciated.
Upvotes: 2
Views: 164
Reputation: 85655
If you know C, then the best examples I know of would be some of the hacking OOP into C articles. It really lays out how vtables, casting, etc. work under the hood.
The only significant enhancements (off the top of my head, though I'm sure others will be added) from the CLR perspective is garbage collection, bounds checking, and type safety - which are all more runtime than they are memory related.
A quick Google makes Essential.NET look pretty interesting for this stuff (and being by Don Box and Chris Sells, it's bound to be detailed) - but I only skimmed 2 pages.
Upvotes: 0
Reputation: 6278
Am reading a book "More effective C#" at the moment and Bill Wagner writes some interesting things about generics and how it affects performance. He doesn't go in to details but I really like his explanation of how various constraints etc is handled by both the compiler and the CLR.
Good book so far!
Upvotes: 0
Reputation: 121314
What could be a better source of information than the official specification itself?
Standard ECMA-335 - Common Language Infrastructure (CLI)
Upvotes: 2