-
Notifications
You must be signed in to change notification settings - Fork 48
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
Support wasm32-unknown-unknown Target #73
Comments
I was able to compile this only on Mac by doing: quick-js = "=0.3.0" Once it's bumped to 0.3.3 it no longer works and the following error occurs:
Not sure why it only works on Mac, but at least it's working now! That said, it looks like it doesn't work exactly because the following functions then need to be provided as imports to the wasm instance.
I wonder what determines these to show up needing to be imports? Edit: Oh, ok... these are the quickjs bindings that get used in the rust code. |
obviously there always is a way, but it isn't easy to do in this case - wasm32-unknown-unknown c interop is in an extremely basic state at the moment - there's no libc and the abi doesn't perfectly match. I did compile it successfully by doing some modifications to emscripten (which definitely can't be pushed to production) and linking a modified version of quickjs to the resulting modified emscripten-compiled libc, it's definitely not something that can be achieved by making modifications to this crate alone |
Thanks for your effort! <3 I want to build quickjs as a wasm based mini vm and having I have more experience working with rust/wasm than emscripten :(, I was able to build https://github.com/justjake/quickjs-emscripten but would prefer to have a rust/wasm version. |
I'm looking into this again. It will require quite a few patches to the codebase though, sadly. |
Good news! I managed to transpile Quickjs to Rust with I will need to patch out the libc dependency, but a WASM build is relatively easy to do now. |
Little progress update: I've done quite extensive cleanup of the I will probably continue to rewrite it step by step to idiomatic Rust, which is a lot of work but probably worthwile and can be done incrementally. That also means that the code will diverge significantly from QuickJS, and will live in a different repo with a new name. If anyone wants to play with the code or, even better, help out with porting, a preliminary version is published here: https://github.com/theduke/slimjs |
Hi @theduke I've ran into the same issue as mr @dsherret describes above and had a look at the quickjs-fork in the link above. I noticed it's been about a year since the last commit - did you abandon it or did you found a way forward with this? |
Thanks for this project!
Is there any way to compile this in a lib crate to target
wasm32-unknown-unknown
? (ex.cargo build --release --target=wasm32-unknown-unknown
)I'm suspecting no. I tried and got this error:
The text was updated successfully, but these errors were encountered: