Stream: general

Topic: Javy Questions


view this post on Zulip Dima (Jan 05 2024 at 21:37):

Using wasmtime: https://velostudio.github.io/blog/levo.html

view this post on Zulip Karel Hrkal (kajacx) (Jan 06 2024 at 08:16):

This definitely looks interesting, and similar to what I am doing (a Bevy game with WASM as a modding system). Does it actually run in the browser though? Or only in the "browser-like" desktop application? Would be really cool if it actually ran in the browser as well as the desktop app.

While wasmtime doesn't work on the browser, there are solution around it, like wasm-bridge and wasm_component_layer.

Provides a single unified API to run WASM modules on the desktop using wasmtime, or on the web using js-sys. - GitHub - kajacx/wasm-bridge: Provides a single unified API to run WASM modules on the ...

view this post on Zulip Dima (Jan 06 2024 at 09:26):

Karel Hrkal (kajacx) said:

This definitely looks interesting, and similar to what I am doing (a Bevy game with WASM as a modding system). Does it actually run in the browser though? Or only in the "browser-like" desktop application? Would be really cool if it actually ran in the browser as well as the desktop app.

While wasmtime doesn't work on the browser, there are solution around it, like wasm-bridge and wasm_component_layer.

The Portal is just a native desktop app, since as you point out wasmtime usage limits it to the desktop. Thanks for sharing the links! It was on our long term wishlist to make it run in the browser too, so it's awesome to see you're already doing the work. It would be interesting to see if we could rebase on wasm-bridge, but would have to check if there are any other non-web dependencies that would need to be adapted as well.

We'd like to focus on fleshing out the Portal API and app first though, before we consider "web embed" (really bringing back the Flash era now...)

view this post on Zulip James Mart (Jan 06 2024 at 17:49):

Potentially related proposal:
https://github.com/WebAssembly/esm-integration/blob/main/proposals/esm-integration/README.md

view this post on Zulip Taylor Hillegeist (Jan 10 2024 at 01:01):

Hi, Someone told me that javy just wraps javascript in quickjs. but it looks to me like it does more. what is it that it actually does?

view this post on Zulip Jeff Charles (Jan 11 2024 at 21:21):

what is it that it actually does?

Javy (the CLI) takes JavaScript source code as input and creates a Wasm module that will execute that JavaScript source code using the QuickJS interpreter. The CLI also has a dynamic linking mode where you can create a very small WebAssembly module that links against a provider module containing the QuickJS interpreter compiled to Wasm.

There are a few library crates that are part of Javy that are published to crates.io for building your own WebAssembly modules that can use the QuickJS interpreter to execute JavaScript source code and adding support for some JavaScript APIs to Javy (for example, TextDecoder/TextEncoder).


Last updated: Oct 23 2024 at 20:03 UTC