Datasheet

Understanding the Dynamic Language Runtime
11
You should be able to use some third-party libraries with IronPython. At the time of this writing,
you won’t actually find any usable third-party libraries. However, you should check
http://www
.ironpython.info/index.php/Third-Party_Library_Compatibility
from time-to-time to dis-
cover whether there are any third-party libraries that do work with IronPython. It’s important to
note that this list represents only tested libraries — you may find other third-party libraries that do
work with the current version of IronPython.
UNDERSTANDING THE DYNAMIC LANGUAGE RUNTIME
IronPython is a dynamic language, yet the Common Language Runtime (CLR) is a static environ-
ment. While you can build a compiler that makes it possible to use a dynamic language with CLR,
as was done for IronPython 1.0, you’ll find that certain functionality is missing because CLR simply
doesnt understand dynamic languages. Consequently, Microsoft started the Dynamic Language
Runtime (DLR) project (see
http://dlr.codeplex.com/ for additional information). DLR sits on
top of CLR and performs a level of interpretation that offers additional functionality for dynamic
languages. By relying on DLR, IronPython gains access to the following support:
Shared dynamic type support
Shared hosted model
Quick dynamic code generation
Interaction with other dynamic languages
Improved interaction with static languages such as C# and Visual Basic.NET (see Chapters 15,
16, and 17 for details)
Shared sandbox security model and browse integration
DLR is now part of the .NET Framework 4.0. (In fact, you’ll discover the details of this integration
in Chapter 14.) Consequently, you can begin accessing these features immediately when using Visual
Studio 2010 without having to install any additional support. Microsoft currently supports these lan-
guages using DLR:
IronPython
IronRuby
JavaScript (EcmaScript 3.0)
Visual Basic
Silverlight also provides support for DLR and there’s even a special SDK for Silverlight DLR. You can dis-
cover more about this SDK at
http://silverlight.net/learn/dynamic-languages/. The relevance of
Silverlight support for this book is that you can now use IronPython as part of your Silverlight solution as
described in Chapter 11. You can summarize the benefits of using DLR as follows:
Makes it easier to port dynamic languages to the .NET Framework
Lets you include dynamic features in static languages
548592c01.indd 11 2/24/10 12:47:11 PM