Skip to content

Add an already-called error to run for wasip3. #74

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions wit-0.3.0-draft/run.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
@since(version = 0.3.0)
interface run {
/// Run the program.
@since(version = 0.3.0)
run: func() -> result;
/// Run the program.
///
/// This function is only meant to be called once per Wasm instance. If it
/// is called more, it will immediately fail with `error.already-called`.
///
/// If a program wishes to exit with a specific exit status value, it should
/// use the `exit.exit-with-code` function to exit rather than returning
/// from `run`.
@since(version = 0.3.0)
run: func() -> result<_, error>;

/// An error code returned by `run`.
@since(version = 0.3.0)
enum error {
/// The program did not complete successfully.
error,

/// The `run` function has already been called in the callee's instance.
already-called
}
}