-
Notifications
You must be signed in to change notification settings - Fork 23
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
Bound exports seem to be returning Wasm pointers #13
Comments
I think I see the problem, I need to add this file as the entry point when compiling: ./node_modules/as-bind/lib/assembly/as-bind.ts Hmmm...is there any way that requirement could be dropped? It was confusing and seems like it could be unnecessary. The file seems simple enough. Could you modify the Wasm that is passed into AsBind.instantiate and just put the compiled code at the front? Or something like that? |
Ah yes! It is a requirement and covered on the quick start in the README. 😄 I should figure out how to make that more apparent (throw a warning or error in the JS lib if we notice it wasn't added? 🤔 )
Unfortunately no. So by default, AssemblyScript will export some of the Class IDs, but not all of them (For example, most typed array classes are not exported by default). Therefore, we need to export them. I also wanted this, as it gives us more freedom to export more things in the future, and requires less lines of code in terms of exporting from the llibrary in the users index.js. Does that make sense? I can send you some old versions of the API where I didn't have this 😄
So we could totally do that! But it'd have to be like a compile time tool. To do this at runtime would be extremely slow at instantiation time, since we'd have to essentially, parse, and recompile the module at runtime 👍 Let me know what you think! Stoked to see your interest in the library 😄 🎉 |
I'm not sure if I'm doing this incorrectly, but as-bind doesn't seem to be returning the data types that I want, just the Wasm pointers are some other pointer is coming back:
In my AssemblyScript:
In my JavaScript (not exactly my source code as I'm working on integration with Zwitterion):
This logs
1888
, nothello world
. Am I missing something with the API?The text was updated successfully, but these errors were encountered: