Stream: wasi

Topic: wasi-http sample with Kotlin/Wasm (& Component Model)


view this post on Zulip Zalim Bashorov (Kotlin_, JetBrains) (Mar 17 2026 at 22:48):

Hi everyone!

We’ve been experimenting with the WebAssembly Component Model in Kotlin/Wasm and ported the wasi-http sample using our early version:

https://github.com/Kotlin/sample-wasi-http-kotlin/

Still early, but we would be happy to hear feedback, especially around component model integration, WIT usage, and anything that looks off.

view this post on Zulip Zalim Bashorov (Kotlin_, JetBrains) (Mar 17 2026 at 22:51):

Some techincal details about the demo:

  1. We generate bindings from WIT files using our fork of wit-bindgen[1]. Likely, at some point, we need to contribute it back.
  2. We produce core wasm files using Kotlin toolchain, which compiles the code directly to wasm (no GraalVM and any other tools involved). To optimize production builds, we are using Binaryen.
  3. We build the final component using wasm-tools.

[1]: https://github.com/Kotlin/wit-bindgen

view this post on Zulip Zalim Bashorov (Kotlin_, JetBrains) (Mar 17 2026 at 22:51):

The resulting component size is ~62 KB.
For comparison, a similar app built in Rust is 200+ KB.

Performance-wise, it’s not that impressive yet -- the Kotlin version is about 10x slower. 
I guess the main reason is that we need to do more copying on the boundaries due to the lack of GC ABI.
Details to be investigated.

view this post on Zulip Andy Wingo (Mar 18 2026 at 08:30):

@Zalim Bashorov (Kotlin_, JetBrains) is this with gc? if so i would be interested in hearing about component model and gc :)

view this post on Zulip Andy Wingo (Mar 18 2026 at 08:38):

ah i see your last message mentions copies. yes that makes sense

view this post on Zulip Andy Wingo (Mar 18 2026 at 08:39):

very impressive size result!!

view this post on Zulip Zalim Bashorov (Kotlin_, JetBrains) (Mar 18 2026 at 13:28):

Just in case, the issue (#525) about Wasm GC in CM ABI with a Pre-Proposal

view this post on Zulip Alex Crichton (Mar 18 2026 at 13:42):

This is awesome! A quick skim of the wit-bindgen bits and it all looks quite reasonable to me, and if y'all are interested I think it'd definitely make sense to live upstream too. No pressure either way, and it's great to see the progress here!


Last updated: Mar 23 2026 at 16:19 UTC