IronPython

IronPython
Original author(s)Jim Hugunin, Microsoft
Developer(s)Dino Viehland,
.NET Foundation
Initial releaseSeptember 5, 2006; 18 years ago (2006-09-05)[1]
Stable release
3.4.1 / July 12, 2023; 17 months ago (2023-07-12)
Preview release
3.4.0-beta1 / April 30, 2022; 2 years ago (2022-04-30)
Repository
Written inC#
Operating systemWindows, Linux, macOS
Platform.NET Framework, .NET, Mono
TypePython programming language implementation
LicenseApache License 2.0
Websiteironpython.net Edit this on Wikidata

IronPython is an implementation of the Python programming language targeting the .NET and 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.[2][3]

IronPython is written entirely in C#, although some of its code is automatically generated by a 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.[4] The DLR is part of the .NET Framework 4.0 and is also a part of Mono since version 2.4 from 2009.[5] 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.[6] IronPython 2.0 was released on December 10, 2008.[7] 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.[8] 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.[9] 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.[10] 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.[11]
  • Release 2.7.1 was released on October 21, 2011 and it targets CPython 2.7.[12]
  • Release 2.7.2.1 was released on March 13, 2012. It enables support for ZIP file format libraries, SQLite, and compiled executables.[13]
  • Release 2.7.4 was released on September 7, 2013.[14]
  • Release 2.7.5 was released on December 6, 2014 and mostly consists of bug fixes.[15]
  • Release 2.7.6 was released on August 21, 2016 and only consists of bug fixes.[16]
  • Release 2.7.7 was released on December 7, 2016 and only consists of bug fixes.[17]
  • 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). It is also the first release to support .NET Core.[18]
  • 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.[19]
  • Release 2.7.10 was released on April 27, 2020 and adds .NET Core 3.1 support.[20]
  • 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[21]
  • Release 3.4.0 was released on December 12, 2022 and is the first release to support Python 3.x. [22]

Differences with CPython

There are some differences between the Python reference implementation CPython and IronPython.[23] Some projects built on top of IronPython are known not to work under CPython.[24] Conversely, CPython applications that depend on extensions to the language that are implemented in C are not compatible with IronPython ,[25] 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.[26]

Silverlight

IronPython is supported on Silverlight (which is deprecated by Microsoft and already has lost support in most web browsers[27]). It can be used as a scripting engine in the browser just like the JavaScript engine.[28] IronPython scripts are passed like simple client-side JavaScript scripts in <script>-tags. It is then also possible to modify embedded XAML markup.

The technology behind this is called Gestalt.[citation needed]

// 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>

The same works for IronRuby.

License

Until version 0.6, IronPython was released under the terms of Common Public License.[29] 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 OSI-approved but the authors claim it meets the open-source definition.[30] With the 2.0 alpha release, the license was changed to the Microsoft Public License,[31] 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.[32]

IronPython makes extensive use of 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.

from BookService import BookDictionary
 
