python bindings

Exposing native (often C/C++) implementations to Python via language bindings or APIs that preserve performance, correctness, and low overhead integration. This includes engineering interfaces for large-data validation, tight synchronization in client-server setups, and easy use within Python ecosystems.

pythonbindings

12-Month Skill Trend

Momentum and market value over time
Trending
Score
+20 in 12 mo
96
12 mo agoNow
Career
Value
+$12K in 12 mo
$42K/year
12 mo agoNow

Recommended Survey Paper

Quick overview of the field
View more

Must-Read Papers

Most classic and influential ideas
View more

Rust vs. C for Python Libraries: Evaluating Rust-Compatible Bindings Toolchains

Jun 30, 2025
IB
Isabella Basso do Amaral
🏛️ University of São Paulo | Jheronimus Academy of Data Science

Python interpreter performance bottlenecks hinder critical-path optimization, while traditional C-based extensions (e.g., ctypes, cffi) suffer from high development complexity and memory unsafety. Method: This paper presents the first systematic evaluation of Rust—via the PyO3 binding framework—for developing native Python extensions, benchmarking its runtime performance, development effort, and maintainability against ctypes and cffi on identical workloads. Contribution/Results: PyO3 achieves near-C execution speed while preserving full CPython ABI compatibility and drastically reducing memory-safety vulnerabilities. Its declarative API simplifies binding generation, cutting source code volume by ~40% and improving compilation and debugging efficiency. Empirical results demonstrate that PyO3 delivers a compelling trade-off among safety, performance, and engineering practicality—establishing Rust as a viable, and often preferable, alternative to C for high-performance Python extension development.

Achieving high performance without API compatibility issuesComparing PyO3 bindings with ctypes and cffi toolchainsEvaluating Rust vs. C for Python library performance

A Multilingual Python Programming Language

Oct 10, 2025
SA
Saad A. Bazaz
🏛️ Grayhat Developers PVT Ltd | National University of Computer and Emerging Sciences

Programming languages’ English dependency poses significant learning barriers for non-native English speakers—particularly those from resource-constrained communities. To address this, we propose UniversalPython, the first multilingual-localized Python transpiler. It maps source code written in vernacular languages (e.g., Urdu) to Python’s abstract syntax tree (AST) via language-agnostic lexical analysis and grammar-aware parsing, ensuring semantic equivalence across languages. Unlike conventional monolingual paradigms, UniversalPython enables end-to-end compilation of non-Latin-script languages—such as Urdu—into executable Python bytecode while preserving full semantic fidelity and ecosystem compatibility. The system is open-sourced and empirically validated: user studies demonstrate substantial reductions in cognitive load for novice learners, alongside measurable improvements in code readability and writing efficiency. This work establishes a scalable, linguistically inclusive technical foundation for global programming education.

Creating multilingual programming tools for broader accessibilityEnabling Python coding in native human languagesOvercoming English language barriers in programming education

Third-party Python libraries often impose significant burdens in dependency management, supply chain risks, and deployment complexity. This work introduces the zerodep project, which leverages large language models under strict constraints to reimplement over forty popular libraries as single-file, zero-dependency, API-compatible alternatives using only the Python standard library. This study presents the first large-scale empirical analysis of the expressive and functional boundaries of the Python standard library and systematically evaluates the capability of LLMs to generate high-performance, correct code under stringent constraints. Experimental results show that most reimplementations achieve performance within a factor of two of the original libraries, with certain scenarios demonstrating speedups of 5× to 115×. The primary performance bottlenecks stem from the absence of C extensions rather than inherent inefficiencies of pure Python, revealing architectural redundancies in several widely used libraries that can be effectively avoided.

correctnessdependency managementperformance

PyMigTool: a tool for end-to-end Python library migration

Oct 09, 2025
MI
Mohayeminul Islam
🏛️ University of Alberta | North Dakota State University | New York University Abu Dhabi

Existing Python library migration tools are largely restricted to API-level mapping or specific library pairs, suffering from narrow coverage and low automation. This paper introduces the first end-to-end, general-purpose Python library migration framework, leveraging large language models (LLMs) as its core engine and integrating static analysis (to extract contextual dependencies) with dynamic analysis (to verify behavioral consistency), enabling fully automated code migration between functionally similar libraries. We propose a novel program-analysis-driven LLM post-processing optimization mechanism, significantly enhancing migration accuracy and robustness. Our command-line implementation is evaluated on 717 real-world projects: 32% achieve fully correct migrations, and in over 50% of projects, developers need to address fewer than 14% of residual changes—substantially reducing manual effort and error rates.

Automates Python library migration between arbitrary similar librariesReduces manual effort in API mapping and code replacement tasksUses LLMs with static and dynamic analysis for accurate transformations

OMP4Py: a pure Python implementation of OpenMP

Nov 22, 2024
CP
César Piñeiro
🏛️ Universidade de Santiago de Compostela

