From wikipedia’s entry on DLR,
it look like the purpose of DLR is for using language like Python, Ruby…etc. Is that all to DLR? Is there any other benefits and why do you want to pick IronPython over C# for say ASP.net project or Winform app?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The CLR and its underlying execution model is optimized for statically typed languages. Pretty much all the methods in the class libraries with .NET take arguments that are more precisely typed than the root of the type system, System.Object.
Dynamically typed languages require a different set of functionality in a runtime. They need the ability to efficiently execute dynamically typed code. For example, when a dynamically typed language calls a regular CLR class, it needs to convert and / or typecast each argument to the statically-defined type on the CLR class. If this isn’t done carefully, it can be inefficient.
Similarly, dynamically typed languages often have an object model which isn’t easily mappable to the CLR class model with explicitly typed properties, methods, fields etc. Instead, objects are often more like hashtables, buckets of key-value pairs where the keys are strings (or symbols) and the values are methods, closures, or object values themselves. The objects (and / or their types) are often extensible at runtime as well.
Since there are similarities between the dynamically typed languages, it would be useful for the commonality to be extracted out into a base set of functionality, to ease both interoperation and dynamic language implementation, as well as making it easier for CLR optimizations to be specifically focused on dynamic languages. The new
dynamickeyword in C# is part of this: it uses mechanisms from the DLR to help interoperate with dynamically typed languages and object systems, such as COM automation objects, IronPython, IronRuby, etc.