https://kotlinlang.org logo
Title
b

Big Chungus

03/28/2020, 11:43 AM
Are there any plans to bring
dynamic
keyword into wasm?
a

anton.bannykh

04/09/2020, 7:16 AM
Do you need it for JS interop? cc @Svyatoslav Kuzmich [JB]
b

Big Chungus

04/09/2020, 7:44 AM
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

anton.bannykh

04/09/2020, 8:00 AM
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

Big Chungus

04/09/2020, 8:01 AM
Sounds promising. I'd be interested in the rough timelines of that as well.
b

bashor

04/09/2020, 2:37 PM
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

Big Chungus

04/10/2020, 6:04 AM
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

bashor

04/10/2020, 11:55 AM
Likely we will start from something separate. But later we could start sharing most of them.
n

napperley

07/04/2020, 1:05 AM
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

bashor

07/06/2020, 9:26 PM
I agree with you. We are keeping it in mind while working on the new compiler backend.
👍 1