booksWrittenByBookerPrizeWinners = [book.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, 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.[33] IronPython may perform better in Python programs that use threads or multiple cores, as it has a JIT compiler, and also because it doesn't have the Global Interpreter Lock.[34][35]

Overview and key features

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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

References

  1. ^ "CodePlex Archive". Archived from the original on 2017-12-26. Retrieved 2014-05-30.
  2. ^ "IronPython.net". Retrieved 2013-07-03.
  3. ^ "Python Tools for Visual Studio- Home". Python Tools for Visual Studio. Archived from the original on 2018-01-26. Retrieved 2013-07-03.
  4. ^ "Dynamic Language Runtime Overview". Microsoft. Retrieved 2014-04-01.
  5. ^ "2009-07-02 Marek Safar · mono/Mono@340222f". GitHub.
  6. ^ "Jim Hugunin's blog: IronPython 1.0 released today!". 2006-09-05. Retrieved 2006-12-14.
  7. ^ "Release dates for ironpython". 2008-12-10. Retrieved 2009-01-25.
  8. ^ Clarke, Gavin (2010-10-22). "Microsoft cuts loose Iron languages". The Register. Retrieved 2012-04-05.
  9. ^ "2.0.3". ironpython.codeplex.com. Archived from the original on 2017-12-26. Retrieved 2010-10-16.
  10. ^ "2.6". ironpython.codeplex.com. Archived from the original on 2018-01-13. Retrieved 2010-10-16.
  11. ^ "2.7". ironpython.codeplex.com. Archived from the original on 2018-01-02. Retrieved 2011-03-12.
  12. ^ "2.7.1". ironpython.codeplex.com. Archived from the original on 2017-12-26. Retrieved 2011-12-30.
  13. ^ "2.7.2.1". ironpython.codeplex.com. Archived from the original on 2017-12-26. Retrieved 2012-03-24.
  14. ^ "2.7.4". ironpython.codeplex.com. Archived from the original on 2018-01-16. Retrieved 2014-12-07.
  15. ^ "2.7.5". ironpython.codeplex.com. Archived from the original on 2018-01-26. Retrieved 2014-12-07.
  16. ^ "2.7.6". github.com. Retrieved 2016-08-21.
  17. ^ "2.7.7". github.com. Retrieved 2018-01-05.
  18. ^ "2.7.8". github.com. Retrieved 2018-01-05.
  19. ^ "2.7.9". github.com. Retrieved 2018-10-09.
  20. ^ "IronLanguages/ironpython2". GitHub. Retrieved 2020-06-26.
  21. ^ "Releases · IronLanguages/ironpython2". GitHub. Retrieved 2022-08-08.
  22. ^ "Releases · IronLanguages/ironpython3". GitHub. Retrieved 2023-07-09.
  23. ^ "Differences between IronPython 1.0 and CPython 2.4.3". Microsoft. 2007-12-18. Retrieved 2008-02-09.
  24. ^ Foord, Michael. "New Project: Implementing .NET Libraries in Pure Python". Archived from the original on 2008-08-30. Retrieved 2008-02-09.
  25. ^ Eby, Phillip (15 October 2005). "Children of a Lesser Python". Retrieved 2008-07-09.
  26. ^ "NumPy and SciPy for .NET". Retrieved 2019-04-05.
  27. ^ "Silverlight 5 System Requirements". www.microsoft.com. Retrieved 2019-11-16.
  28. ^ "Write browser applications in Python". IronPython.net. Archived from the original on 2013-03-17.
  29. ^ "Original IronPython homepage". 2004-07-28. Archived from the original on February 23, 2010. Retrieved 2007-05-13.
  30. ^ "Shared Source License for IronPython". 2006-04-28. Retrieved 2007-05-13.
  31. ^ "Microsoft permissive license". 2007-04-28. Retrieved 2007-05-13.
  32. ^ "Using .NET objects from IronPython in Resolver One". Archived from the original on 2009-01-14. Retrieved 2008-11-18.
  33. ^ "IronPython Performance Report". Archived from the original on January 19, 2013. Retrieved 2009-10-05.
  34. ^ "IronPython at python.org". python.org. Retrieved 2011-04-04. IronPython has no GIL and multi-threaded code can use multi core processors.
  35. ^ "Python's Hardest Problem, Revisited". Archived from the original on 2015-10-31. Retrieved 2015-07-15.

Read other articles:

Peta Lokasi Kabupaten Ogan Komering Ulu di Sumatera Selatan Berikut adalah daftar kecamatan dan kelurahan/desa di Kabupaten Ogan Komering Ulu, Sumatera Selatan, Indonesia. Kabupaten Ogan Komering Ulu memiliki 13 kecamatan, 14 kelurahan dan 143 desa (dari total 236 kecamatan, 386 kelurahan dan 2.853 desa di seluruh Sumatera Selatan). Pada tahun 2017, jumlah penduduknya sebesar 357.502 jiwa dengan luas wilayahnya 4.797,06 km² dan sebaran penduduk 74 jiwa/km².[1][2] Daftar keca...

 

2016 Japanese filmHentai Kamen: Abnormal CrisisPosterKanjiHK 変態仮面 アブノーマル・クライシス Directed byYūichi Fukuda [ja]Screenplay byYūichi FukudaBased onKyūkyoku!! Hentai Kamenby Keishū Ando [ja]StarringRyohei SuzukiDistributed byToei CompanyRelease date May 14, 2016 (2016-05-14) Running time118 minutes[1]CountryJapanLanguageJapanese Hentai Kamen: Abnormal Crisis (HK 変態仮面 アブノーマル・クライシス...

 

  جمهورية أذربيجان الديمقراطية جمهورية أذربيجان الديمقراطيةعلم أذربيجان جمهورية أذربيجان الديمقراطيةالشعار   النشيد: نشيد جمهورية أذربيجان  الأرض والسكان إحداثيات 40°30′N 47°34′E / 40.5°N 47.56°E / 40.5; 47.56  عاصمة كنجهباكو  اللغة الرسمية الأذرية  التعدا...

The RacketPoster bioskop film The RacketSutradaraLewis MilestoneProduserHoward HughesDitulis olehBartlett CormackTom MirandaPemeranThomas MeighanMarie PrevostLouis WolheimSinematograferTony GaudioPenyuntingEddie AdamsDistributorParamount PicturesTanggal rilisDurasi84 menitNegara Amerika SerikatBahasaFilm bisuBahasa Inggris The Racket merupakan film Amerika buatan tahun 1928 yang bertemakan gangster. FIlm yang disutradarai oleh Lewis Milestone ini juga dinominasikan dalam ajang Academy Aw...

 

This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help improve this article by introducing more precise citations. (January 2022) (Learn how and when to remove this template message) David Rumph JonesNickname(s)NeighborBorn(1825-04-05)April 5, 1825Orangeburg, South CarolinaDiedJanuary 15, 1863(1863-01-15) (aged 37)Richmond, VirginiaPlace of burialHollywood Cemetery (Richmond, Virginia)A...

 

Le informazioni riportate non sono consigli medici e potrebbero non essere accurate. I contenuti hanno solo fine illustrativo e non sostituiscono il parere medico: leggi le avvertenze. TubercolosiA destra si può vedere una caverna tubercolare, a sinistra un infiltrato di Assman-RedkerSpecialitàinfettivologia e pneumologia EziologiaMycobacterium tuberculosis Classificazione e risorse esterne (EN)ICD-9-CM010 e 018 ICD-10A15-A19 OMIM607948 MeSHD014376 MedlinePlus000077 e 000624 eMedicine23080...

Charity Shield FA 1955TurnamenCharity Shield FA Chelsea Newcastle United 3 0 Tanggal14 September 1955StadionStamford Bridge, LondonPenonton12.802← 1954 1956 → Charity Shield FA 1955 adalah pertandingan sepak bola antara Chelsea dan Newcastle United yang diselenggarakan pada 14 September 1955 di Stamford Bridge, London. Pertandingan ini merupakan pertandingan ke-33 dari penyelenggaraan Charity Shield FA. Pertandingan ini dimenangkan oleh Chelsea dengan skor 3–0.[1] Pertan...

 

Pour les articles homonymes, voir Arriaga. Juan Crisóstomo de ArriagaJuan Crisóstomo de ArriagaBiographieNaissance 27 janvier 1806BilbaoDécès 17 janvier 1826 (à 19 ans)Ancien 2e arrondissement de ParisNom de naissance Juan Crisóstomo Jacobo Antonio de Arriaga y BalzolaSurnom Mozart españolNationalité espagnoleFormation Conservatoire national supérieur de musique et de danse de ParisActivité CompositeurAutres informationsInstrument ViolonGenre artistique Musique classiquemodifi...

 

この項目には、一部のコンピュータや閲覧ソフトで表示できない文字が含まれています(詳細)。 数字の大字(だいじ)は、漢数字の一種。通常用いる単純な字形の漢数字(小字)の代わりに同じ音の別の漢字を用いるものである。 概要 壱万円日本銀行券(「壱」が大字) 弐千円日本銀行券(「弐」が大字) 漢数字には「一」「二」「三」と続く小字と、「壱」「�...

Linear ridge on the Indian Ocean floor near the 90th meridian The Ninety East Ridge at the centre of the picture and the Chagos-Laccadive Ridge on the upper left side The Ninety East Ridge (also rendered as Ninetyeast Ridge, 90E Ridge or 90°E Ridge) is a mid-ocean ridge on the Indian Ocean floor named for its near-parallel strike along the 90th meridian at the center of the Eastern Hemisphere. It is approximately 5,000 kilometres (3,100 mi) in length and can be traced topographically fr...

 

Cet article est une ébauche concernant un bateau ou un navire, le domaine militaire et le Japon. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Pour les articles homonymes, voir Hiei (homonymie). Hiei Le croiseur de bataille Hiei japonais lors d'un exercice le 5 décembre 1939. Type Croiseur de bataille Classe Kongō Histoire A servi dans  Marine impériale japonaise Chantier naval Arsenal naval de Yokosu...

 

Hünenberg Hünenberg gemeinde de Suiza Escudo HünenbergLocalización de Hünenberg en SuizaPaís  Suiza• Cantón  Cantón de ZugUbicación 47°10′34″N 8°25′35″E / 47.176111111111, 8.4263888888889• Altitud 444 mSuperficie 18,7 km²Población[1]​ 8841 hab. (2014)• Densidad 473 hab./km²Lengua AlemánCódigo postal 6331Sitio web Sitio web oficial[editar datos en Wikidata] Hünenberg es una comuna suiz...

French customs redirects here. For the national agency, see Directorate-General of Customs and Indirect Taxes. The oldest patisserie in Paris Arc de Triomphe The culture of France has been shaped by geography, by historical events, and by foreign and internal forces and groups. France, and in particular Paris, has played an important role as a center of high culture since the 17th century and from the 19th century on, worldwide. From the late 19th century, France has also played an important...

 

1996 United States Senate elections ← 1994 November 5, 1996 1998 → 34 of the 100 seats in the United States Senate51 seats needed for a majority   Majority party Minority party   Leader Trent Lott Tom Daschle Party Republican Democratic Leader since June 12, 1996 January 3, 1995 Leader's seat Mississippi South Dakota Seats before 53 47 Seats won 55 45 Seat change 2 2 Popular vote 24,785,416[1] 23,951,995[1] Percent...

 

Puzzles, board games, or video games based on language Word puzzle redirects here. For the video game, see Word Puzzle (video game). This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Word game – news · newspapers · books · scholar · JSTOR (July 2018) (Learn how and when to remove this message) Part of a series...

1971 film by Peter Bogdanovich Directed by John FordDirected byPeter BogdanovichWritten byPeter BogdanovichProduced byDavid H. ShepardJames R. SilkeGeorge Stevens, Jr.Frank MarshallStarringPeter BogdanovichHarry Carey, Jr.Clint EastwoodHenry FondaJohn FordWalter HillMaureen O'HaraMartin ScorseseSteven SpielbergJames StewartJohn WayneNarrated byOrson WellesCinematographyLászló KovácsBrick MarquardDavid SammonsGregory SandorEric ShermanPatrick Alexander StewartEdited byMark FitzgeraldRichard...

 

Pemandangan kota Tuzla Tuzla merupakan sebuah kota dan munisipalitas di Bosnia-Herzegovina. Kota ini terletak di bagian timurlaut di negara itu. Kota ini merupakan kota terbesar ketiga setelah Sarajevo dan Banja Luka. Kota ini memiliki luas wilayah 30 km² dengan memiliki jumlah penduduk sekitar 160.000 jiwa (2005). Sejarah Sejarah awal Bukti arkeologis menunjukkan bahwa Tuzla adalah pemukiman Neolitik yang kaya. Dihuni terus menerus selama lebih dari 6.000 tahun, Tuzla adalah salah satu...

 

Device to transfer traction from draught animals to a loadFor the control system of some fixed-wing aircraft, see Yoke (aeronautics).For other uses, see Yoke (disambiguation). Not to be confused with Yolk. Bullock cart with a yoke Withers yoke A yoke is a wooden beam used between a pair of oxen or other animals to enable them to pull together on a load when working in pairs, as oxen usually do; some yokes are fitted to individual animals. There are several types of yoke, used in different cul...

Public school in Oak Park Heights, Minnesota, United StatesStillwater Area High SchoolAddress5701 Stillwater Blvd NOak Park Heights, Minnesota 55082United StatesCoordinates45°01′47″N 92°50′51″W / 45.02967°N 92.8474°W / 45.02967; -92.8474InformationTypePublicMottoWe learn not for school, but for lifeEstablished1887 [1]PrincipalRobert BachFaculty100.58 (FTE)[2]Enrollment2,647 (2022–23)[2]Student to teacher ratio26.32[2]Color(...

 

Map all coordinates using OpenStreetMap Download coordinates as: KML GPX (all coordinates) GPX (primary coordinates) GPX (secondary coordinates) This list includes properties and districts listed on the National Register of Historic Places in Montgomery County, North Carolina. Click the Map of all coordinates link to the right to view an online map of all properties and districts with latitude and longitude coordinates in the table below.[1] Current listings       ...