Re: [Rdkit-devel] RDKit Python wrappers
My two cents:- Brian got the big one: boost allows you to produce pythonic bindings and, as long as you're doing them at the same time you are writing the original code it's not that big of a deal to write the wrappers by hand.- Back when I started this SWIG was a complete disaster in terms of how it handled C++ code.- the documentation is, IMO, much better than the SWIG documentation the moment you need to do anything that isn't fairly trivial. Neither is simple (the task itself is complex), but I still think that boost is the right choice for the RDKit On Thu, Dec 1, 2016 at 7:09 PM +0100, "Brian Kelley" wrote: I expect the technical reason is that the boost wrapping was done well in advance of the swig. Having used both, I think that boost wrappers are far more pythonic, compile faster, do docstrings better and finally handle exceptions between c++ and Python far better. The downside is that when you get a compile error, it is several pages long. While doing the same is possible in swig, it would require a serious rewriting that is one whole bunch of "not fun". Brian Kelley > On Dec 1, 2016, at 12:39 PM, David Cosgrove wrote: > > Hi All, > > Having failed miserably to understand boost::python last week when trying to > add some new functions, I am wondering if there's a technical reason to > prefer it over swig? Given there are swig wrappings for java and c#, it > feels logical to do the python wrapping that way as well. It would remove > some complexity from the maintenance, perhaps. OTOH, if the end result isn't > as good, then that wouldn't be worth it, and I'll just have to try harder > with boost::python. > > Cheers, > Dave > > -- > ___ > Rdkit-devel mailing list > Rdkit-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-devel -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel
Re: [Rdkit-devel] RDKit Python wrappers
You can always just ask... On Thu, Dec 1, 2016 at 9:14 PM +0100, "David Cosgrove" wrote: Ok, I'm convinced. I assumed there was probably a good reason, but sometimes it's worth asking the question just in case. I'm not anti boost, but, as with many of their libraries I have looked at, I found the documentation impenetrable at first reading. I will persevere. Cheers, Dave On Thu, 1 Dec 2016 at 20:03, Maciek Wójcikowski wrote: One big thing on pros side: boost::python supports serialization natively, and SWIG does not. Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2016-12-01 20:46 GMT+01:00 Gianluca Sforna : On Thu, Dec 1, 2016 at 7:09 PM, Brian Kelley wrote: > Having used both, I think that boost wrappers are far more pythonic, compile > faster, do docstrings better and finally handle exceptions between c++ and > Python far better. > > The downside is that when you get a compile error, it is several pages long. While we are at this, I stumbled few days ago on this project: https://github.com/pybind/pybind11 That claims to work mostly like boost::python, just without the boost part. If we were to try removing the boost dependency, I think it could be useful. -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel
Re: [Rdkit-devel] RDKit Python wrappers
Ok, I'm convinced. I assumed there was probably a good reason, but sometimes it's worth asking the question just in case. I'm not anti boost, but, as with many of their libraries I have looked at, I found the documentation impenetrable at first reading. I will persevere. Cheers, Dave On Thu, 1 Dec 2016 at 20:03, Maciek Wójcikowski wrote: > One big thing on pros side: boost::python supports serialization natively, > and SWIG does not. > > > Pozdrawiam, | Best regards, > Maciek Wójcikowski > mac...@wojcikowski.pl > > 2016-12-01 20:46 GMT+01:00 Gianluca Sforna : > > On Thu, Dec 1, 2016 at 7:09 PM, Brian Kelley wrote: > > Having used both, I think that boost wrappers are far more pythonic, > compile faster, do docstrings better and finally handle exceptions between > c++ and Python far better. > > > > The downside is that when you get a compile error, it is several pages > long. > > While we are at this, I stumbled few days ago on this project: > > https://github.com/pybind/pybind11 > > That claims to work mostly like boost::python, just without the boost part. > > If we were to try removing the boost dependency, I think it could be > useful. > > > -- > ___ > Rdkit-devel mailing list > Rdkit-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-devel > > > -- > ___ > Rdkit-devel mailing list > Rdkit-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-devel > -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel
Re: [Rdkit-devel] RDKit Python wrappers
One big thing on pros side: boost::python supports serialization natively, and SWIG does not. Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2016-12-01 20:46 GMT+01:00 Gianluca Sforna : > On Thu, Dec 1, 2016 at 7:09 PM, Brian Kelley wrote: > > Having used both, I think that boost wrappers are far more pythonic, > compile faster, do docstrings better and finally handle exceptions between > c++ and Python far better. > > > > The downside is that when you get a compile error, it is several pages > long. > > While we are at this, I stumbled few days ago on this project: > > https://github.com/pybind/pybind11 > > That claims to work mostly like boost::python, just without the boost part. > > If we were to try removing the boost dependency, I think it could be > useful. > > > -- > ___ > Rdkit-devel mailing list > Rdkit-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-devel > -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel
Re: [Rdkit-devel] RDKit Python wrappers
On Thu, Dec 1, 2016 at 7:09 PM, Brian Kelley wrote: > Having used both, I think that boost wrappers are far more pythonic, compile > faster, do docstrings better and finally handle exceptions between c++ and > Python far better. > > The downside is that when you get a compile error, it is several pages long. While we are at this, I stumbled few days ago on this project: https://github.com/pybind/pybind11 That claims to work mostly like boost::python, just without the boost part. If we were to try removing the boost dependency, I think it could be useful. -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel
Re: [Rdkit-devel] RDKit Python wrappers
I expect the technical reason is that the boost wrapping was done well in advance of the swig. Having used both, I think that boost wrappers are far more pythonic, compile faster, do docstrings better and finally handle exceptions between c++ and Python far better. The downside is that when you get a compile error, it is several pages long. While doing the same is possible in swig, it would require a serious rewriting that is one whole bunch of "not fun". Brian Kelley > On Dec 1, 2016, at 12:39 PM, David Cosgrove > wrote: > > Hi All, > > Having failed miserably to understand boost::python last week when trying to > add some new functions, I am wondering if there's a technical reason to > prefer it over swig? Given there are swig wrappings for java and c#, it > feels logical to do the python wrapping that way as well. It would remove > some complexity from the maintenance, perhaps. OTOH, if the end result isn't > as good, then that wouldn't be worth it, and I'll just have to try harder > with boost::python. > > Cheers, > Dave > > -- > ___ > Rdkit-devel mailing list > Rdkit-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-devel -- ___ Rdkit-devel mailing list Rdkit-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-devel