जगदीश खोलिया: What is DLR in .NET 4.0 framework?

Monday, July 11, 2011

What is DLR in .NET 4.0 framework?

What is DLR in .NET 4.0 framework?
DLR
Due to DLR runtime, dynamic languages like ruby, python, JavaScript etc can integrate and run seamlessly with CLR. DLR thus helps to build the best experience for your favorite dynamic language. Your code becomes much cleaner and seamless while integrating with the dynamic languages. Integration with DLR is not limited to dynamic languages. You can also call MS office components in a much cleaner way by using COM interop binder. One of the important advantages of DLR is that it provides one central and unified subsystem for dynamic language integration. 

C# 4.0 Language Innovation

  • Dynamically Typed Objects
  • Optional and Named Parameters
  • Improved COM Interoperability
  • Co and Contra variance
Dynamic types

What are the advantages and disadvantage of dynamic keyword?

We all still remember how we talked bad about VB6 (Well I loved the language) variant keyword and we all appreciated how .NET brought in the compile time check feature, well so why are we changing now.  Well, bad developers will write bad code with the best programming language and good developers will fly with the worst programming language. Dynamic keyword is a good tool to reduce complexity and it's a curse when not used properly.
So advantages of Dynamic keyword:
Helps you interop between dynamic languages.
Eliminates bad reflection code and simplifies code complexity.
Improves performance with method call caching.
Disadvantages:
Will hit performance if used with strongly typed language.

No comments: