Udostępnij za pośrednictwem


IronPython in Action

I'm quite excited that IronPython in Action is published.  I had the chance to write the foreword to this book and wanted to share it here as well.

ironpythoninaction

Foreword to IronPython in Action

IronPython brings together two of my favorite things, the elegant Python programming language and the powerful .NET platform.

I've been a fan of the Python language for almost 15 years, ever since it was recommended to me by a fellow juggler while we passed clubs in a park.  From the start I found Python to be a simple and elegant language that made it easy to express my ideas in code.  I'm amazed by Python's ability to appeal to a broad range of developers from hard-core hackers to amateur programmers including scientists, doctors, and animators.  I've been teaching my ten year old son to program and even he tells me that, "Python is a great language to learn with."  Beyond teaching my son, I've tried to contribute back to the Python community that gave me this great language and continues to drive it forward.  Prior to IronPython I started both the Numeric Python and Jython open source projects.

It took a quite bit longer for me to become a fan of Microsoft's .NET platform and the Common Language Runtime (CLR) that forms its core execution engine.  I first learned about the CLR by reading countless reports on the web that said it was a terrible platform for dynamic languages in general and for Python in particular.  IronPython started life as a series of quick prototypes to help me understand how this platform could be so bad.  My plan was to prototype for a couple of weeks and then write a pithy paper titled, "Why the CLR is a terrible platform for dynamic languages".  This plan was turned upside down when these prototypes turned out to run really great – generally quite a bit faster than the standard C-based Python implementation.

After getting over my initial skepticism, I've grown to love the CLR and .NET as much as Python.  While no platform is perfect, this is the closest that we've ever come to a universal runtime that can cleanly support a wide variety of different programming languages.  Even more exciting to me is that the team is committed to the multi-language story and we've got great projects like the DLR, IronRuby and F# to keep extending the range of languages that can coexist on this platform.   I've even grown to like C# as by far the most enjoyable and versatile statically typed programming language I've used.

As the architect for IronPython, I like to believe that it's such a simple and elegant combination of the Python language and the .NET platform that it needs no documentation.  After all, who could possibly not know that they should use clr.Reference to pass an out parameter to a .NET method.  Well, I guess that it's assumptions like that one that make me a poor choice for writing a book teaching people about IronPython.  The best choice for writing a book like this would be a long-term user who's deeply engaged with the community and who has been trying to understand and explain the system to others for years.

Now, if only we could find such a person…

I first met Michael Foord in July of 2006.  I was preparing an IronPython talk for the OSCON conference in Portland, Oregon.  This was going to be an exciting talk where I'd announce that the final release of IronPython-1.0 was weeks away.  Of course, this was a terrible time to be preparing a talk since my mind and time were occupied with all the details of the actual release.  To further complicate things for me, this was the Open Source Convention, and I knew that I needed to show IronPython running on Linux to have true credibility with this audience.  Unfortunately, I didn't have the time to setup a Linux box and get some useful demos running.  Oddly enough, I also found that my coworkers (at Microsoft) didn't have any spare Linux boxes running in their offices that I could borrow for a few screen shots.

I did a desperate internet search for "IronPython Linux" and one of the places that led me was a blog called voidspace.  There I found a tutorial teaching how to use Windows Forms with IronPython.  The reason this tutorial showed up was that it included screen caps of the samples running under both Windows and Linux.  This was just what I was looking for!  By stealing these pictures for my talk I could both show people IronPython running on Linux and also point them to an excellent online tutorial to help them learn far more about using IronPython than I could ever cover in a 45 minute talk.

I had a few hesitations about including this reference in my talk.  I didn't know anything about the author except that his screen name was Fuzzyman and he had a personal blog that was subtitled, "the strange and deluded ramblings of a rather odd person."  However, I really liked the simple tutorial and I was incredibly happy to have some nice Linux samples to show the OSCON crowd.  I was most grateful at the time to this person that I'd never met for helping me out of this jam.

Fuzzyman turned out to be Michael Foord and one of the authors of the book you have in your hands now.  Since that first online tutorial, Michael has been helping people learn to use IronPython through more online samples, presentations at conferences and through active contributions to the IronPython users mailing list.  I couldn't think of anyone better to show people how to get started and how to get the most out of IronPython.

I've spent my career building programming languages and libraries targeted at other developers.  This means that the software that I write is used directly by a small number of people and it's incredibly hard for me to explain to non-developers what I do.  The only reason this kind of stuff has value is because of the useful or fun programs that other developers build using it.  This book should give you everything you need to get started working with IronPython.  I hope it will make your development more fun or at least more productive.  Now go out and build something cool.

Comments