-
Notifications
You must be signed in to change notification settings - Fork 778
Type-safe Embind port, compatible with the current API #7553
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
base: main
Are you sure you want to change the base?
Conversation
@kripken For some reason I get |
Hmm, strange. What is the full stack trace when you get that error? That could help understand if this is during the VM's compilation of the code, or in the JS itself as it executes during startup. cc @brendandahl - are there known issues with embind there? |
@kripken It seems like Node.JS fails to load the script:
The call stack is different when
|
It seems like the error is coming not from the count of stack frames, but instead from the size of stack. Increasing |
Looks like Node is failing to load and compile the code, yeah. How big is the code? Maybe it's just the size or the amount of nesting. If this is a debug build, perhaps try an optimized one? Linking with |
I've built the project in debug mode, and got 3 million lines. Is this ok? Is the size of bundle coming from embind? |
Binaryen is a pretty big project with lots of templated c++, so it seems reasonable the debug output is going to be large. |
It's just strange to me that the crashes appeared when using Embind. I've found the root of the problem. I removed the expression wrappers and now it loads just fine. But what do we do now? Expression wrappers are crucial. |
This PR moves the JS wrapper to C++ by utilizing Embind. It aims at automating the process of binding as much as possible. Ideally, I want to get rid of any wrappers and automatically generate compatible bindings by wrapping the necessary methods in lambdas. If this succeeds, it may be possible in future to adapt API to make it more natural (including breaking changes).