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?
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)
About your host
Christopher Groskopf Gainfully employed at
email@example.com 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
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).
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)
# 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)
Everything great about Python,
plus the .NET Libraries.
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
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
How does Mono fit in?
IronPython + The DLR + Mono =
Fully open-source, cross-platform .NET stack
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...
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,
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!)
Links / Questions?
My Company: www.onyxfish.com
My Blog (for these slides): www.etlafins.com
Michael Foord: www.voidspace.org.uk