-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Possibly deprecate embind for nbind #4770
Comments
Just to note, this issue was requested from the google group: |
There are multiple different conversations bundled into one in this bug report, which I think would be best separated to individual aspects.
So, if we wanted to deprecate embind in favor of nbind, it is not something we should even decide on now, but would be a multiple step project, where 1. nbind was first integrated to Emscripten repository and the two would live side by side, 2. the current embind use cases are converted over to nbind (in the form of a migration guide), 3. once people have switched over to nbind, we could consider deprecating embind, but that should be a decision to naturally fall out of obsolescence (nobody is using embind anymore, because everyone is using nbind instead). There is no current pressing need to get to step 3, but we could just stop at step 1 as well, especially because it is imaginable that step 2 can be a very large undertaking for anyone to start working on. Even if integrating nbind to Emscripten was not interesting, another path of action might be to document its existence, installation and usage in Emscripten docs, which would point to its separate repository to obtain it. This probably depends on what @jjrv feels would make most sense for the nbind project? |
First of all, point 2 from @k2snowman69. Here's the main embind features that I know nbind is missing:
@juj's points: nbind really shouldn't be integrated in Emscripten's repo (unless as a Git submodule) because the Node.js target is just as important. New Node.js versions sometimes require a new release, and for Node.js use only nbind is needed, not the rest of Emscripten. The current nbind test suite really accelerates its development. All C++ testcase source files are linked together and the JavaScript-based testbench only requires launching Node.js once. That means it's reasonable to run in Travis CI and Appveyor on several versions of all supported platforms at every commit. For nbind tests, Emscripten is a precompiled binary black box maintained by the Urho3D project. I think this makes the tests more practical to run than embind's, but the overall Emscripten couldn't use this approach of course. I don't think deprecating embind is necessary. The feature gap should be closed so that new projects could always choose nbind if they wish. Eventually a bunch of templates and macros could surely be developed to shim all embind functionality when using nbind, but I don't think it's worth the effort. Currently
The integration in Emscripten's code that I'd like to see some day, is a Perhaps embind, nbind and other similar libraries should be able to define their required flags somewhere... Sounds more like the job for a build tool. Currently nbind has Gyp tooling to avoid these problems, and possibly adding appropriate Cmake configuration would be enough for Emscripten users who don't use the Node.js ecosystem. I was asked to do a PR to add a link to nbind and a benchmark to the Emscripten docs. I haven't had time to do the benchmark, which always requires some thought to do properly and impartially. Any help would be appreciated. |
Thanks for that list of features. Seems like a relatively large gap for now but it is always good to have the list. It sounds like embind's focus is low-level connection of c++ and javascript and nbind's focus is a high-level connection which much more structure. Since they are serving two purposes it makes no sense currently to choose one over the other. I agree @jjrv that nbind really shouldn't be brought into emscripten but should be more thought as a sub-module. This does get into a question of version pinning which was touched on a bit and overall we've solved that with npm so it's not a problem that needs to be solved again. Given the two cases it sound like the focus should be getting a link to nbind in the documentation. This would have honestly helped me a ton and I'm having to go back and recode a bunch of stuff to move it over. That said, I know nothing about benchmarking as I focus mainly on UI development but if I can help I'd love to! |
The actual feature gap is:
Once the first 3 items are resolved, nbind is "ready" and version 1.0.0 should be out. The other differences not on this shorter list are minor things that can be quite quickly implemented if there's a need, but they don't seem that important, and would clutter the API. Once automatic downcasting is done, the official way to handle non-member class methods is to subclass on the C++ side. |
Essentially it seems that innovation for embind has slowed and a competitor has come up, nbind. It seems that nbind is able to do everything embind can do but is a short syntax and also generates out a typescript definition file which is extremely important for modern day development.
I'm opening this issue to help facilitate the answering of the following questions:
Let me know if the question needs more clarifying.
The text was updated successfully, but these errors were encountered: