-
Notifications
You must be signed in to change notification settings - Fork 18
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
I want to run a js file that I wrote myself #153
Comments
This project uses SpiderMonke under the hood, but adds necessary bindings and glue code to allow run SpiderMonkey as a WASI component.
The easiest way is to use componentize.sh to merge the js file into WASM, it's described at the end of the usage section |
Wizer is a tool to make the JS runtime instantiation quicker. It starts the runtime and dumps the memory after start, so when it's loaded to WASM it doesn't have to be initialized. From what I read it lowers the time to start SpiderMonkey in WASM from 10-20 miliseconds to a few microseconds.
What version of wasmtime binary do you have? It looks like it doesn't provide implementation for some of the WASI APIs 🤔
For that I'm not sure. You could probably add your own C++ functions and bind them to JavaScript APIs, but I'm not sure if there's something like that already available or if you have to write your own implementation |
@Guo-yyds the resulting component imports a few different WASI interfaces, not all of which are enabled by default by wasmtime. If you change |
Yes, that's roughly correct. As @drogus says, executing the top-level script during componentization makes it so that when processing an event later on, the script doesn't have to be run over and over again. If you don't want this to happen, you can call componentize.sh without passing in a JS file. You can then run |
@Guo-yyds, I don't have an answer to your question, but would you mind posting plain text rather than screenshots? I am sure you mean well, but screenshots are a fairly inaccessible way to present text for several reasons, which I described in this comment previously. Thanks! |
componentize.txt
|
@Guo-yyds thank you for trying to heed Chris' advice! ❤️ Unfortunately the
In this particular case though, it'd be even better if you could just link to the file in this repository, or ideally even to the exact part you mean (which you can do by clicking on the line number, and then Ctrl/Cmd-clicking a second line number to highlight a range of lines.) |
As for your actual message: the shell input you mentioned does pass a JS file, so it wouldn't work. This should I think work: ./componentize.sh -o my-component.wasm |
I have two questions:
Question one:
What is the relationship between this and spidermonkey?
What is the structure of this project that I see mainly in the test section consisting of wasmtime + wasmtools?
What does this have to do with spidermonkey?
Question two:
I want to run a js file that I wrote myself. How do I do it? tests is too confusing
The text was updated successfully, but these errors were encountered: