cashapp / zipline

Run Kotlin/JS libraries in Kotlin/JVM and Kotlin/Native programs
Apache License 2.0
2.07k stars 158 forks source link

Alternative to QuickJS #1055

Closed arunpadiyan-cred closed 1 year ago

arunpadiyan-cred commented 1 year ago

Is there any plan to replace QuickJS with JavaScriptEngine (https://developer.android.com/jetpack/androidx/releases/javascriptengine), (https://developer.android.com/develop/ui/views/layout/webapps/jsengine) provided by google. I checked the apk size footprint for the same it is only 20KB.

swankjesse commented 1 year ago

Thanks for sharing those links.

We’re very happy to ship our own JavaScript engine for a few reasons:

As for WebAssembly, it’s unlikely the WebAssembly binaries we’ll build with Kotlin/WASM will work on the WebAssembly runtime built into Android. In particular, Kotlin/WASM needs the garbage collection extension and I don’t believe that’s in Android’s WebAssembly engine.

swankjesse commented 1 year ago

When Kotlin/WASM is stable and there’s a high-quality open source interpreter we’ll switch to WASM. https://github.com/cashapp/zipline/issues/717

And if ever Android has a built-in interpreter that can host Kotlin/WASM, we’ll consider supporting that too.

nilslice commented 10 months ago

@swankjesse - just came across Zipline from this article https://publicobject.com/2024/01/11/wasm/, thanks a lot for mentioning Extism!

We are also working on a high-quality Wasm runtime in pure Java: https://github.com/dylibso/chicory, in case this is still of interest.

It doesn't yet support GC, which would be a blocker to run Kotlin-based wasm code, but it's definitely something we want to add. Maybe there is room to collaborate here!

In any case, really exciting to see Cash App using this mode of updating logic. Nice work!