IronPython
   HOME

TheInfoList



OR:

IronPython is an implementation of the
Python programming language Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Python is dynamically-typed and garbage-collected. It supports multiple programming p ...
targeting the
.NET Framework The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
and
Mono Mono may refer to: Common meanings * Infectious mononucleosis, "the kissing disease" * Monaural, monophonic sound reproduction, often shortened to mono * Mono-, a numerical prefix representing anything single Music Performers * Mono (Japanese b ...
. Jim Hugunin created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006. IronPython 2.0 was released on December 10, 2008. After version 1.0 it was maintained by a small team at
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washin ...
until the 2.7 Beta 1 release. Microsoft abandoned IronPython (and its sister project
IronRuby IronRuby is an implementation of the Ruby programming language targeting Microsoft .NET Framework. It is implemented on top of the Dynamic Language Runtime (DLR), a library running on top of the Common Language Infrastructure that provides dynam ...
) in late 2010, after which Hugunin left to work at Google. The project is currently maintained by a group of volunteers at
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continu ...
. It is free and open-source software, and can be implemented with Python Tools for Visual Studio, which is a free and open-source extension for Microsoft's
Visual Studio Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms such ...
IDE. IronPython is written entirely in C#, although some of its code is automatically generated by a
code generator In computing, Code generation denotes software techniques or systems that generate program code which may then be used independently of the generator system in a runtime environment. Specific articles: * Code generation (compiler), a mechanism to pr ...
written in Python. IronPython is implemented on top of the
Dynamic Language Runtime The Dynamic Language Runtime (DLR) from Microsoft runs on top of the Common Language Runtime (CLR) and provides computer language services for dynamic languages. These services include: * A dynamic type system, to be shared by all languages using ...
(DLR), a library running on top of the Common Language Infrastructure that provides dynamic typing and dynamic method dispatch, among other things, for dynamic languages. The DLR is part of the .NET Framework 4.0 and is also a part of Mono since version 2.4 from 2009. The DLR can also be used as a library on older CLI implementations.


Status and roadmap

* Release 2.0, released on December 10, 2008, and updated as 2.0.3 on October 23, 2009, targets CPython 2.5. IronPython 2.0.3 is only compatible up to .NET Framework 3.5. * Release 2.6, released on December 11, 2009, and updated on April 12, 2010, targets CPython 2.6. IronPython 2.6.1 versions is binary compatible only with .NET Framework 4.0. IronPython 2.6.1 must be compiled from sources to run on .NET Framework 3.5. IronPython 2.6.2, released on October 21, 2010, is binary compatible with both .NET Framework 4.0 and .NET Framework 3.5. * Release 2.7 was released on March 12, 2011 and it targets CPython 2.7. * Release 2.7.1 was released on October 21, 2011 and it targets CPython 2.7. * Release 2.7.2.1 was released on March 13, 2012. It enables support for
ZIP file format ZIP is an archive file format that supports lossless data compression. A ZIP file may contain one or more files or directories that may have been compressed. The ZIP file format permits a number of compression algorithms, though DEFLATE is th ...
libraries,
SQLite SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the m ...
, and compiled executables. * Release 2.7.4 was released on September 7, 2013. * Release 2.7.5 was released on December 6, 2014 and mostly consists of bug fixes. * Release 2.7.6 was released on August 21, 2016 and only consists of bug fixes. * Release 2.7.7 was released on December 7, 2016 and only consists of bug fixes. * Release 2.7.8 was released on February 16, 2018 and consists of bug fixes, reorganized code, and an updated test infrastructure (including significant testing on
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, w ...
under
Mono Mono may refer to: Common meanings * Infectious mononucleosis, "the kissing disease" * Monaural, monophonic sound reproduction, often shortened to mono * Mono-, a numerical prefix representing anything single Music Performers * Mono (Japanese b ...
). It is also the first release to support
.NET Core The domain name net is a generic top-level domain (gTLD) used in the Domain Name System of the Internet. The name is derived from the word ''network'', indicating it was originally intended for organizations involved in networking technologies ...
. * Release 2.7.9 was released on October 9, 2018 and consists of bug fixes, reorganized code. It is intended to be the last release before IronPython 3. * Release 2.7.10 was released on April 27, 2020 and adds .NET Core 3.1 support. * Release 2.7.11 was released on November 17, 2020 and resolves issues when running on
.NET 5 The domain name net is a generic top-level domain (gTLD) used in the Domain Name System of the Internet. The name is derived from the word ''network'', indicating it was originally intended for organizations involved in networking technologies ...
. * Release 2.7.12 was released on January 21, 2022 and resolves issues with .NET 6 and removes support for .NET core 2.1


Differences with CPython

There are some differences between the Python reference implementation CPython and IronPython. Some projects built on top of IronPython are known not to work under CPython. Conversely, CPython applications that depend on extensions to the language that are implemented in C are not compatible with IronPython , unless they are implemented in a .NET interop. For example, NumPy was wrapped by Microsoft in 2011, allowing code and libraries dependent on it to be run directly from .NET Framework.


Silverlight

IronPython is supported on
Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich web applications, similar to Adobe Inc., Adobe's Run time environment, runtime, Adobe Flash. A plugin for Silverlight is still available for a v ...
(which is deprecated by Microsoft and already has lost support in most web browsers). It can be used as a scripting engine in the browser just like the
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
engine. IronPython scripts are passed like simple client-side JavaScript scripts in // Client-side script passed to IronPython and Silverlight. The same works for
IronRuby IronRuby is an implementation of the Ruby programming language targeting Microsoft .NET Framework. It is implemented on top of the Dynamic Language Runtime (DLR), a library running on top of the Common Language Infrastructure that provides dynam ...
.


License

Until version 0.6, IronPython was released under the terms of Common Public License. Following recruitment of the project lead in August 2004, IronPython was made available as part of Microsoft's
Shared Source The Shared Source Initiative (SSI) is a source-available software licensing scheme launched by Microsoft in May 2001. The program includes a spectrum of technologies and licenses, and most of its source code offerings are available for download aft ...
initiative. This license is not
OSI OSI may refer to: Places * Osijek Airport (IATA code: OSI), an airport in Croatia * Ősi, a village in Veszprém county, Hungary * Oši, an archaeological site in Semigallia, Latvia * Osi, a village in Ido-Osi, Ekiti State, Nigeria * Osi, Ekiti ...
-approved but the authors claim it meets the open-source definition. With the 2.0 alpha release, the license was changed to the Microsoft Public License, which the OSI has approved. The latest versions are released under the terms of the Apache License 2.0.


Interface extensibility

One of IronPython's key advantages is in its function as an extensibility layer to application frameworks written in a .NET language. It is relatively simple to integrate an IronPython interpreter into an existing .NET application framework. Once in place, downstream developers can use scripts written in IronPython that interact with .NET objects in the framework, thereby extending the functionality in the framework's interface, without having to change any of the framework's code base. IronPython makes extensive use of
reflection Reflection or reflexion may refer to: Science and technology * Reflection (physics), a common wave phenomenon ** Specular reflection, reflection from a smooth surface *** Mirror image, a reflection in a mirror or in water ** Signal reflection, in ...
. When passed in a reference to a .NET object, it will automatically import the types and methods available to that object. This results in a highly intuitive experience when working with .NET objects from within an IronPython script.


Examples

The following IronPython script manipulates .NET Framework objects. This script can be supplied by a third-party client-side application developer and passed into the server-side framework through an interface. Note that neither the interface, nor the server-side code is modified to support the analytics required by the client application. from BookService import BookDictionary booksWrittenByBookerPrizeWinners = ook.Title for book in BookDictionary.GetAllBooks() if "Booker Prize" in book.Author.MajorAwards In this case, assume that the .NET Framework implements a class, BookDictionary, in a module called BookService, and publishes an interface into which IronPython scripts can be sent and executed. This script, when sent to that interface, will iterate over the entire list of books maintained by the framework, and pick out those written by Booker Prize-winning authors. What's interesting is that the responsibility for writing the actual analytics reside with the client-side developer. The demands on the server-side developer are minimal, essentially just providing access to the data maintained by the server. This design pattern greatly simplifies the deployment and maintenance of complex application frameworks. The following script uses the .NET Framework to create a simple Hello World message. import clr clr.AddReference("System.Windows.Forms") from System.Windows.Forms import MessageBox MessageBox.Show("Hello World")


Performance

The performance characteristics of IronPython compared to
CPython CPython is the reference implementation of the Python programming language. Written in C and Python, CPython is the default and most widely used implementation of the Python language. CPython can be defined as both an interpreter and a compi ...
, the reference implementation of Python, depends on the exact benchmark used. IronPython performs worse than CPython on most benchmarks taken with the PyStone script but better on other benchmarks. IronPython may perform better in Python programs that use threads or multiple cores, as it has a
JIT Jit (also known as jiti, jit-jive and the Harare beat) is a style of popular Zimbabwean dance music. It features a swift rhythm played on drums and accompanied by a guitar. Jit evolved out many diverse influences, including domestic chimurenga, ...
compiler, and also because it doesn't have the
Global Interpreter Lock A global interpreter lock (GIL) is a mechanism used in computer-language interpreters to synchronize the execution of threads so that only one native thread (per process) can execute at a time. An interpreter that uses GIL always allows exactly o ...
.


See also

* Boo – a language for the
.NET Framework The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
and Mono with Python-inspired syntax and features borrowed from C# and
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...
* Cobra *
IronScheme IronScheme is an implementation of the Scheme programming language targeting the Microsoft .NET Framework. IronScheme is a complete rewrite of IronLisp, incorporating lessons learnt while developing IronLisp. IronScheme was planning to build upon ...
* Jython – an implementation of
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
for the Java Virtual Machine *
Cython Cython () is a programming language that aims to be a superset of the Python programming language, designed to give C-like performance with code that is written mostly in Python with optional additional C-inspired syntax. Cython is a compiled ...
*
PyPy PyPy () is an implementation of the Python programming language. PyPy often runs faster than the standard implementation CPython because PyPy uses a just-in-time compiler. Most Python code runs well on PyPy except for code that depends on CPyth ...
– a self-hosting interpreter for the Python programming language *
Tao Framework For 3D computer graphics, the Tao Framework is a C# library giving .NET and Mono developers access to popular graphics and gaming libraries like OpenGL and SDL. It was originally developed by the C# OpenGL programmer Randy Ridge, and since ...
*
Unladen Swallow CPython is the reference implementation of the Python programming language. Written in C and Python, CPython is the default and most widely used implementation of the Python language. CPython can be defined as both an interpreter and a compi ...
– A (now-defunct) branch of CPython that aimed to provide superior performance using an
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate repre ...
-based just-in-time compiler


References


External links

* {{Microsoft development tools .NET programming languages Free software programmed in C Sharp Microsoft free software Microsoft programming languages Python (programming language) implementations Python (programming language) libraries Software using the Apache license 2006 software