migrate to nanobind?
Do you have a sense how feasible it would be to migrate this library to nanobind? This library is one of the last sticking points preventing me moving a large library from pybind11 to nanobind.
I've not taken the time to look into nanobind. If there is a similar approach for building bindings it should not be too much work. The pybind11_json codebase is rather simple: https://github.com/pybind/pybind11_json/blob/master/include/pybind11_json/pybind11_json.hpp
Although I believe we won't migrate pybind11_json to nanobind. This may be a new library, say nanobind_json.
Works for me - indeed there isn't much code that would need to be translated. I'll take a stab at that. The API of nanobind is a bit different, but largely similar so I think it should be relatively frictionless.
Please share here if you come up with something!
I sorted it out. The API is similar but not identical, and I think I figured out the wrinkles. I am not 100% sure I hit all the corner cases, but at least a simple test of dumping JSON to string in C++ works like a charm.
I have to figure out the licensing since I work for the US gov't otherwise I would post the code here right now.
@ianhbell Did you sort out your licensing questions? I’d be interested in the code if yes, although I’m thinking to try the conversion myself as well.
Thanks for the reminder. The code is complete but I just need to get confirmation from our lawyers what to do. I think I might just make a tiny repo with the header file minus all the other nice bits and pieces for conda etc.. @henryiii do you have an opinion on the best path forward?
My best understanding from legal is that I can license my code as BSD 3-clause because this repo is under that license and mine is derived from that. I don't know where my repo should live though. Should it be within nanobind? Or just linked somehow from nanobind?
@martinRenou mentioned possibly creating a new library named nanobind_json -- how does creating that under your own account sound to you?
Personally I'd even be happy with a gist. :)
Indeed, @ianhbell I'd suggest you create that repo under your account for now. Note that pybind11_json used to be under my personal account but it eventually moved to the pybind11 organization. We could take that same route and suggest moving it under the nanobind organization if one gets created at some point.
Also, happy to mention and link to that new repo in the pybind11_json README once it's on Github :)
I'm about to push, but this is a blocking issue to get everything to work exactly the same: https://github.com/wjakob/nanobind/discussions/777 . Nevertheless, you can do a header-only build, which is how I use pybind11_json anyhow; I don't trust package managers and I like having control.
Sounds good 👍🏽 if some people need it packaged properly, they can always contribute :D
Unfortunately I cannot get the tests building because nanobind has dropped embed mode. Would you be interested in taking that on? If so I can push right now and you can PR that.
It's up: https://github.com/ianhbell/nanobind_json . I have no experience with pixi, so don't l know what to do there.
Neat! Thanks.
I don't have time to put any cycle on this myself unfortunately.
Closing as solved. Let's mention https://github.com/ianhbell/nanobind_json in the README here.