Skip to content

MeshInspector/mrbind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mrbind

MRBind parses C++ headers and generates Python and C bindings for them. The parse results can also be dumped for reflection purposes (either as JSON or as C macros).

  • The Python backend uses pybind11, with some custom logic to better handle the standard library types.

  • The C backend is our own.

Our selling points are:

  • No separate interface description files (as in SWIG).

    All annotations are done in the headers themselves, and are minimal (primarily just marking certain functions/classes as hidden from the bindings).

  • Proper support for most containers/classes from the C++ standard library.

  • Proper support for templates. MRBind aggressively instantiates most class templates it sees, and annotations can be added to instantiate class/function templates for specific template arguments. The (non-skipped) templates are required to be SFINAE-friendly.

MRBind still has some rough edges, but it is used in production for MeshLib.

Limitations

MRBind is meant to cover large API surface area with minimal effort.

It'll never be as flexible as handwritten bindings, and doesn't offer as many customization knobs as raw Pybind11, for example.

The point is making maintaining large bindings easy, with acceptable binding quality.

Usage

  1. Build MRBind itself.

  2. Run the parser on your code.

  3. Follow language-specific instructions:

About

Parse C++ headers and generate Python/C bindings

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages