IronPython is a .NET implementation of Python, written by Jim Hugunin. It’s now reached v0.7.6, and has been released on microsoft.com (via Mike Gunderloy). What’s really impressive is that IronPython is faster than Python 2.3.
After five years of guiding generics for the Microsoft .NET Framework into Visual Studio 2005, I’ve turned my attention to attempting to achieve a synthesis between type-safe, scalable, math-oriented scripting and programming for .NET. I believe the industry needs to do more for scientists and mathematicians, where the demand for this kind of language is great.
And no, he’s not kidding when he said that it’s taken him five years to see generics through from the first academic paper to their industry-wide acceptance in .NET 2.0. I can understand why he now wants to do something smaller! You can grab the latest version of F# from http://research.microsoft.com/research/downloads.
This month’s MSDN magazine also has a great article by Joel Pobar on the cost of reflection in .NET languages. Or at least, it’s great if you worry about things like the performance implications of late-binding vs. early-binding, and whether you’re getting the best benefit out of the MemberInfo cache. If you’re that kind of low-level performance-frobbing bit-twiddling freak, you’ll love this article 🙂 (via Brad Abrams)
Finally, here’s some IronPython and F# to whet your appetites. IronPython first (from TheServerSide.NET):
from System.Windows.Forms import *
from System.Drawing import *
f = Form(Text=”Windows fun with IronPython”, HelpButton=True,
f.FormBorderStyle = FormBorderStyle.FixedDialog
f.StartPosition = FormStartPosition.CenterScreen
b1 = Button(Text=”Say Something”, Location=Point(30,30), Size=Size(200,30))
def push(data, event):
l = Label(Text=”IronPython Lives!”, ForeColor=Color.Red)
l.Location = Point(30, 50+f.Controls.Count*25)
b1.Click += push
And here’s some F# (from Don’s article):
let DistanceFromAverage (a,b,c) =
let avg = (a+b+c) / 3.0 in
let diff(x) = (avg – x)*(avg – x) in
Math.Sqrt(diff(a) + diff(b) + diff(c))