bytecodealliance / jco

JavaScript toolchain for working with WebAssembly Components
https://bytecodealliance.github.io/jco/
Apache License 2.0
617 stars 62 forks source link

Provide wasm-tools APIs in the browser #435

Open guybedford opened 4 months ago

guybedford commented 4 months ago

Since Jco exposes the wasm-tools APIs, it would be nice for the browser build of Jco to also expose these APIs properly.

alexcrichton commented 4 months ago

One possibility that might be able to help smoth this is to use the wasm32-unknown-unknown compilation target. That avoids importing WASI APIs at the cost of having to maybe work around some minor issues in the standard library (e.g. manually avoiding std::time, filesystems, etc)

ahaoboy commented 4 months ago

It would be great to have support for isomorphic api, so that they can be executed on both nodejs and web at the same time.

I did a simple test, wasm-tools has better performance than wabt, good job https://github.com/ahaoboy/wasm-tools-wasm-demo