alexeev-prog
Joined 7 months ago
Joined 7 months ago
We will be focusing specifically on integrating extensions at build time, not just loading libraries via ctypes.
In this article, I want to discuss how to integrate C extensions using the Python.h library. I will also explain how to create your own Python library with C extensions. We will explore how Python works internally — for example, we'll recall that everything is an object. I will use Poetry as my environment manager.
Everything will be demonstrated using my small library for various algorithms and computations. At the end, I will conduct an analysis of pure Python algorithms, our library, and pure C algorithms: execution speed, distributability, pros and cons, and code volume.
Without further ado, let's begin!
Several full-fledged interpreters working side by side. What are the advantages?