Kotlin/WASM compiler as library

So i’ve spent some time messing around and getting some basic hello world running using the cli compiler following this tutorial:
https://blog.jdriven.com/2021/04/running-kotlin-in-the-browser-with-wasm/

But i’m trying to work out how I can compile it as a library and then interface with that library in JS. but there doesn’t seem to be many examples.

Here’s an example of something im looking for:

Write an add/sum function in kotlin; compile that to wasm and then call the add function from some .js file. (where the add function takes two number arguments)

Thanx in add-vance

submitted by /u/MattyAlan
[link] [comments]