-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Let's add a brand new API layer called the Native Interface (NI) that is:
- performant
- complete (provides all necessary building blocks)
- meant as a base for another layer (C-API, Cython, other language bindings)
- not ergonomic (for C)
- can use unwieldy names with version information or argument types
- "ABI" only -- no C macros, inline functions, compiler-dependent types, etc.
Then, let's build a C-API layer on top of that, as one of many possible layers: things like Cython, PyO3, ctypes.pythonapi would act as alternatives to C-API (and reimplement it).
The C-API layer would implement the current C-API (Limited API at first), and would consist of
- thin wrappers around the NI, autogenerated from a description that's easy to reuse for the other layers
- the description would encode similar info as Argument Clinic: argument/return types of a C wrapper and of the called NI function, and how to convert from one to the other
- optional hand-written wrappers that can reach into the internals for performance
- these should have the same API as the above, and automatically replace them the above is a stable ABI is not needed
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels