Skip to content

Modernize the Python native binding workshop and add Rust - #2

Merged
tleonhardt merged 16 commits into
mainfrom
modernize-native-interfaces
Dec 6, 2026
Merged

tleonhardt merged 16 commits into
mainfrom
modernize-native-interfaces

Conversation

@tleonhardt

@tleonhardt tleonhardt commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

What changed

The workshop now builds seven native Fibonacci implementations and a Python reference in one locked uv workspace. CFFI still loads a shared C library, Cython shows both wrapping C and compiling a typed loop, and SWIG exposes C functions and a struct. pybind11 and nanobind wrap the same C++ function. PyO3 and maturin add a Rust extension. The benchmark checks the answers before timing each implementation.

Four runnable labs cover numerical integration, byte buffers, STL vectors, and callbacks into Python. The buffer and vector examples now use zlib with explicit output sizes. The original slides and handout are preserved with a link to the corresponding historical checkout.

Try it locally

Install uv, the C/C++ and Rust toolchains, and zlib development headers, then run:

make test
make benchmark
make check
make docs-test

The guide includes direct uv commands for Windows. CI runs the shared tests and a benchmark smoke test on CPython 3.11 through 3.15 on Linux, plus 3.15 on macOS and Windows. The documentation workflow uploads the rendered site for review and publishes to GitHub Pages after merge to main.

@tleonhardt
tleonhardt merged commit 3d56f3f into main Dec 6, 2026
10 checks passed
@tleonhardt
tleonhardt deleted the modernize-native-interfaces branch December 6, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant