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

feat: show a demo that users can interact with using WASM #462

Open
HarikrishnanBalagopal opened this issue Mar 9, 2023 · 2 comments
Open

Comments

@HarikrishnanBalagopal
Copy link

HarikrishnanBalagopal commented Mar 9, 2023

Feature Request

Overview

This library compiles nicely to WASM with just a small wrapper.
It can be used to show a demo and/or for using this library in languages other than Golang.
I have a working demo here https://haribala.dev/starlark-webasm-demo/
The code is here https://github.com/HarikrishnanBalagopal/starlark-webasm
and here https://github.com/HarikrishnanBalagopal/starlark-webasm-demo

@adonovan
Copy link
Collaborator

adonovan commented Mar 9, 2023

This is really cool! I'm curious what the performance overhead is of compiling the interpreter from Go to wasm. Have you tried running any of the benchmarks in the starlark-go tree? (If Go's testing package is a challenge for wasm you could just run go test and observe how many iterations of each benchmark get run and then just rewrite the benchmarks as simple loops of a fixed count and see how long they take.

I imagine JavaScript programs would also want a slightly different API to the interpreter. Have you tried passing JavaScript values (and especially functions) in and out of Starlark programs?

@laurentlb
Copy link
Contributor

Nice! I made something similar too:

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