-
Notifications
You must be signed in to change notification settings - Fork 63
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
WASM / JS Support #109
Comments
Presumably if you compiled it with the WASM target it should be possible, but I've never done so. If you have instructions it would be great to add them to the docs. |
I don't yet but I can try at some point! |
According to my tests, this already compiles successfully for the wasm32-wasi target, but for the normal wasm32-unknown-unknown target the |
It even passes most of tests (test run internally, but I forgot to setup a job on GitHub).
This setup was not tested. |
Not sure if this is helpful information but for anyone lost like me, I got this sort of working. I don't know Rust so please forgive the syntax. First I patched starlark-rust to remove the Instant::now() call since it panics. Should this be patched out under wasm? I don't personally care about timing.
Then I made a simple project:
And put some code to call starlark in src/lib.rs:
Ran
And it seems to work! Edited 7/13 to clean it up a little:
|
That's awesome! |
Based on the code in #109 (comment), with a few minor changes to make it work with stable and work for types that aren't string. Plus a slightly nicer HTML page where you can edit the input.
Based on the code in #109 (comment), with a few minor changes to make it work with stable and work for types that aren't string. Plus a slightly nicer HTML page where you can edit the input.
Summary: Based on the code in #109 (comment), with a few minor changes to make it work with stable and work for types that aren't string. Plus a slightly nicer HTML page where you can edit the input.  Credit for most of the code goes to aschleck. Pull Request resolved: #129 Reviewed By: stepancheg Differential Revision: D61774902 Pulled By: ndmitchell fbshipit-source-id: 4babe21de199f194be3405cd7e22b543a3e9169d
Summary: Based on the code in facebook/starlark-rust#109 (comment), with a few minor changes to make it work with stable and work for types that aren't string. Plus a slightly nicer HTML page where you can edit the input.  Credit for most of the code goes to aschleck. X-link: facebook/starlark-rust#129 Reviewed By: stepancheg Differential Revision: D61774902 Pulled By: ndmitchell fbshipit-source-id: 4babe21de199f194be3405cd7e22b543a3e9169d
That's super cool, thank you! |
Would it be possible to run Starlark from Node or the Browser using this library?
The text was updated successfully, but these errors were encountered: