Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
IronPython
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Python programming language implementation}} {{primary sources|date=January 2013}} {{Infobox software | name = IronPython | logo = [[File:IronPython 3 logo.svg|64px]]<br />[[File:Ironpython-logo.png|200px]] | logo alt = | logo caption = | author = [[Jim Hugunin]], [[Microsoft]] | developer = Dino Viehland,<br />[[.NET Foundation]] | released = {{Release date and age|2006|09|05}}<ref>{{Cite web|url=http://ironpython.codeplex.com/releases/view/423|title=CodePlex Archive|access-date=2014-05-30|archive-date=2017-12-26|archive-url=https://web.archive.org/web/20171226082609/http://ironpython.codeplex.com/releases/view/423|url-status=dead}}</ref> | discontinued = <!-- Set to yes if software is discontinued, otherwise omit. --> | latest release version = 3.4.2 | latest release date = {{start date and age|2024|12|20}} | latest preview version = 3.4.0-beta1 | latest preview date = {{start date and age|2022|04|30}} | programming language = [[C Sharp (programming language)|C#]] | operating system = [[Microsoft Windows|Windows]], [[Linux]], [[macOS]] | platform = [[.NET Framework]], [[.NET]], [[Mono (software)|Mono]] | genre = [[Python (programming language)|Python programming language]] implementation | license = [[Apache License 2.0]] }} '''IronPython''' is an implementation of the [[Python (programming language)|Python programming language]] targeting the [[.NET]] and [[Mono (software)|Mono]] frameworks. The project is currently maintained by a group of [[volunteers]] at [[GitHub]]. 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]] IDE.<ref>{{cite web|title=IronPython.net|url=http://www.ironpython.net|access-date=2013-07-03}}</ref><ref>{{cite web|title=Python Tools for Visual Studio- Home|url=http://pytools.codeplex.com/|work=Python Tools for Visual Studio|access-date=2013-07-03|archive-date=2018-01-26|archive-url=https://web.archive.org/web/20180126035502/http://pytools.codeplex.com/|url-status=dead}}</ref> IronPython is written entirely in [[C Sharp (programming language)|C#]], although some of its code is automatically generated by a [[source code generation|code generator]] written in Python. IronPython is implemented on top of the [[Dynamic Language Runtime]] (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.<ref>{{cite web|url=http://msdn.microsoft.com/en-us/library/dd233052.aspx|title=Dynamic Language Runtime Overview|publisher=[[Microsoft]]|access-date=2014-04-01}}</ref> The DLR is part of the .NET Framework 4.0 and is also a part of Mono since version 2.4 from 2009.<ref>{{Cite web|url=https://github.com/mono/mono/commit/340222ffe8b958cd22d9eb0388488f326845b363|title = 2009-07-02 Marek Safar Β· mono/Mono@340222f|website = [[GitHub]]}}</ref> The DLR can also be used as a library on older CLI implementations. == Status and roadmap == [[Jim Hugunin]] created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006.<ref>{{cite web | url = http://blogs.msdn.com/hugunin/archive/2006/09/05/741605.aspx | title = Jim Hugunin's blog: IronPython 1.0 released today! | date = 2006-09-05 | access-date = 2006-12-14 }}</ref> IronPython 2.0 was released on December 10, 2008.<ref>{{cite web | url = http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=8365 | title = Release dates for ironpython | date = 2008-12-10 | access-date = 2009-01-25 }}</ref> After version 1.0 it was maintained by a small team at [[Microsoft]] until the 2.7 Beta 1 release. Microsoft abandoned IronPython (and its sister project [[IronRuby]]) in late 2010, after which Hugunin left to work at Google.<ref>{{cite web | url=https://www.theregister.co.uk/2010/10/22/microsoft_kills_dynamic_languages_projects/ | title=Microsoft cuts loose Iron languages | date=2010-10-22 | last=Clarke | first=Gavin | publisher=[[The Register]] | access-date=2012-04-05 }}</ref> The project is currently maintained by a group of volunteers at [[GitHub]]. * Release 2.0, released on December 10, 2008, and updated as 2.0.3 on October 23, 2009, targets CPython 2.5.<ref>{{cite web | url=http://ironpython.codeplex.com/releases/view/30416 | title=2.0.3 | publisher=ironpython.codeplex.com | access-date=2010-10-16 | archive-date=2017-12-26 | archive-url=https://web.archive.org/web/20171226082603/http://ironpython.codeplex.com/releases/view/30416 | url-status=dead }}</ref> 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.<ref>{{cite web | url=http://ironpython.codeplex.com/releases/view/36280 | title=2.6 | publisher=ironpython.codeplex.com | access-date=2010-10-16 | archive-date=2018-01-13 | archive-url=https://web.archive.org/web/20180113101734/http://ironpython.codeplex.com/releases/view/36280 | url-status=dead }}</ref> 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.<ref>{{cite web | url=http://ironpython.codeplex.com/releases/view/54498 | title=2.7 | publisher=ironpython.codeplex.com | access-date=2011-03-12 | archive-date=2018-01-02 | archive-url=https://web.archive.org/web/20180102233741/http://ironpython.codeplex.com/releases/view/54498 | url-status=dead }}</ref> * Release 2.7.1 was released on October 21, 2011 and it targets CPython 2.7.<ref>{{cite web | url=http://ironpython.codeplex.com/releases/view/62475 | title=2.7.1 | publisher=ironpython.codeplex.com | access-date=2011-12-30 | archive-date=2017-12-26 | archive-url=https://web.archive.org/web/20171226084555/https://ironpython.codeplex.com/releases/view/62475 | url-status=dead }}</ref> * Release 2.7.2.1 was released on March 13, 2012. It enables support for [[ZIP file format]] libraries, [[SQLite]], and compiled executables.<ref>{{cite web | url=http://ironpython.codeplex.com/releases/view/74478 | title=2.7.2.1 | publisher=ironpython.codeplex.com | access-date=2012-03-24 | archive-date=2017-12-26 | archive-url=https://web.archive.org/web/20171226082357/http://ironpython.codeplex.com/releases/view/74478 | url-status=dead }}</ref> * Release 2.7.4 was released on September 7, 2013.<ref>{{cite web | url=http://ironpython.codeplex.com/releases/view/90087 | title=2.7.4 | publisher=ironpython.codeplex.com | access-date=2014-12-07 | archive-date=2018-01-16 | archive-url=https://web.archive.org/web/20180116003231/http://ironpython.codeplex.com/releases/view/90087 | url-status=dead }}</ref> * Release 2.7.5 was released on December 6, 2014 and mostly consists of bug fixes.<ref>{{cite web | url=http://ironpython.codeplex.com/releases/view/169382 | title=2.7.5 | publisher=ironpython.codeplex.com | access-date=2014-12-07 | archive-date=2018-01-26 | archive-url=https://web.archive.org/web/20180126040129/http://ironpython.codeplex.com/releases/view/169382 | url-status=dead }}</ref> * Release 2.7.6 was released on August 21, 2016 and only consists of bug fixes.<ref>{{cite web | url=https://github.com/IronLanguages/main/releases/tag/ipy-2.7.6.3 | title=2.7.6 | publisher=github.com | access-date=2016-08-21}}</ref> * Release 2.7.7 was released on December 7, 2016 and only consists of bug fixes.<ref>{{cite web | url=https://github.com/IronLanguages/main/releases/tag/ipy-2.7.7 | title=2.7.7 | publisher=github.com | access-date=2018-01-05}}</ref> * 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]] under [[Mono (software)|Mono]]). It is also the first release to support [[.NET Core]].<ref name=latestbut1Release>{{cite web | url=https://github.com/IronLanguages/ironpython2/tree/ipy-2.7.8 | title=2.7.8 | publisher=github.com | access-date=2018-01-05}}</ref> * 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.<ref name=latestRelease>{{cite web | url=https://github.com/IronLanguages/ironpython2/tree/ipy-2.7.9 | title=2.7.9 | publisher=github.com | access-date=2018-10-09}}</ref> * Release 2.7.10 was released on April 27, 2020 and adds .NET Core 3.1 support.<ref>{{Cite web|title=IronLanguages/ironpython2|url=https://github.com/IronLanguages/ironpython2|access-date=2020-06-26|website=GitHub|language=en}}</ref> * Release 2.7.11 was released on November 17, 2020 and resolves issues when running on [[.NET 5]]. * Release 2.7.12 was released on January 21, 2022 and resolves issues with .NET 6 and removes support for .NET core 2.1<ref>{{Cite web |title=Releases Β· IronLanguages/ironpython2 |url=https://github.com/IronLanguages/ironpython2/releases |access-date=2022-08-08 |website=GitHub |language=en}}</ref> * Release 3.4.0 was released on December 12, 2022 and is the first release to support Python 3.x. <ref>{{Cite web |title=Releases Β· IronLanguages/ironpython3 |url=https://github.com/IronLanguages/ironpython3/releases |access-date=2023-07-09 |website=GitHub |language=en}}</ref> === Differences with CPython === {{expand section|date=July 2012}} There are some differences between the Python reference implementation CPython and IronPython.<ref name="compcpython">{{cite web | url=http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Differences&referringTitle=Home | title=Differences between IronPython 1.0 and CPython 2.4.3 |publisher=[[Microsoft]] | date=2007-12-18 | access-date=2008-02-09}}</ref> Some projects built on top of IronPython are known not to work under CPython.<ref>{{cite web | url=http://lists.ironpython.com/pipermail/users-ironpython.com/2008-January/006297.html | title=New Project: Implementing .NET Libraries in Pure Python | last=Foord | first=Michael | access-date=2008-02-09 | archive-url=https://web.archive.org/web/20080830011024/http://lists.ironpython.com/pipermail/users-ironpython.com/2008-January/006297.html | archive-date=2008-08-30 | url-status=dead }}</ref> Conversely, CPython applications that depend on extensions to the language that are implemented in C are not compatible with IronPython ,<ref>{{cite web | url=http://dirtsimple.org/2005/10/children-of-lesser-python.html | title=Children of a Lesser Python | last=Eby |first=Phillip | date=15 October 2005 | access-date=2008-07-09}}</ref> 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.<ref>{{cite web | url=https://www.infoq.com/news/2011/07/NumPy-NET | title=NumPy and SciPy for .NET | access-date=2019-04-05}}</ref> == Silverlight == IronPython is supported on [[Silverlight]] (which is deprecated by Microsoft and already has lost support in most web browsers<ref>{{Cite web|url=https://www.microsoft.com/getsilverlight/locale/en-us/html/installation-win-SL5.html|title=Silverlight 5 System Requirements|website=www.microsoft.com|access-date=2019-11-16}}</ref>). It can be used as a scripting engine in the browser just like the [[JavaScript]] engine.<ref>{{cite web|url=http://ironpython.net/browser/|title=Write browser applications in Python |work=IronPython.net |archive-url=https://web.archive.org/web/20130317012431/http://ironpython.net/browser/ |archive-date=2013-03-17}}</ref> IronPython scripts are passed like simple client-side JavaScript scripts in <code><script></code>-tags. It is then also possible to modify embedded [[XAML]] markup. The technology behind this is called Gestalt.{{Citation needed|date=August 2009}} <syntaxhighlight lang="html"> // DLR initialization script. <script src="http://gestalt.ironpython.net/dlr-latest.js" type="text/javascript"></script> // Client-side script passed to IronPython and Silverlight. <script type="text/python"> window.Alert("Hello from Python") </script> </syntaxhighlight> The same works for [[IronRuby]]. == License == Until version 0.6, IronPython was released under the terms of [[Common Public License]].<ref name=license-orig>{{cite web |url=http://www.ironpython.com/old.html |title=Original IronPython homepage |date=2004-07-28 |access-date=2007-05-13 |url-status=dead |archive-url=https://web.archive.org/web/20100223101738/http://www.ironpython.com/old.html |archive-date=February 23, 2010 }}</ref> Following recruitment of the project lead in August 2004, IronPython was made available as part of Microsoft's [[Shared Source]] initiative. This license is not [[Open Source Initiative|OSI]]-approved but the authors claim it meets the open-source definition.<ref name=license>{{cite web | url = http://www.codeplex.com/IronPython/Project/License.aspx?LicenseHistoryId=129 | title = Shared Source License for IronPython | date = 2006-04-28 | access-date = 2007-05-13 }}</ref> With the 2.0 alpha release, the license was changed to the [[Microsoft Public License]],<ref name=license-mspl>{{cite web | url = http://www.codeplex.com/IronPython/Project/License.aspx?LicenseHistoryId=2866 | title = Microsoft permissive license | date = 2007-04-28 | access-date = 2007-05-13 }}</ref> 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.<ref name=dot-net-example>{{cite web | url = http://www.resolversystems.com/documentation/index.php/Dot_Net_Objects_in_the_Grid | title = Using .NET objects from IronPython in Resolver One | access-date = 2008-11-18 | archive-url = https://web.archive.org/web/20090114131717/http://www.resolversystems.com/documentation/index.php/Dot_Net_Objects_in_the_Grid | archive-date = 2009-01-14 | url-status = dead }}</ref> IronPython makes extensive use of [[Reflection (computer science)|reflection]]. 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. <syntaxhighlight lang="python"> from BookService import BookDictionary booksWrittenByBookerPrizeWinners = [book.Title for book in BookDictionary.GetAllBooks() if "Booker Prize" in book.Author.MajorAwards] </syntaxhighlight> 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. <syntaxhighlight lang="python"> import clr clr.AddReference("System.Windows.Forms") from System.Windows.Forms import MessageBox MessageBox.Show("Hello World") </syntaxhighlight> == Performance == The performance characteristics of IronPython compared to [[CPython]], the reference implementation of Python, depends on the exact benchmark used. IronPython performs worse than CPython on most benchmarks taken with the [[Dhrystone|PyStone]] script but better on other benchmarks.<ref>{{cite web | url=http://ironpython.codeplex.com/Wiki/View.aspx?title=IP26RC1VsCPy26Perf&referringTitle=Home | archive-url=https://archive.today/20130119180607/http://ironpython.codeplex.com/Wiki/View.aspx?title=IP26RC1VsCPy26Perf&referringTitle=Home | url-status=dead | archive-date=January 19, 2013 | title=IronPython Performance Report | access-date=2009-10-05 }}</ref> IronPython may perform better in Python programs that use threads or multiple cores, as it has a [[Just-in-time compilation|JIT]] compiler, and also because it doesn't have the [[Global Interpreter Lock]].<ref>{{cite web | url=https://wiki.python.org/moin/IronPython | title=IronPython at python.org | publisher=python.org | quote=''IronPython has no GIL and multi-threaded code can use multi core processors.'' | access-date=2011-04-04}}</ref><ref>{{Cite web |url=http://jeffknupp.com/blog/2013/06/30/pythons-hardest-problem-revisited/ |title=Python's Hardest Problem, Revisited |access-date=2015-07-15 |archive-url=https://web.archive.org/web/20151031074238/http://www.jeffknupp.com/blog/2013/06/30/pythons-hardest-problem-revisited/ |archive-date=2015-10-31 |url-status=usurped }}</ref> == Overview and key features == # '''Integration with .NET''': IronPython allows you to use [[.NET libraries]] and frameworks directly in your Python code. This means you can leverage the extensive .NET ecosystem and access features that are specific to .NET environments. # '''Dynamic Language Runtime (DLR)''': IronPython runs on the Dynamic Language Runtime, which is a set of services that support dynamic typing and dynamic method invocation in .NET languages. # '''Interoperability''': You can call .NET code from IronPython and vice versa. This makes it possible to integrate Python scripts with existing .NET applications or use .NET components within Python projects. # '''Syntax and Semantics''': IronPython aims to be as close as possible to the standard Python language (CPython), though there might be minor differences due to the underlying .NET platform. # '''Performance''': While IronPython provides good performance for many applications, it might not be as fast as CPython for some tasks, particularly those that rely heavily on Python's native libraries. # '''Compatibility''': IronPython is compatible with Python 2.x, but it does not support Python 3.x features. This means that some newer Python libraries or syntax may not be available. == See also == {{Portal|Free and open-source software|Computer programming}} * [[Boo (programming language)|Boo]] β a language for the [[.NET Framework]] and Mono with Python-inspired syntax and features borrowed from [[C Sharp (programming language)|C#]] and [[Ruby (programming language)|Ruby]] * [[Cobra (programming language)|Cobra]] *[[IronScheme]] * [[Jython]] β an implementation of [[Python (programming language)|Python]] for the [[Java Virtual Machine]] * [[Cython]] * [[PyPy]] β a self-hosting interpreter for the Python programming language * [[Tao Framework]] * [[Unladen Swallow]] β A (now-defunct) branch of CPython that aimed to provide superior performance using an [[LLVM]]-based [[Just-in-time compilation|just-in-time]] compiler {{Clear}} == References == {{Reflist}} == External links == * {{Official website}} {{Python (programming language)}} {{Common Language Infrastructure}} {{Microsoft FOSS}} {{Microsoft development tools}} [[Category:.NET programming languages]] [[Category:Free software programmed in C Sharp]] [[Category:Microsoft free software]] [[Category:Microsoft programming languages]] [[Category:Python (programming language) implementations]] [[Category:Python (programming language) libraries]] [[Category:Software using the Apache license]] [[Category:2006 software]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation needed
(
edit
)
Template:Cite web
(
edit
)
Template:Clear
(
edit
)
Template:Common Language Infrastructure
(
edit
)
Template:Expand section
(
edit
)
Template:Infobox software
(
edit
)
Template:Microsoft FOSS
(
edit
)
Template:Microsoft development tools
(
edit
)
Template:Official website
(
edit
)
Template:Portal
(
edit
)
Template:Primary sources
(
edit
)
Template:Python (programming language)
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)