Chapter 14. Interacting with the DLR

WHAT'S IN THIS CHAPTER?

  • Getting your copy of the DLR

  • Considering hosting APIs

  • Employing extensions to the LINQ ExpressionTree

  • Working with DynamicSite

  • Understanding IDynamicObject

  • Using the ActionBinder

  • Considering the other DLR Features

The Dynamic Language Runtime (DLR) is a new feature of the .NET platform. Its intended purpose is to support dynamic languages, such as Python (through IronPython) and Ruby (through IronRuby). Without DLR, the .NET Framework can't really run dynamic languages. In addition, DLR provides interoperability between dynamic languages, the .NET Framework, and static languages such as C# and Visual Basic.NET. Without DLR, dynamic and static languages can't communicate (see the section "Understanding the Relationship between Dynamic and Static Languages" in Chapter 15 for additional details). In order to meet these goals, DLR must provide basic functionality that marshals data and code calls between the dynamic and static environments. This functionality comes in a number of forms that are discussed in this chapter. You might be surprised to find that you've already used many of these features throughout the book. Here's the list of features that DLR supports in order to accomplish its goals.

  • Hosting Application Programming Interfaces (APIs): In order to run dynamic language scripts, the host language must have access to the scripting engine. The Hosting APIs provide the support needed to host the dynamic language within the host ...

Get Professional IronPython™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.