Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative to QuickJS #1055

Closed
arunpadiyan-cred opened this issue Jun 21, 2023 · 3 comments
Closed

Alternative to QuickJS #1055

arunpadiyan-cred opened this issue Jun 21, 2023 · 3 comments

Comments

@arunpadiyan-cred
Copy link

arunpadiyan-cred commented Jun 21, 2023

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
Copy link
Collaborator

Thanks for sharing those links.

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

  • We can be sure the JS engine we’re testing on is the same we’re running on
  • One consistent JS engine for all target platforms
  • We can take advantage of QuickJS features. In particular we can ship bytecode to the device, not minified source code.

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
Copy link
Collaborator

When Kotlin/WASM is stable and there’s a high-quality open source interpreter we’ll switch to WASM.
#717

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

@nilslice
Copy link

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants