Imath icon indicating copy to clipboard operation
Imath copied to clipboard

Prototype nanobind bindings for Imath

Open cary-ilm opened this issue 1 year ago • 5 comments

We have the long term goal of removing the dependency on Boost.Python, and the current strategy is to rewrite the bindings with pybind11, although nanobind promises to be even better than pybind11, and also claims to be largely API-compatible.

We should prototype bindings using nanobind. This would involve duplicating the current state of the pybind11 bindings, both source and CMake configuration, and replacing both to use nanobind.

cary-ilm avatar Sep 05 '24 20:09 cary-ilm

I'll take a shot at implementing this for Dev Days next week.

mlantas avatar Sep 20 '24 21:09 mlantas

This turns out to be more complex than originally thought, as it has implications for downstream projects, like Alembic, since nanobind and pybind11 don't appear to work together in the ecosystem.

cary-ilm avatar Apr 20 '25 03:04 cary-ilm

OpenVDB has already switched to nanobind. I think MaterialX is also seriously considering it. I think we're already past the point of being able to talk about the merits of all these interconnected projects staying on one or the other or coordinating a switch at the same time.

lgritz avatar Apr 20 '25 15:04 lgritz

At this point we should finish off the pybind11 bindings.

After that is done how much work is it to transition from pybind11 to nanobind?

Our previous concerns with jumping on nanobind was with the minimum supported python version, since then most or all DCCs are on a new enough version of python that this is no longer a concern.

Also, is nanobind still the way to go or is there a new picobind or even yoctobind that we should be looking into? 😃

lamiller0 avatar May 14 '25 18:05 lamiller0

Definitely finish pybind11 first. I believe nanobind is only possible when we raise our Python minimum to 3.9 (or is it 3.8?).

lgritz avatar May 14 '25 18:05 lgritz