3 ms·
"CPython makes it very easy to write C-extensions for your Python code because in the end it is executed by a C interpreter." Say what? What C interpreter mig
by DonGateley 13y ago
"CPython makes it very easy to write C-extensions for your Python code because in the end it is executed by a C interpreter."
Say what? What C interpreter might that be? In the end it is executed by machine code compiled from C programs designed so as to implement a Python virtual machine. Much, much different and much harder to make the intended connection.
Now why, really, is it easy to write C extensions for your Python code?
- yetanotherphd 13y agoSince it is written in C, it is easy for the interpreter to define a C API that exposes the Python runtime (Python.h). This means python C extensions can have access to the python runtime.
- NigelTufnel 13y agoI think writing C extensions (using raw C, not Cython) for Python is not easy and will never be easy. For one reason alone: writing C is never easy.