Are there any plans to bring `dynamic` keyword int...
# webassembly
b
Are there any plans to bring
dynamic
keyword into wasm?
a
Do you need it for JS interop? cc @Svyatoslav Kuzmich [JB]
b
Yep. The use case I currently have is extracting out DOM api defs from JS scope to common scope to be shared on WASM and JS (i'm implementing js bindings on wasm myself, but would like to just typealias it on js mdule`
a
cc @Svyatoslav Kuzmich [JB] @bashor (could you please answer?) I don't know the plans, but personally I think the DOM API will probably be supported at some point in the future, because there is an ongoing project for supporting WASM as a Kotlin/JS platform. It requires the GC support in WASM, which is not ready yet as far as I know.
b
Sounds promising. I'd be interested in the rough timelines of that as well.
b
We are going to provide typed declarations for browser APIs the same way as we do it for Kotlin/JS. But we don’t have any ETA for that. Supporting
dynamic
calls is theoretically possible for JS objects but there could be a lot of pitfalls and we didn’t think much about it (yet).
👍 1
b
One more question, though. Do you plan to provide browser API bindings as common module or are they gonna be just platform specific? As the current browser API bindings will have trouble in staying uniform with WASM bindings without
dynamic
b
Likely we will start from something separate. But later we could start sharing most of them.
n
Yesterday I provided some feedback about the need for Kotlin JS to have a tool that makes it easy to port a Kotlin JS program/library/framework to WASM.
b
I agree with you. We are keeping it in mind while working on the new compiler backend.
👍 1