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
Python (programming language)
(section)
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!
===Cross-compilers to other languages=== There are several compilers/[[transpiler]]s to high-level object languages; the source language is unrestricted Python, a subset of Python, or a language similar to Python: * Brython,<ref>{{Cite web|title=Brython|url=https://brython.info/|access-date=2021-01-21|website=brython.info|archive-date=3 August 2018|archive-url=https://web.archive.org/web/20180803065954/http://brython.info/|url-status=live}}</ref> Transcrypt,<ref>{{cite web|title=Transcrypt β Python in the browser|url=https://www.transcrypt.org|access-date=22 December 2020|website=transcrypt.org|language=en|archive-date=19 August 2018|archive-url=https://web.archive.org/web/20180819133303/http://www.transcrypt.org/|url-status=live}}</ref><ref>{{Cite web|url=https://www.infoq.com/articles/transcrypt-python-javascript-compiler/|title=Transcrypt: Anatomy of a Python to JavaScript Compiler|website=InfoQ|access-date=20 January 2021|archive-date=5 December 2020|archive-url=https://web.archive.org/web/20201205193339/https://www.infoq.com/articles/transcrypt-python-javascript-compiler/|url-status=live}}</ref> and [[Pyjs]] compile Python to [[JavaScript]]. (The latest release of Pyjs was in 2012.) * [[Cython]] compiles a superset of Python<!-- actually 2.7 by default, but Python 3 by override --> to C. The resulting code can be used with Python via direct C-level API calls into the Python interpreter. * PyJL compiles/transpiles a subset of Python to "human-readable, maintainable, and high-performance Julia source code".<ref name=PyJL>{{Cite web|title=Transpiling Python to Julia using PyJL|url=https://web.ist.utl.pt/antonio.menezes.leitao/ADA/documents/publications_docs/2022_TranspilingPythonToJuliaUsingPyJL.pdf|quote=After manually modifying one line of code by specifying the necessary type information, we obtained a speedup of 52.6Γ, making the translated Julia code 19.5Γ faster than the original Python code.|access-date=20 September 2023|archive-date=19 November 2023|archive-url=https://web.archive.org/web/20231119071525/https://web.ist.utl.pt/antonio.menezes.leitao/ADA/documents/publications_docs/2022_TranspilingPythonToJuliaUsingPyJL.pdf|url-status=live}}</ref> Despite the developers' performance claims, this is not possible for ''arbitrary'' Python code; that is, compiling to a faster language or machine code is known to be impossible in the general case. The semantics of Python might potentially be changed, but in many cases speedup is possible with few or no changes in the Python code. The faster Julia source code can then be used from Python or compiled to machine code. * [[Nuitka]] compiles Python into C<!-- "is the optimizing Python compiler written in Python that creates executables that run without a separate installer"-->.<ref>{{cite web|title=Nuitka Home {{!}} Nuitka Home|url=http://nuitka.net/|access-date=18 August 2017|website=nuitka.net|language=en|archive-date=30 May 2020|archive-url=https://web.archive.org/web/20200530211233/https://nuitka.net/|url-status=live}}</ref> This compiler works with Python 3.4 to 3.12 (and 2.6 and 2.7) for Python's main supported platforms (and Windows 7 or even Windows XP) and for Android. The compiler developers claim full support for Python 3.10, <!-- "also finishes full compatibility with the match statements of 3.10" "From here on, we need to re-visit compatibility. A few more obscured 3.10 features are missing, the 3.11 compatibility is not yet complete" -->partial support for Python 3.11 and 3.12, <!-- "This release bumps the long-awaited 3.12 support to a complete level. Now, Nuitka behaves identically to CPython 3.12 for the most part. .. After being late with 3.12 support, we will now be early with 3.13 support if all goes well." --> and experimental support for Python 3.13. Nuitka supports macOS including Apple Silicon-based versions. <!-- "While arm64 (M1) only builds and x86_64 (Intel) only builds work, the value universal which of course implies twice the size, and as such has other disadvantages, is not yet supported. --> The compiler is free of cost, though it has commercial add-ons (e.g., for hiding source code).<!-- "Container Builds (public + commercial)" --> * [[Numba]] is a JIT compiler that is used from Python; the compiler translates a subset of Python and NumPy code into fast machine code. This tool is enabled by adding a decorator to the relevant Python code. * Pythran compiles a subset of Python 3 to C++ ([[C++11]]).<ref name="Guelton Brunet Amini Merlini 2015 p=014001">{{cite journal |last1=Guelton |first1=Serge |last2=Brunet |first2=Pierrick |last3=Amini |first3=Mehdi |last4=Merlini |first4=Adrien |last5=Corbillon |first5=Xavier |last6=Raynaud |first6=Alan |title=Pythran: enabling static optimization of scientific Python programs |journal=Computational Science & Discovery |publisher=IOP Publishing |volume=8 |issue=1 |date=16 March 2015 |issn=1749-4699 |doi=10.1088/1749-4680/8/1/014001|doi-access=free |page=014001 |bibcode=2015CS&D....8a4001G}}</ref> * [[RPython]] can be compiled to C, and it is used to build the PyPy interpreter for Python. * The Python β 11l β C++ transpiler<ref>{{Cite web |url=https://11l-lang.org/transpiler |title=The Python β 11l β C++ transpiler |access-date=17 July 2022 |archive-date=24 September 2022 |archive-url=https://web.archive.org/web/20220924233728/https://11l-lang.org/transpiler/ |url-status=live}}</ref> compiles a subset of Python 3 to C++ ([[C++17]]). There are also specialized compilers: * [[MyHDL]] is a Python-based [[hardware description language]] (HDL) that converts MyHDL code to [[Verilog]] or [[VHDL]] code. Some older projects existed, as well as compilers not designed for use with Python 3.x and related syntax: * Google's Grumpy [[transpile]]s Python 2 to [[Go (programming language)|Go]].<ref>{{Cite web|url=https://github.com/google/grumpy|title=google/grumpy|date=10 April 2020|via=GitHub|access-date=25 March 2020|archive-date=15 April 2020|archive-url=https://web.archive.org/web/20200415054919/https://github.com/google/grumpy|url-status=live}}</ref><ref>{{Cite web|url=https://opensource.google/projects/|title=Projects|website=opensource.google|access-date=25 March 2020|archive-date=24 April 2020|archive-url=https://web.archive.org/web/20200424191248/https://opensource.google/projects/|url-status=live}}</ref><ref>{{Cite news|url=https://www.theregister.com/2017/01/05/googles_grumpy_makes_python_go/|title=Google's Grumpy code makes Python Go|first=Thomas Claburn in San|last=Francisco|website=www.theregister.com|access-date=20 January 2021|archive-date=7 March 2021|archive-url=https://web.archive.org/web/20210307165521/https://www.theregister.com/2017/01/05/googles_grumpy_makes_python_go/|url-status=live}}</ref> The latest release was in 2017. * [[IronPython]]<!-- (abandoned by Microsoft) --> allows running Python 2.7 programs with the .NET [[Common Language Runtime]].<ref>{{Cite web|title=IronPython.net /|url=https://ironpython.net/|website=ironpython.net|archive-date=17 April 2021|archive-url=https://web.archive.org/web/20210417064418/https://ironpython.net/|url-status=live}}</ref> An [[Software release life cycle#Alpha|alpha]] version (released in 2021), is available for "Python 3.4, although features and behaviors from later versions may be included."<ref>{{Cite web |url=https://github.com/IronLanguages/ironpython3 |title=GitHub β IronLanguages/ironpython3: Implementation of Python 3.x for .NET Framework that is built on top of the Dynamic Language Runtime<!-- Bot generated title --> |website=[[GitHub]] |archive-date=28 September 2021 |archive-url=https://web.archive.org/web/20210928101250/https://github.com/IronLanguages/ironpython3 |url-status=live}}</ref> * [[Jython]] compiles Python 2.7 to Java bytecode, allowing the use of Java libraries from a Python program.<ref>{{Cite web|title=Jython FAQ|url=https://www.jython.org/jython-old-sites/archive/22/userfaq.html|access-date=2021-04-22|website=www.jython.org|archive-date=22 April 2021|archive-url=https://web.archive.org/web/20210422055726/https://www.jython.org/jython-old-sites/archive/22/userfaq.html|url-status=live}}</ref> * [[Pyrex (programming language)|Pyrex]] (last released in 2010) and [[Shed Skin]] (last released in 2013) compile to C and C++ respectively.
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)