IronPython is a new implementation of the Python language targeting the Common Language Runtime (CLR). It compiles python programs into bytecode (IL) that will run on either Microsoft's .NET or the Open Source Mono platform. IronPython includes an interactive interpreter and transparent on-the-fly compilation of source files just like standard Python.
All development of IronPython to date has been performed by Jim Hugunin. This is the first public release of the IronPython source and binaries.
This is a pre-alpha release. It's suitable for experimenting and playing with; however, a large amount of testing, packaging and library development remains to be done before a production-quality IronPython-1.0. The only two Python programs that I know for sure run on IronPython are pystone.py and the parrotbench benchmark/test-suite. Of course, IronPython is the only Python implementation other than CPython-2.3 that can successfully run the parrotbench benchmark/test-suite, so this shows that the implementation can handle the majority and trickiest parts of Python's core semantics successfully.
IronPython requires either .Net-1.1 or Mono-1.0 be installed on your system.
After unzipping IronPython-0.6.zip, you can complete the installation by adding the included 'bin' directory to your PATH. To test your installation, you should launch the interactive interpreter as shown below:
C:\IronPython-0.6\bin>IronPythonConsole >>> 2+2 4
If you're using Mono on Windows, you can launch the interpreter like this:
C:\IronPython-0.6\bin>c:\Mono-1.0\bin\mono IronPythonConsole.exe >>>
IronPython should run under Mono on Linux; however, this has not been tested. You're likely to have to do a little more work to get things configured correctly to run on Linux.
You can use IronPython to run python scripts by passing the script name on the command-line just as with standard Python. Most of the standard Python library is not currently implemented, so it is unlikely that many existing Python scripts will run successfully under this early alpha release of IronPython-0.6.
Instead of a user's manual, you get two paragraphs of help. Sorry.
Using IronPython should be fairly straight-forward. Since it's an implementation of the Python language, you should be able to use all of the language constructs that you're familiar with. By default, IronPython doesn't ship with any of the standard Python library, so if you wish to use these libraries you'll have to provide them yourself.
Using CLR libraries should also be mostly obvious. See the trivial example code in the examples directory if you need help getting started. The one challenge that you're likely to encounter is having IronPython find any assemblies that are even a little bit out of the ordinary. Two special functions have been added to the sys module to make this easier. They're called sys.LoadAssemblyByName(name) and sys.LoadAssemblyFromFile(filename). They both return None. They are used to populate the list of known assemblies to make import statements work and to fill in types to packages. Here are two examples.
>>> from System import Web >>> dir(Web) ['AspNetHostingPermissionLevel', 'AspNetHostingPermissionAttribute', 'AspNetHost ingPermission'] >>> import sys >>> sys.LoadAssemblyByName("System.Web") >>> dir(Web) ['MultipartContentElement', 'HttpStatus', 'FindFileData', 'FileAction', 'HttpFil eResponseElement', 'HttpStaticObjectsCollection', 'AspNetHostingPermission', 'As yncAppEventHandler', 'HttpAsyncResult', 'HttpDebugHandlerTimeLog', 'HttpDictiona ... StateProtocolExclusive', 'TraceContext', 'SecurityErrorFormatter', 'IHttpRespons eElement', 'HttpApplicationStateLock', 'HttpMultipartContentTemplateParser', 'Sa feNativeMethods', 'AspNetHostingPermissionAttribute', 'RequestQueue']
>>> import sys >>> import AgentServerObjects IronPython.Objects.PythonImportError: can't load AgentServerObjects at IronPython.Objects.module.Import(String fullName, Boolean keepTop) at IronPython.Objects.Ops.Import(module mod, String fullName) at input_3.Run(Frame frame) at IronPythonConsole.IronPython.DoInteractive() >>> sys.LoadAssemblyFromFile("./Interop.AgentServerObjects.dll") >>> import AgentServerObjects >>>
Currently, the only build system for IronPython uses Visual Studio .Net 2003. You should be able to easily get started with this from the IronPython.sln file in the top-level directory.
The build process otherwise should be extremely straight-forward. The only non-obvious part of the build is the tiny library SystemUtil.dll which is built by the UtilLibraryBuilder program. The easiest thing to do is to use the copy of SystemUtil.dll provided in the bin directory when rebuilding.
In addition to further development work, there are several open design questions that must be answered before a 1.0 release. Here are a few of those.
I'm sure that more items will be added to this list as time goes on.
Virtually all of the code is licensed under the Common Public License, version 1.0 (see cpl-v10.html). In the IronPython system itself there are two exceptions to this rule in IronMath/ExternalCode and IronPython/ExternalCode. If you enable the flag "ONLY_JIMS_CODE", then none of this external code will be used and the system will be entirely licensed under the CPL. Using this flag will disable division of Python longs and will switch from the Python-optimized sort algorithm to the generic CLR sort library code.
The code in tests is available under a variety of different licenses and you should read the "LICENSE" file in each test sub-directory for license terms.