SyPy IronPython


Published on

From the early days of IronPython, my presentation at Sydney Python User's Group

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

    IronPython was originally created by Jim Hugunin, who also was the original creator of Jython. Jim wanted to write a paper titled “Why .NET is a terrible platform for dynamic languages”

    Microsoft hired Jim to disprove his own paper

    Then came IronPython 1.0

    Abstracted out DLR

    IronPython 2.x (and IronRuby, John Lam)
  • MsPL (similar to a BSD-type license)
    IronPython code acceptance vs. IronRuby
  • Talk about DLR
  • SyPy IronPython

    1. 1. IronPython combines the best of Python and .NET. IronPython Nick Hodge Professional Geek, Microsoft Australia @nickhodge
    2. 2. General Courtney Hicks Hodges
    3. 3. “Gold” Arromanches, Normandy, France
    4. 4. Inspiration “The speed of the current system is so low as to render the current implementation useless for anything beyond demonstration purposes.” – ActiveState’s report on Python for .NET “The CLI is, by design, not friendly to dynamic languages. Prototypes were built, but ran way too slowly.” – Jon Udell, InfoWorld, Aug. 2003 • How could Microsoft have screwed up so badly that the CLR is far worse than the JVM for dynamic languages? – Jython shows that dynamic languages can run well on the JVM • I decided to write a short pithy paper called, “Why .NET is a terrible platform for dynamic languages”
    5. 5. .NET ?.?DLR2 .NET 4.0 .NET 3.5LINQ DLR .NET 2.0 The Common Language Runtime .NET 1.0 GC BCL ReflectionJIT Generics In Runtime Expression Trees Extension Methods Statement Trees Call Site Caching Dynamic Dispatch Dynamic Codegen Verifier Sandbox Silverlight Fast Delegates Dynamic Methods Script Hosting ??? ???
    6. 6. Python Binder Ruby Binder COM Binder JavaScript Binder Object Binder Dynamic Languages on .NET Dynamic Language Runtime Statement Trees Dynamic Dispatch Call Site Caching IronPython IronRuby C# VB.NET Others…
    7. 7. • Today it shares a site with IronPython – • Next month it will move to its own site • MSPL is a permissive Open Source license • Core V1 components – Trees, Sites, Binders – Will ship in .NET Framework 4.0 – Base for C# 4.0’s dynamic • Future pieces are also available today – Microsoft.Scripting.dll for now DLR is under MSPL and on codeplex
    8. 8. When to use IronPython?
    9. 9. IPy 1.0 •Shipped Sept. 2006 •v2.4 language compatibility •27/54 built-in modules IPy 1.1 •Shipped April 2007 •Limited v2.5 language features •More Modules •Top user issues •VS Integration (VSX sample) IPy 2.0 •Current Focus •Fall 2008 •v2.5 language compatibility •Built on DLR •More modules •Top User Issues IPy 2.6 •Alpha Released •H1 2009 •v2.6 language compatibility •Productize VS integration IPy 3.0 •In Planning •H2 2009 ? •Python 3000 language compatibility •Support for next version of VS IronPython Roadmap LINQ?
    10. 10. Standard Pystone Benchmark higher numbers are better 0K 20K 40K 60K 80K 100K IronPython 0.1 Python 2.3 IronPython 1.0 IronPython 2.0beta5 Python 2.5 Python 2.1 46K 101 K90K 80K 50K 36K
    11. 11. Two Object Worlds == Pain Python Objects C-Based Objects py1 c2
    12. 12. IronPython can interop with code written in other .NET lanugages.
    13. 13. Extending IronPython in C# namespace noddy { public class Noddy { public string first, last; public Noddy(string first, string last) { this.first = first; this.last = last; } } }
    14. 14. IronPython is embeddable in .NET applications.
    15. 15. import clr clr.AddReference("IronPython.dll") from IronPython.Hosting import PythonEngine engine = PythonEngine.CurrentEngine scope = engine.CreateScope() source = engine.CreateScriptSourceFromString('6*9') result = source.Execute(scope)
    16. 16. (Including SVN access to source)
    17. 17. IronPython combines the best of Python and .NET. IronPython Nick Hodge Professional Geek, Microsoft Australia @nickhodge