I am working on a library for technical indicators...
# javascript
c
I am working on a library for technical indicators and am wondering if it is possible to compile the same library code for JS and JVM. This would allow me to have a single code base that could run in the browser as well as server side. Some googling has led me to believe that this is not possible but I wanted to confirm.
b
Absolutely, that's what kmp is for! You'll need to forego java ir js apis (or introduce expect/actual declarations for them)
Here's an example of single code-base being compiled to js and wasm libs https://github.com/mpetuska/kvdom/tree/develop/kvdom/kvdom-core
c
@Big Chungus Thank you for the pointer. I found this as well https://github.com/svok/kotlin-multiplatform-sample/tree/master/proj-common/src. I am trying it out now but so far it looks promising. The next goal will be to see if I can incorporate the generated js code into an existing project but I don't think that will be difficult.