Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a python interface #31

Open
savmickael opened this issue Aug 8, 2018 · 4 comments
Open

Provide a python interface #31

savmickael opened this issue Aug 8, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@savmickael
Copy link
Contributor

No description provided.

@dumasl
Copy link
Contributor

dumasl commented Aug 9, 2018

Before it is too late we should argue around the best way too do it and maybe have a look at what @LucHermitte suggested (http://pybind11.readthedocs.io/en/master/) ?
I believe we might have already started with Swing which per @rkanavath would do the trick. Shall we change our mind ?

@savmickael savmickael added the enhancement New feature or request label Aug 10, 2018
@savmickael savmickael added this to the 0.2 milestone Aug 10, 2018
@rkanavath
Copy link

@dumasl
pybind11 seems close to boost::python and it says so in their docs. For sake of discussion, I simply copy part of it.

The main issue with Boost.Python—and the reason for creating such a similar project—is Boost. Boost is an enormously large and complex suite of utility libraries that works with almost every C++ compiler in existence.

You can read full page here: http://pybind11.readthedocs.io/en/master/intro.html.

swig is an alternative tool like boost::python but with a different goals. And obviously, both have its own advantages and disadvantages. @LucHermitte , can you brief us on any special benefits of pybind11. ?

@LucHermitte
Copy link

  • pybind11 has more traction than boost.Python nowadays.
  • bindings are to be defined by hand (need to list the various types, functions and variables exposed) -- some find them more "Pythonic"
  • there exists a LLVM based binding generator for Boost.Pyhton (Py++), but I don't see any for pybind11 which would be still maintained
  • the syntax is really simple, it's valid C++11 code
  • compatible with C++11, 14...
  • bindings for eigen libraries (to numpy) are already defined
  • looks efficient -- as it tries to make use of C++11&+ features like constexpr, move semantics...

I guess you've already seen this: https://community.lsst.org/t/using-pybind11-instead-of-swig-to-wrap-c-code/1096

@rkanavath
Copy link

@LucHermitte , I am not following any of lsst discussion. It seems pybind11 is interesting work. I guess writing wrapper code for pybind11 is not a big issue for sirius which is their main argument against swig. Although swig wrapping are not that bad in dealing with python except it doesn't employ modern C++ . so I am leaning towards pybind11 but will have a closer look in coming days.

@tfeuvrier-cs tfeuvrier-cs removed this from the 0.2 milestone Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants