Luca
11/23/2022, 12:46 AMLuca
11/23/2022, 12:51 AMSvyatoslav Kuzmich [JB]
11/23/2022, 10:37 AMexternal
+ @JsExport
on both sides to glue them manually.
Long
math is indeed currently way faster in Wasm. But Kotlin/JS prerf can probably be improved in the future by using JS BigInt instead of a custom Long class.bashor
11/23/2022, 11:19 AMLuca
11/23/2022, 8:38 PMSvyatoslav Kuzmich [JB]
11/23/2022, 8:52 PMIs Kotlin/Wasm <-> Kotlin/JS interop between modules a planned feature eventually?Not at the moment. Same thing as with other platform combinations. For example, K/JVM cannot just call K/Native without some explicit glue on the boundary.
Currently can a wasm module depend on another wasm module?Yes. But currently Kotlin/Wasm statically links all source modules into a single Wasm binary.
Luca
12/04/2022, 12:26 AMe: java.lang.IllegalStateException: Internal function 'globalThis' not found
kotlin 1.8.0-Beta
with node 19.0.0
is working thoughLuca
12/04/2022, 12:28 AMSvyatoslav Kuzmich [JB]
12/04/2022, 3:11 AMSvyatoslav Kuzmich [JB]
12/04/2022, 3:31 AMThen somehow call the wasm binary from the js code?You use .mjs wrapper that we generate alongside .wasm file. It’s ES modue
Does this sound feasible?As long as you use top-level functions, primitive types or
external
types. But IntArray
have different representation in K/Wasm and K/JS and will have to be copied in a wrapper module.