Python’s interpreted execution model and the Global Interpreter Lock (GIL) have long hindered effective multithreaded parallelism, limiting its applicability in high-performance computing (HPC). This work addresses the emerging opportunity presented by Python 3.13’s GIL removal by proposing and implementing PyMP—the first pure-Python, OpenMP-compatible runtime. PyMP introduces a parser for OpenMP 5.0+ directives and encapsulates parallel constructs via decorators and context managers, thereby natively integrating imperative, fine-grained parallel programming into Python’s dynamic ecosystem. Experimental evaluation demonstrates significant multithreaded performance gains on non-numerically intensive workloads, validating the feasibility of C/Fortran-style parallel programming in GIL-free Python. PyMP thus establishes a foundational component for building high-performance Python-based HPC toolchains.

Bridging Python's performance gap with HPC languages via multithreadingEnhancing Python's multithreading efficiency despite interpreter limitationsImplementing OpenMP's directive-based parallelism in pure Python

Latest Papers

What's happening recently
View more

This work proposes a Pythonic adaptation of the PIMPL (Pointer-to-Implementation) design pattern to address the challenge of maintaining stable APIs in large, evolving Python libraries, where users often inadvertently depend on internal implementation details. By introducing lightweight public objects that delegate calls opaquely to hidden implementations, the approach effectively isolates internal complexity. The design systematically integrates module-level indirection, facade objects, backend dispatching, and lazy imports to construct a decoupled encapsulation architecture. Empirical evaluation demonstrates that this paradigm enables runtime backend switching and lazy loading, significantly enhancing API stability and long-term maintainability in both the Python standard library and scientific computing ecosystems. The resulting pattern offers a general, reusable solution for robust library design in Python.

API stabilityencapsulationopaque pointer

This work addresses the challenges of translating code with external dependencies using large language models, which often suffer from hallucinated APIs, missing imports, and difficulties in verifying semantic equivalence involving opaque library types. To tackle these issues, the authors propose the first end-to-end verifiable translation framework specifically designed for migrating Go code to Rust. The approach integrates retrieval of publicly available target-language APIs, synthesis of cross-language adapters, and I/O-based semantic equivalence checking to ensure correctness. Evaluated on six real-world Go projects, the method substantially improves both compilation and semantic verification success rates, achieving up to 100% success in the most complex dependency scenarios and yielding an average two-fold improvement over baseline approaches.

code translationexternal librariesLLM hallucination

This work addresses the challenge that crashes in C extensions disrupt automated testing in Python, thereby impeding the detection of real API faults and limiting coverage of non-crashing execution paths. To overcome this, we introduce— for the first time—a subprocess isolation mechanism into the Python test generation tool Pynguin, decoupling test generation from execution. This design enables continuous test generation even when C extensions crash, facilitating the capture of reproducible failures while preserving coverage guarantees. Evaluated across 1,648 modules from 21 widely used libraries, our approach increases test coverage by 56.5% and identifies 213 distinct crash-inducing conditions, including 32 previously unknown, real-world defects.

automated testingC-extensionscrash

This study addresses the challenge of selecting programming languages that balance performance and efficiency for implementing AI algorithms in resource-constrained environments or when standard AI libraries are unavailable. For the first time, five representative AI algorithms—k-means, k-NN, MLP, genetic algorithm, and Mamdani fuzzy inference—are implemented from scratch in Python, C, C++, Rust, Go, and Julia, with strict equivalence in algorithmic logic. Using identical pseudorandom seeds, native language features, and precise timing and memory monitoring, the work conducts a fine-grained, reproducible cross-language evaluation. Results show that C and C++ deliver the best performance, Rust is only 9% slower, while Julia and Go are 3.3× and 5.0× slower, respectively, and Python is up to 315× slower. Memory usage reveals a fixed overhead of 224 MiB for Julia, whereas C, C++, and Rust all remain below 6 MiB; notably, performance rankings vary significantly across algorithm types.

AI implementationalgorithm implementationperformance evaluation

Existing Python vulnerability scanners suffer from significant false positives and false negatives due to their neglect of security backports in packaged libraries and operating system distributions. This work proposes a provenance-aware approach that integrates content-hash matching, dynamic binary version extraction, and cross-ecosystem call graph construction to establish fine-grained mappings between native dependencies in the Python and OS ecosystems for the first time. By accurately identifying the upstream or system package versions corresponding to bundled libraries, the method enables precise assessment of vulnerability reachability. Evaluation on 100,000 PyPI packages and 10 CVEs reveals 39 directly affected packages—collectively downloaded over 47 million times per month—and 312 indirectly affected packages, reducing false positive rates by up to 97%.

cross-ecosystemfalse positivesnative libraries

Hot Scholars

AG

Alfredo Goldman

Associate Professor of Computer Science, University of São Paulo
HPCDistributed SystemsAgile MethodsTechnical Debt