IronPython 1.0 is Born 285
dougblank writes "IronPython version 1.0 was just released after 3 years of development. Jim Hugunin, the creator of Jython and the lead developer of the Shared Source IronPython, made the birth announcement earlier this week. From the announcement: 'I wanted to understand how Microsoft could have screwed up so badly that the CLR was a worse platform for dynamic languages than the JVM... I found that Python could run extremely well on the CLR — in many cases noticeably faster than the C-based implementation. [...] Shipping IronPython 1.0 isn't the end of the road, but rather the beginning. Not only will we continue to drive IronPython forward but we're also looking at the bigger picture to make all dynamic languages deeply integrated with the .NET platform and with technologies and products built on top of it. I'm excited about how far we've come, but even more excited by what the future holds!'"
Re:Yes, but.... (Score:3, Informative)
Is it as easy to learn as [Microsoft's] Visual Basic?
Can it be used to create GUIs, add [business] logic to these GUIs as easily as VB?
Re:Yes, but.... (Score:1, Informative)
About speed. (Score:5, Informative)
Actually, that's not really something to be proud about (though I'm not downplaying the huge achievement of running python on the CLR). The C implementation of Python is not very optimised, and that's why projects like PyPy or psyco are trying to speed Python up (and succeeding very well). I've had CPU-intensive scripts (such as SortSize [poromenos.org]) run tens of times faster with psyco, by just adding a line of code to my script.
Link is unreadable! Jeez! (Score:5, Informative)
Jim Hugunin Jim.Hugunin at microsoft.com
Tue Sep 5 13:27:12 PDT 2006
* Previous message: [IronPython] ipy support in msxsl:script blocks
* Next message: [IronPython] [ANN] IronPython 1.0 released today!
* Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm extremely happy to announce that we have released IronPython 1.0 today!
http://www.codeplex.com/IronPython [codeplex.com]
I started work on IronPython almost 3 years ago. My initial motivation for the project was to understand all of the reports that I read on the web claiming that the Common Language Runtime (CLR) was a terrible platform for Python and other dynamic languages. I was surprised to read these reports because I knew that the JVM was an acceptable platform for these languages. About 9 years ago I'd built an implementation of Python that ran on the JVM originally called JPython and later shortened to Jython. This implementation ran a little slower than the native C-based implementation of Python (CPython), but it was easily fast enough and stable enough for production use - testified to by the large number of Java projects that incorporate Jython today.
I wanted to understand how Microsoft could have screwed up so badly that the CLR was a worse platform for dynamic languages than the JVM. My plan was to take a couple of weeks to build a prototype implementation of Python on the CLR and then to use that work to write a short pithy article called, "Why the CLR is a terrible platform for dynamic languages". My plans quickly changed as I worked on the prototype, because I found that Python could run extremely well on the CLR - in many cases noticeably faster than the C-based implementation. For the standard pystone benchmark, IronPython on the CLR was about 1.7x faster than the C-based implementation.
The more time I spent working on IronPython and with the CLR, the more excited I became about its potential to finally deliver on the vision of a single common platform for a broad range of languages. At that same time, I was invited to come out to Microsoft to present IronPython and to talk with members of the CLR team about technical issues that I was running into. I had a great time that day working through these issues with a group of really smart people who all had a deep understanding of virtual machines and language implementation. After much reflection, I decided to join the CLR team at Microsoft where I could work with the platform to make it an even better target for dynamic languages and be able to have interesting technical discussions like that every day.
The first few months at Microsoft were a challenge as I learned what was involved in working at a large company. However, once the initial hurdle was over I started experiencing the things that motivated me to come here in the first place. The team working on dynamic languages in general and IronPython in particular began to grow and I got to have those great technical discussions again about both how to make IronPython as good as it could be and how to make the CLR an even better platform. We began to take advantage of the great new features for dynamic languages already shipping in
We were also able to release IronPython publicly from Microsoft with a BSD-style license. In the agile spirit of the project, we put out a new release of IronPython once every three weeks (on average) over the course of the project. This helped us connect well with our daring early adopters and receive and incorporate their feedback to make IronPython better. We've had countless excellent discussions on the mailing list on everything from supporting value types to calling over
Re:Faster than C? (Score:5, Informative)
Re:Sometimes I feel like a Luddite... (Score:4, Informative)
Besides, if it gets to the point where Microsoft is officially supporting it, it would be a major addition to the
Bad article summary... (Score:3, Informative)
If you read the whole comment, you will see that in fact, the CLR implementation does very well, the designer is now at MS working on the CLR, and all in all, IronPython is a decent Python implementation.
Given this work and the F# compiler work http://research.microsoft.com/fsharp/fsharp.aspx [microsoft.com], I think CLR is done quite well as a language independent platform. Also, given the excellent work of the Mono and Portable
Re:Dealing with UI (Score:1, Informative)
Re:Yes, but.... (Score:5, Informative)
IronPython on Mono howto [google.com]
IronPython screencast (Score:4, Informative)
Comment removed (Score:3, Informative)
Re:Dealing with UI (Score:3, Informative)
It would be interesting to see how similar wxPython is to wx.NET with Python.
Re:Yes, but.... (Score:5, Informative)
No, it is not as easy for non-programmers.
Can it be used to create guis...? Yes it can. At some point it could be made as easy as it is in VB.net; if I were on the development team then that would not be high on my priority list. Leave the toy languages for interactive GUI prototyping, and leave IronPython for code-driven development. However, that's just me and other people have different itches they want scratched.
I see IronPython as a very valuable development and it will make interacting with standard Microsoft-only developers on windows much easier since I will now be able to use a language I like while maintaining 100% compatability and interoperability.
Re:Visual Studio? (Score:4, Informative)
Typical Slashdot... (Score:4, Informative)
The whole (and far less baiting) summary:
I started work on IronPython almost 3 years ago. My initial motivation for the project was to understand all of the reports that I read on the web claiming that the Common Language Runtime (CLR) was a terrible platform for Python and other dynamic languages. I was surprised to read these reports because I knew that the JVM was an acceptable platform for these languages. About 9 years ago I'd built an implementation of Python that ran on the JVM originally called JPython and later shortened to Jython. This implementation ran a little slower than the native C-based implementation of Python (CPython), but it was easily fast enough and stable enough for production use - testified to by the large number of Java projects that incorporate Jython today.
I wanted to understand how Microsoft could have screwed up so badly that the CLR was a worse platform for dynamic languages than the JVM. My plan was to take a couple of weeks to build a prototype implementation of Python on the CLR and then to use that work to write a short pithy article called, "Why the CLR is a terrible platform for dynamic languages". My plans quickly changed as I worked on the prototype, because I found that Python could run extremely well on the CLR - in many cases noticeably faster than the C-based implementation. For the standard pystone benchmark, IronPython on the CLR was about 1.7x faster than the C-based implementation.
The more time I spent working on IronPython and with the CLR, the more excited I became about its potential to finally deliver on the vision of a single common platform for a broad range of languages. At that same time, I was invited to come out to Microsoft to present IronPython and to talk with members of the CLR team about technical issues that I was running into. I had a great time that day working through these issues with a group of really smart people who all had a deep understanding of virtual machines and language implementation. After much reflection, I decided to join the CLR team at Microsoft where I could work with the platform to make it an even better target for dynamic languages and be able to have interesting technical discussions like that every day.
The first few months at Microsoft were a challenge as I learned what was involved in working at a large company. However, once the initial hurdle was over I started experiencing the things that motivated me to come here in the first place. The team working on dynamic languages in general and IronPython in particular began to grow and I got to have those great technical discussions again about both how to make IronPython as good as it could be and how to make the CLR an even better platform. We began to take advantage of the great new features for dynamic languages already shipping in
We were also able to release IronPython publicly from Microsoft with a BSD-style license. In the agile spirit of the project, we put out a new release of IronPython once every three weeks (on average) over the course of the project. This helped us connect well with our daring early adopters and receive and incorporate their feedback to make IronPython better. We've had countless excellent discussions on the mailing list on everything from supporting value types to calling overloaded methods. Without the drive and input of our users, IronPython would be a much weaker project.
IronPython is about bringing together two worlds. The key value in IronPython is that it is both a true implementation of Python and is seamlessly integrated with the
cheers to the IP team (Score:4, Informative)
They've been very helpful on the mailing list, checking in any bugs/differences to CPython behaviour and getting it sorted and into builds available for use.
Re:Yes, but.... (Score:2, Informative)
Re:Parrot (Score:4, Informative)
2. The CLR is optimized for static languages, but not innefficient for dynamic ones. In fact, that's all the article is about.
3. RTFA!
Re:Sometimes I feel like a Luddite... (Score:3, Informative)
The danger to this plan is that you might find it hard to go back.
If that's just too much, try Ruby. My understanding is that its aesthetics come from Perl, which will probably let you "do your thing", whatever that is.
Python's better than JScript and you can build full, real apps in it, too.
I'm not saying this to "advocate Python", as evidenced by my Ruby suggestion. You'll be a better developer for trying it; everybody should learn a new language every couple of years, to keep in practice. And you might understand the C# features coming down the pike like closures that much better for developing in another environment that has them.
Re:Hrm (Score:4, Informative)
Yes, you can, though not all builtins are available. All you need is this line in IronPython\Lib\site.py:
import syssys.path.append(r"E:\python24\lib")
As for the rest of your comment: You do realize, that there are Python programmers on Windows ? I enjoy happily the ActivePython distribution, with which I can even automate my deskopt/applications. Now, in addition, I have full access to the
I consider this to be one of the best software-relases within the last few months.
Re:Yes, but.... (Score:3, Informative)
Boo is not Python, but rather a middle ground between C# and Python. It is an easy to learn statically typed functional language with a Python inspired syntax.
Re:Sometimes I feel like a Luddite... (Score:5, Informative)
I think IronPython compiles down to CLR bytecode, so if you're shipping managed C#, you could just as well ship IronPython and nobody would notice, which is the entire point of this article in the first place.
However, whether or not you could benefit from learning Python is a decision only you can make. Python may increase your productivity 2-3x over C# or more (and that's fairly conservative, usually), but only after you learn it, which could be months.
However, if you end up always choosing the short-term expedient answer of sticking with the language you know (and the environment you know), you lose out on any productivity gain you might get from another environment or language; this is a general point, not one specific to this case.
In general, the "common environments" (Java,
Again, I'm not trying to push you, just point out that for the costs there are benefits, too. I say what I'm saying because I believe (and see) too many developers trapping themselves in local maxima by always making the short-term decision. Ultimately, it's no skin off my nose.
You can, but the lack of namespacing starts to get troublesome as you start trying to build libraries, or use the libraries of others. Later versions of Javascript, which JScript will presumably track, will help with this a lot. Although based on what I see, it's nearly learning a new language anyhow. (In fact, the next version of Javascript [mozilla.org] borrows a lot from Python; generators are basically from Python, array comprehensions are from Haskell IIRC but the syntax is the Python one, and the most main-stream language with de-structuring assignment is Python.)
Re:Sometimes I feel like a Luddite... (Score:1, Informative)
Re:Hrm (Score:5, Informative)
Consider the way every object can implement a fallback method that is called if somebody invokes "foo.bar" and bar does not exist in foo. It implies that every single method invocation must be identified by string not a number, and matched by string comparison.
It doesn't imply that at all. Smalltalk implementations figured out how to make that fast decades ago. The initial, most obvious, step is to hash method selectors so the lookups are done with numbers and to create a hashtable (either per-class, or global, with a sparse structure) for looking up method addresses given method selectors. There are a few optimizations that can be applied to make that pretty fast -- on the order of two or three times slower than C++-style vtable lookups. Next, many dynamic language implementations take advantage of the fact that nearly all method invocations are static -- the same line of code always calls the same method on objects of the same class, so there's no real reason to do any lookup at all. Such systems statically or dynamically rewrite the code, turning it into a simple test that the target object is of the "right" type, and then jumping directly to the method. Further, most method invocations can be proven at compile time (or at run-time, whichever is more convenient) to always go to the same target class, so even the object type test can be optimized away. Oh, and if it makes sense they can inline the method as well.
That's just the little that I've read about, too. This stuff has been heavily researched by very smart people for a very long time now. The net effect is that lots of dynamic language implementations approach C code in performance, on average, and there are situations in which they can produce code that is even faster than a C compiler could, because they can make use of run-time information which is unavailable to any compiler that translates to "static" machine code.
Python implementations may need work to make them faster, but there's nothing that says the language has to be slow.
Re:Yes, but.... (Score:5, Informative)
Re:Hrm (Score:4, Informative)
And if you want speed, I have two words: Boost.Python [boost.org]. It makes wrapping C++ code into Python near-trivial; I just wish they had some sort of quick-start documentation. I was intimidated by Boost.Python until I sat down to work with it. Sample (cleaned up) fragment from production code: That little snippet exposes the Loader class to Python. Boost will take care of wrapping the code up into a Python shared library (.pyd), exposing the interface, converting between standard Python types and STL types, even converting C++ exceptions to Python exceptions.
And if you don't want to go there, you could also use ctypes (part of the std Python distribution) and drive any win32 DLL using Python, unchanged.
Re:Yes, but.... (Score:2, Informative)
Except that in another comment there's a link to instructions on how to get IronPython working with Mono [google.com]. They amount to replacing the csc compiler (MS C#) with gmcs (Mono C#), and fixing a mkdir statement. You can't complain about that level of portability.
Re:Hrm (Score:3, Informative)
It doesn't have to be this way. Take Objective-C for an example. All messages are identified by a selector which is actually just a plain old C string. Take for example [NSView -frame] which returns an NSRect giving the frame (window) size and location. FYI the syntax in objective-C to call it is NSRect frameRect = [someView frame]; If it were more C/Java like syntax it'd be NSRect frameRect = someView->frame();.
Anyway, getting back to the point: The way the compiler compiles this is a call to objc_msgSend(someView, ___selector_for_frame___) where ___selector_for_frame__ is simply a C string. Recall that C strings are simply pointers to an array of char. What the compiler does is unique all references within a single compilation unit (a .o file) such that all uses use the same pointer. Furthermore, the link editor (ld) sets things up such that they all point to the same thing within the executable or library or framework you are linking. Then, the dynamic linker ensures this when it loads in dynamic code. This way, the runtime need only do a comparison of the pointer itself (where in memory it is pointing) rather than checking what it's actually pointing to.
Basically, that is to say that the test someSelector == someOtherSelector actually works. It is not necessary for the runtime to do strcmp(someSelector, someOtherSelector) == 0.
I assume similar tricks are used in other dynamic languages. I only mention Objective-C because it seems to be the one with a bunch of publicly available documentation on its inner workings.
Re:Yes, but.... (Score:3, Informative)
http://www.voidspace.org.uk/python/weblog/arch_d7
Re:Sometimes I feel like a Luddite... (Score:3, Informative)
1. There were around 25 people working on our product, with people spread around the province (not state
2. We used UML and well-defined interfaces in the form of abstract base classes that were implemented using the staticmethod decorator. An "interface" keyword would have been nice, mind you. Obviously, these interfaces were hammered out before any coding started.
3. Can you clarify the namespace question? Python uses packages and modules aligned along directories much like Java does.
4. Python has built-in support for unit tests. It is considered a part of the "Python way" to use them.
5. We are scaling with hardware, and that works rather well. But you're right, the Python world could really use a JBoss or similar. I guess Zope sort of fits that bill, but I've never been able to figure it out.
6. Object management is a good question. Originally, we cached our objects to prevent bottlenecking the database with reads. Later, we hit on the bright idea of a fully stateless system where every method is decorated with the classmethod keyword. So objects do not maintain state, because no objects are allocated - everything is a class method (obviously, we do create lots of temporary objects to complete tasks, but these lifetimes don't outlast the method they're in). On the downside, every time a request comes in, it means an entirely new Python instance with all the classes needs to be created. Happily, mod_python can cache interpreter instances so multiple requests can come in to our stateless system without causing huge delays. But any time you want to retrieve state, it means a database hit...such is the price of simplicity. Kind of embarrassingly, we got the idea for a fully stateless system from a
7. It's not an amazing undertaking. Lots of people are using Python as the back-end these days for their transactional systems. Read about the Django project for some cool examples. Django is a fine piece of work. So is Twisted, which we were originally going to use as well.
8. We chose Python for speed of development and language features. Like Peter Norvig of Lisp and Google fame says, Python is Lisp with a conventional syntax. Practically everything in software boils down to operations on lists of objects. So language features like list comprehensions and dynamic yet strong typing, plus strong support for unit tests, made Python an easy choice. And pydoc is just like javadoc, so we get class documentation for free.
9. I can write "Hello, world" in C in a single line
Anyway, thanks for all the questions. To be honest, I'm off that project now, and I'm looking for contract work, which will probably end up being Java...
Re:Sometimes I feel like a Luddite... (Score:3, Informative)