DLR binders have two key responsibilities. One is the caching mechanism we looked at in the previous chapter. The other is language interoperability, and that’s the main topic of this chapter. Binders alone do not language interoperability make. The key elements in the DLR that make language interoperability possible are: a common type system that consists of twelve operations, binders, dynamic objects, and an interoperability protocol between binders and dynamic objects. In the DLR, binders and dynamic objects work together by adhering to a mutual protocol to ensure that objects from different languages interoperate seamlessly. This chapter will cover all of the key elements in the DLR that enable language interoperability. You’ll see examples that fetch dynamic objects from Ruby code and pass them to Python code. However, I won’t yet show you how to implement dynamic objects from the ground up; that will be the topic of the next chapter. For this chapter, it is enough to just use dynamic objects that come from Python or Ruby code.
KeywordsStatic Object Target Language Dynamic Object Bind Method Call Site
Unable to display preview. Download preview PDF.