Closed codefromthecrypt closed 3 months ago
It seems maybe it is this, but looks abandoned? e.g. it isn't defined in the new format and untouched recently cc @sunfishcode https://github.com/WebAssembly/wasi-classic-command/blob/main/standard/classic-command/docs.md
However, it seems there's not enough defined to actually bootstrap a wasi command.
I'm also curious because WAsm2C
and the third-party W2C2
each require that the main function be already be written in C independently from the generated code. This is undesirable in the long term.
I was thinking of replacing the C backend of W2C2 or WAsm2C with calls to LibGCCJIT for more parallel building without the need for back-to-back source generation and immediate reparsing.
Does #509 relate to or answer this question?
@SamuraiCrow it relates, though it is indirect. For example a "command function" would indeed read things like pre-opens, but pre-opens themselves currently are functions (stat and name). It is still murky to me how this stitches together, particularly how you map snapshot01 to this. I'll try to follow along and thanks for the hint.
The preview1 _start
function as used in preview1 is documented here. It has no arguments, and preview1 has functions for retrieving arguments and environment variables.
I also filed https://github.com/WebAssembly/WASI/pull/510 which hopefully makes the preview1 docs a little easier to navigate. It removes the old "phases", "snapshot", and "ephemeral" terminology, and just calls things "preview0" and "preview1", which are the terminology we tend to refer to them by now.
I noticed here, several wasi modules being clarified. However, it seems there's not enough defined to actually bootstrap a wasi command. Notably, we're missing definition of the _start function, memory (basically nothing works without it), how to enumerate pre-opens and how to get args and env. Are you thinking a "wasi-bootstrap" all in, or micro modules like wasi-env?