Wednesday, May 30, 2012

What is the difference between CLR and DLR in C#?

The Common Language Runtime (CLR) is the core set of services offered by .NET – a type system, JIT, a garbage collector, &c. Those are available to all .NET languages, hence the "Common" part.



The Dynamic Language Runtime (DLR) builds atop of this and offers services for dynamic languages: dynamic types, dynamic method dispatch, code generation, &c. The idea is to make those things uniform and share them among dynamic languages so that they work predictably and similar, just like things on the CLR are across all languages too.

In a way those are comparable, a "normal" language on .NET uses the CLR, a dynamic language should use the DLR, but will use the CLR as well. They are basic sets of functionality that the designers considered to be good when they are common across languages. IronPython and IronRuby were implemented on top of the DLR, as is C# 4's dynamic feature.









what is the meaning of CTOR?

It's just shorthand for "constructor" - and it's what the constructor is called in IL, too. For example, open up Reflector and look at a type and you'll see members called .ctor for the various constructors.




What is this C# syntax called?

SomeFunction (() => {


DoSomething (); });

What is the name of this syntax (the () => ...)?

Answer: This is called Lambda Expression (parameterless lambda expression)

What does mscorlib stand for?

Microsoft Common Object Runtime Library