-
Notifications
You must be signed in to change notification settings - Fork 9
API Discussion #3
Comments
cc @sunfish in case you have any thoughts |
@devsnek did you mean to cc @sunfishcode? |
indeed I did :) |
The goal with my PR was to avoid exposing an API entirely until things were more stable, and I still think that's a good approach, but it is rather awkward to set up. If we want to start with an API, I'd suggest branching off of VM and adding a new WASIModule class. From there all the various things a wasi module might want to do (evaluate directly, export functionality, etc) are well represented. |
I don't yet have a clear view on when to expose an API like this, but I can comment on some of the bikeshed colors ;-). In addition to
I would ideally like to avoid having WASI programs becoming accustomed to inheriting the entire environment by default, because it often contains interesting information specific to the host it's on and the user. What would you think about having this default to empty, and requiting users to explicitly specify which environment variables they'd like to propagate through?
What's the difference between this and the
|
Good point I've added that case.
If no environment was passed would we then just use an empty environment object? I suppose that would likely be ok in many scenarios actually?
I suppose it is because the first argument is supposed to be the path to executable and when running these virtualized programs it's a common slip to forget to include the path or some dummy value in its place. So it was really just personal preference to avoid that slip by defaulting to the wasm path itself from compilation. Child process in Node.js has |
Yeah. WASI is all about applications by default being unable to do anything until you give them capabilities. That seems to translate to environment variables as, by default they don't get to know your
Yes, that's clarifies it! |
Thought it would be worth getting the API discussion going here. The previous suggestion was a quick gist for discussion, thinking about it more I think it could be useful to:
Here's the adjusted suggestion for that approach:
This is still very much a bikeshed so feel free to get those colours out further... :)
(Previous suggestion: https://gist.github.com/guybedford/890339e83e8cb1abc636a84b003f7a78 )
The text was updated successfully, but these errors were encountered: