Skip to content

C API bindings designΒ #10

@emmatyping

Description

@emmatyping

Figured it would be good to have a dedicated thread to discuss how to generate the unsafe raw C API bindings.

We need to generate bindings for the stable API, unstable API, and internal API.

Currently we are using bindgen, which works okay for our use cases, at least right now.

Bindgen has some downsides we should try to work around. Pre-generating bindings for tiered platforms could provide a means of reducing compile times and make libclang only a soft dependency. Ideally, instead of generating N bindings files for N platforms, we could generate 1 bindings file for a set of platforms.

I'd also like to move safe API wrappers out of cpython-sys into a new cpython-safe crate (cpython is claimed on crates.io, so we need a different name), so that cpython-sys is purely raw FFI bindings.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions