BT

InfoQ Homepage News Compiled IronPython

Compiled IronPython

Bookmarks

IronPython is Microsoft’s implementation of Python. It is being built simultaneously with the Dynamic Language Runtime, an infrastructure that allows dynamic languages to share code much in the same way the Common Language Runtime supports statically typed languages. Shri Borde discuses the status of IronPython 2 and how it works with compiled code.

Currently compiling IronPython to disk is temporarily unavailable. It was allowed in IronPython 1 and will return in the upcoming IronPython 2 Beta 4. This will be necessary if you want to reference the IronPython assembly from a statically typed language like C# or VB. It will also be needed when using reflection based tools like NUnit.

Another issue is that Python doesn’t have a way to support many CLS concepts. CLS, the Common Language Specification, is a subset of the full Common Type System and is considered to bare minimum needed for full interoperability. CLS compliant code excludes non-standard features such as VB’s optional parameters and C#’s unsigned integers.

IronPython has trouble producing CLS complaint code because there is no way to express concepts like visibility (Public vs. Private), parameter and return types, or custom attributes. Extensions to the language could be made, but at the cost of losing compatibility with other Python runtimes.

In the short term, hosting the DLR and thus IronPython, from an application written in VB or C# looks promising. As does building the base classes in those languages and extending them with IronPython code. Over the long run, possible enhancements such as the ability to make late-bound calls in C# without explicit reflection logic should prove beneficial.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Cool

    by pejvan beigui /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I can't wait to see IronPython 2.0 released :-D

  • Fantastic

    by Chen Sunny /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Fantastic post.
    It makes us more clear about DLR and CLR.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.