Stream: git-wasmtime

Topic: wasmtime / Issue #2503 [Question] Is it possible to compi...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 12 2020 at 20:06):

Zaid-Ajaj opened Issue #2503:

Hi there, I was going through the docs and saw the examples that allow using wasm by going from rust -> wasm -> node.js. Is it possible to go the other way around? I would like to use a JS module in .NET and compiling it first to wasm sounds like the best way to go:

JS -> WASM -> .NET

is this currently possible? Any pointers would be greatly appreciated :pray:

Thanks in advance!

view this post on Zulip Wasmtime GitHub notifications bot (Dec 12 2020 at 20:21):

bjorn3 commented on Issue #2503:

Yes and no. Yes, it is possible to compile a javascript interpreter to wasm. No, it is not possible to make it go fast. Javascript is a dynamic language, which means that it is basically impossible to make it go fast without jitting specializations of functions for specific types and using on stack replacement to fallback to an interpreter when a type was guessed incorrectly. Webassembly neither supports on stack replacement, nor does it natively support dynamic generation of code as necessary to implement a jit. While depending on the runtime it may be possible to provide a jit function from the embedder, this will have a way too big overhead in most cases.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 12 2020 at 20:26):

Zaid-Ajaj commented on Issue #2503:

Thanks a lot for the quick response @bjorn3 :big_smile: it sounds like using a JS interpreter in .net directly would be a lot easier than compiling the interpreter itself to wasm just to use it again. I will be investigating the former approach. Thanks again!

view this post on Zulip Wasmtime GitHub notifications bot (Dec 12 2020 at 20:26):

Zaid-Ajaj closed Issue #2503:

Hi there, I was going through the docs and saw the examples that allow using wasm by going from rust -> wasm -> node.js. Is it possible to go the other way around? I would like to use a JS module in .NET and compiling it first to wasm sounds like the best way to go:

JS -> WASM -> .NET

is this currently possible? Any pointers would be greatly appreciated :pray:

Thanks in advance!


Last updated: Dec 23 2024 at 12:05 UTC