Skip to content
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

Switch to using wasi_snapshot_preview1.command.wasm #400

Closed
wants to merge 1 commit into from

Conversation

elliottt
Copy link
Contributor

@elliottt elliottt commented Feb 1, 2023

The wasi_snapshot_preview1.command.wasm adapter provides the command interface for running components, which we'll need for running the output of the js-compute-runtime.

@guybedford
Copy link
Contributor

It may be worth introducing a new exported function for this component which explicitly encapsulates the lifecycle, as opposed to switching into a command adapter. The reason I suggest this is that we may want longer-living lifecycles in future which are not at all compatible with commands. In the prototyping work I've been doing I did also have issues with using commands for longer-running applications.

I wonder how hard it would be to implement something like:

init: func() -> Result<_, errcode>

where internally it would just call what is currently the main? Effectively like a command but using our own encapsulation to enable future flexibility?

@elliottt
Copy link
Contributor Author

elliottt commented Feb 1, 2023

I'm not sure what the right path forward is here, but I do know that xqd/viceroy will be moving towards accepting wasi-command components in the short-term. Additionally, there's no reason that we can't have multiple entry-points in the future, so switching to the command adapter here doesn't cut off any future directions that we might want to take.

@guybedford
Copy link
Contributor

Additionally, there's no reason that we can't have multiple entry-points in the future, so switching to the command adapter here doesn't cut off any future directions that we might want to take.

Unfortunately this isn't the case, because WASI commands assume that everything can be deallocated at the end of the main function, unlike non-commands which allow function calls to continue later on in the execution.

@elliottt elliottt marked this pull request as draft February 16, 2023 23:50
@elliottt
Copy link
Contributor Author

The viceroy components branch has been updated to use the reactor-based interface, so this PR is no longer needed.

@elliottt elliottt closed this May 15, 2023
@JakeChampion JakeChampion deleted the trevor/wasi-snapshot-command branch August 9, 2023 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants