TITLE OF PAPER: IronPython: a fresh look at Python on .NET URL OF PRESENTATION: _URL_of_powerpoint_presentation_ PRESENTED BY: Jim Huginin REPRESENTING: Want of a Nail Software CONFERENCE: PyCON 2004 DATE: 20040324 LOCATION: _venue_and_room_in_venue_ -------------------------------------------------------------------------- REAL-TIME NOTES / ANNOTATIONS OF THE PAPER: {If you've contributed, add your name, e-mail & URL at the bottom} Jython on the CLR and Mono Introduction to the CLR Core of the .NET Framework (the future of Windows, code-named Longhorn) Open source CLR == Mono IronPython compiles to CLR IL bytecodes 40% faster than 2.3 on pystone can call .NET code easily A research prototype 0.2 runs pystone and parts of Python regression suite Architecture Mirrors CPython Support library written in C# Static and dynamic compilation Written completely in C# first built 3 python prototypes and then rewrote in C# Demo of IronPython 0.2 2+2 = 4 from Agent Import Character ch = Charactgere.Load("merlin.acs") ch.Show() Load MSAgent avatar Use python to script animation Created a dictionary of Animations and was able to perform any animation as a function call Performance Previous attempts to implement Python on the CLR have been too slow. Created impression that CLR is bad for dynamic languages PyStones relative to Python 2.3 IronPython-0.2 1.43 IronPython-0.2 -O2 1.84 Python 2.1 0.78 Micro Benchmarks - paper on python.org eval() is 2-100 times slower range is 3x slower python's special purpose memory management for ints beats CLRs general purpose GC library functions from 3x slower to 2x faster list sort is 3x slower in IronPython (thanks Tim P.) unicode.find() is 2.2x faster in IronPython (thanks CLR team) Huge number of CLR developers will shift the balance function calls user_func("a") + -O2 is 9x faster uses native CLR stack frames requires disabling locals() and frame.f_locals builtin_func("a") and user_func - 1.6x faster fast paths avoid need to create a tuple args_func("a") - 1.1x slower def args_func(*args): return args fallback to general purpose code 3 ways to set a global gx = i 8x faster mod.gx = i = 4x faster gd["new_name"] =i 1.1x slower Question from the audience: what about Mono - there is no reason it should not run under Mono but he is concentrating on getting IronPython to work well on one platform for now. Will sync up with Mono 1.0 this summer. Python for .Net (ActiveState, funded by Microsoft) - "not fast enough for more than demos" Why is Iron Python fast Use native CLR constructs when possible Ludicrously optimized code Must be used creatively to match python semantics Code generation creates fast paths for common cases Python scripts used to generate C# code at development time Reflection.Emit to generate IL at runtime Include fall-backs to fully dynamic implementations general purpose support for less common cases handles Python's fully dynamic semantics Static Analysis - The Future Static analysis techniques Abstract interpretation. Q: Is there a place where you can download and play with it A: Still trying to find the best way to release it Q: Have youy tried to run this under rotor A: No - haven't planned on running under rotor, uninteresting from the point of learning how to make Python go fast on the CLR Q: How much difficulty do you anticipate in using new style classes? A: They are already implemented, except the CLR doesn't (natively) support multiple inheritance Q: What do you mean when you said it doesn't support multiple inheritance A: Eiffel folks had to work around lack of CLR MI support to get it to work Q: What is managed c++ code A: Managed c++ is c++ that has a lot of restrictions in what can be done to run in a garbage collected environment Q: What type of multi-threading support do yo plan on putting into Iron Python A: Iron Python apps uses the underlying thread support and it needs to be made to work with the existing threading model Q: How far are you going to take Iron Python A: It's not going to be released until he figures out how to finish it Q: What does the method dispatch speed look like for new style classes A: It looks dramatically faster -------------------------------------------------------------------------- REFERENCES: {as documents / sites are referenced add them below} Paper: http://www.python.org/pycon/dc2004/papers/9/IronPython_PyCon2004.html Mono: http://www.go-mono.com Rotor: http://msdn.microsoft.com/library/en-us/Dndotnet/html/mssharsourcecli.asp -------------------------------------------------------------------------- QUOTES: -------------------------------------------------------------------------- CONTRIBUTORS: {add your name, e-mail address and URL below} Ted Leung, twl@osafoundation.org, http://www.sauria.com/blog -------------------------------------------------------------------------- E-MAIL BOUNCEBACK: {add your e-mail address separated by commas } ark3@email.com -------------------------------------------------------------------------- NOTES ON / KEY TO THIS TEMPLATE: A headline (like a field in a database) will be CAPITALISED This differentiates from the text that follows A variable that you can change will be surrounded by _underscores_ Spaces in variables are also replaced with under_scores This allows people to select the whole variable with a simple double-click A tool-tip is lower case and surrounded by {curly brackets / parentheses} These supply helpful contextual information. -------------------------------------------------------------------------- Copyright shared between all the participants unless otherwise stated...