Wasm support one day? #843
Replies: 2 comments 1 reply
-
See #717.
This will never happen because you are not allowed to ship something which does JITting of machine code and sets executable pages. We can only interpret. Since we already ship QuickJS bytecode and not raw JS, we'd just be trading one bytecode interpreter for another. It could actually get slower, but it's unlikely to be dramatically faster. The largest blocker is that the proposals to WASM itself that Kotlin requires are still in the standardization process and thus are not implemented by any interpreter. Maybe in a year or two the situation will change. I also don't think it's clear that we need WASI, but we're a long way from making such a decision. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response!
Ah Is see, but we could embed an interpreter like wasm3 I guess? The reason I looking into this originally was because I've been working on Rust backend that is being compiled to WASM. Given that it sounds like WASM is likely to become the defacto bytecode format for zipline, whats the chance of ingesting different languages? For example if I wanted to create a wasm module from rust and avoid the GC for a certain section of code, this could be awesome alternative to using the usual JNI FFI bindgen ceremony |
Beta Was this translation helpful? Give feedback.
-
I was wondering whether it will be likely that wasm support would be added in the future? How deeply coupled is the library to QuickJs as a runtime and JS as a compilation target?
If we were to embed a wasm runtime, or Android offered support for running wasm binaries we would potentially have dynamically updatable Kotlin code running as fast or in some cases faster than it would inside of ART/Dalvik.
This assumes we get wasm32-wasi compliant binaries as part of the new kotlin wasm compiler backend.
Beta Was this translation helpful? Give feedback.
All reactions