bytecodealliance / javy

JS to WebAssembly toolchain
Apache License 2.0
2.29k stars 110 forks source link

Is It Possible to Link External Libraries with Javy? #749

Open HyperDwarf opened 2 months ago

HyperDwarf commented 2 months ago

What is your question?

As long as Javy provides zero support for CommonJS / NodeJS API, I would have to implement some stuffs like json parsing, compression and RSA signing by myself in order to use Javy. If Javy eventually compiles js into wasm, are there any chances of using C libraries that also target WebAssembly in Javy?

saulecabrera commented 2 months ago

If Javy eventually compiles js into wasm, are there any chances of using C libraries that also target WebAssembly in Javy?

Currently this is not possible, however, it's in our roadmap to allow extensibility in Javy generated modules.

stuffs like json parsing

A clarification: Javy does support JSON parsing/stringifying, in fact as of the latest changes in main, you can use a faster more performant JSON implementation based on SIMD .

HyperDwarf commented 2 months ago

Currently this is not possible, however, it's in our roadmap to allow extensibility in Javy generated modules.

Many thanks for the reply.

A clarification: Javy does support JSON parsing/stringifying, in fact as of the latest changes in main, you can use a faster more performant JSON implementation based on SIMD .

I didn't noticed that there's a support for JSON serialization. Could you shed some light on the list of built-in APIs in Javy? I haven't been able to find it anywhere. It seems that most Node.JS modules like crypto are not supported by Javy, but I am not pretty sure what is supported at this point.

saulecabrera commented 2 months ago

Once https://github.com/bytecodealliance/javy/pull/752 lands, we'll have an official document on the API support: https://github.com/bytecodealliance/javy/blob/dae9fde26850d266944fe8eac28c83ba70447de7/docs/docs-using-js-api-support.md