Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
dc0e6f9e
Kaydet (Commit)
dc0e6f9e
authored
Kas 18, 2016
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge for issue #28705
üst
0c633985
78ffd6cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
27 deletions
+5
-27
design.rst
Doc/faq/design.rst
+5
-27
No files found.
Doc/faq/design.rst
Dosyayı görüntüle @
dc0e6f9e
...
...
@@ -366,33 +366,11 @@ is exactly the same type of object that a lambda expression yields) is assigned!
Can Python be compiled to machine code, C or some other language?
-----------------------------------------------------------------
Practical answer:
`Cython <http://cython.org/>`_ and `Pyrex <https://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/>`_
compile a modified version of Python with optional annotations into C
extensions. `Weave <https://scipy.github.io/devdocs/tutorial/weave.html>`_ makes it easy to
intermingle Python and C code in various ways to increase performance.
`Nuitka <http://www.nuitka.net/>`_ is an up-and-coming compiler of Python
into C++ code, aiming to support the full Python language.
Theoretical answer:
.. XXX not sure what to make of this
Not trivially. Python's high level data types, dynamic typing of objects and
run-time invocation of the interpreter (using :func:`eval` or :func:`exec`)
together mean that a naïvely "compiled" Python program would probably consist
mostly of calls into the Python run-time system, even for seemingly simple
operations like ``x+1``.
Several projects described in the Python newsgroup or at past `Python
conferences <https://www.python.org/community/workshops/>`_ have shown that this
approach is feasible, although the speedups reached so far are only modest
(e.g. 2x). Jython uses the same strategy for compiling to Java bytecode. (Jim
Hugunin has demonstrated that in combination with whole-program analysis,
speedups of 1000x are feasible for small demo programs. See the proceedings
from the `1997 Python conference
<http://legacy.python.org/workshops/1997-10/proceedings/>`_ for more information.)
`Cython <http://cython.org/>`_ compiles a modified version of Python with
optional annotations into C extensions. `Nuitka <http://www.nuitka.net/>`_ is
an up-and-coming compiler of Python into C++ code, aiming to support the full
Python language. For compiling to Java you can consider
`VOC <https://voc.readthedocs.io>`_.
How does Python manage memory?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment