1. Open Source .NET
IronPython, the DLR, and your toolkit
IronPython, the DLR, and open source in the
The Big Demo: Embedding IronPython in C#
Why do this?
3. The Presentation Stack
Dell Mini 9
GNU/Linux Kernel 2.6.28
Ubuntu Linux 9.04 (“Jaunty”)
Mono 2.4 (includes C# 3.0 support)
IronPython 1.1.1 (approximates CPython 2.6)
4. About your host
Christopher Groskopf Gainfully employed at
firstname.lastname@example.org Cal Poly
Ten years programming Payroll Systems
experience (two years Analyst—tools
paying the bills) development,
Mostly Python, C#, and and automation
Linux, Windows, and Onyxfish
5. Credit where credit is due
This presentation is loosely based on one by
Michael Foord—IronPython guru with Resolver
Systems and author of IronPython in Action.
His site: www.voidspace.org.uk
His book: www.ironpythoninaction.com
Resolver One, an application he works on, is the
largest application written in IronPython:
190,000 lines of code (including tests).
6. The XKCD Argument for Python
7. The evidence
Designed to be read
Defined style conventions
Libraries for everything (batteries included)
Tons of liberally licensed code available
Runs everywhere (C, Jython, PyPy, IronPython)
Fanatical user-base (has a philosophy)
8. One example
# Updates the last modified time on all Python
# scripts in the current working directory.
py_fnames = glob.glob('*.py')
paths = [os.path.abspath(f) for f in py_fnames]
for path in paths:
print 'Touched %i files' % len(paths)
9. Why IronPython?
Everything great about Python,
plus the .NET Libraries.
10. So how does it work?
Get the DLR: www.codeplex.com/dlr
Get IronPython: www.codeplex.com/IronPython
The DLR allows you to host dynamic languages
Not just Python: also Boo, Lua, Ruby, Scheme
and others (or roll your own)
The DLR is now maintained by Microsoft and will
be shipped with the CLR with .NET 4.0
11. Demo Time!
12. When to use IronPython?
Line-of-business application development
As a rules/logic definition language for a large
.NET application (games!)
As a plugin language for end-user development
To provide a console interface to an application
Because your bored and making programming
fun gives your life meaning again
13. How does Mono fit in?
IronPython + The DLR + Mono =
Fully open-source, cross-platform .NET stack
14. Keep in mind that...
C# 4.0 introduces the 'dynamic' keyword, which
brings dynamic programming functionality to C#
and provides native interoperability with DLR
IronPython is now being supported and
maintained by an internal Microsoft team
IronPython fills a crucial niche in Microsoft's
cadre of supported development languages
And most importantly...
15. The future is language independent
For new applications, language selection doesn't
matter that much
Library support matters
Interoperability matters a lot
Choosing a flexible language saves time, money,
16. In conclusion...
17. Python =
18. One more thing!
Effective July 7 both C# and the CLI are covered
by the Microsoft Community Promise.
NO MORE PATENT FUD
You're cross-platform Mono/.NET applications are
now unquestionably and irrevocably legal.
(We really can all live together!)
19. Links / Questions?
My Company: www.onyxfish.com
My Blog (for these slides): www.etlafins.com
Michael Foord: www.voidspace.org.uk