-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add host module for ww proc API. #111
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lthibault
force-pushed
the
feat/proc-exports
branch
2 times, most recently
from
April 15, 2023 20:45
c941423
to
3749f5e
Compare
mikelsr
approved these changes
Apr 16, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you for taking the time to do it and talk it with me!
lthibault
force-pushed
the
feat/proc-exports
branch
from
April 16, 2023 18:36
3749f5e
to
c9f3f16
Compare
Converting to draft. I'm going to try to break this into a few smaller PRs. |
lthibault
referenced
this pull request
Apr 18, 2023
https://github.com/wetware/ww/pull/111 requires unsafe.SliceData, which is not available before 1.20. This PR updates the version number in go.mod and removes 1.19 from CI. We could preserve backwards compatibility by using build tags and relying on the highly-unsafe runtime.SliceHeader, but given that we are still pre-1.0, I don't think it's worth the trouble.
lthibault
referenced
this pull request
Apr 19, 2023
https://github.com/wetware/ww/pull/111 requires unsafe.SliceData, which is not available before 1.20. This PR updates the version number in go.mod and removes 1.19 from CI. We could preserve backwards compatibility by using build tags and relying on the highly-unsafe runtime.SliceHeader, but given that we are still pre-1.0, I don't think it's worth the trouble.
Merged
I think this has been superseded. Closing, but happy to reopen if needed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stacked on top of #109 & #110. Merge those first✔️The scope of this PR has expanded a little bit since I started, so I'm cutting it off here. At present, it adds:
pkg/csp/proc
: a WASM host module that provides a Cap'n Proto RPC transport between the host and guest code.guest/tinygo
: a library for writing processes written in Go using TinyGoFollow-up work:
Host
capability (or equivalent) topkg/csp/proc.Module
(currently, the guest sees a null capability)guest/tinygo
What is a host module?
A host module is native Go code that the webassembly binary can call. It's webassembly module whose functions are implemented by Wetware itself.
What is
guest/tinygo
?guest/tinygo
is a client library for users who wish to write Wetware processes in Go, using TinyGo. When imported, it will provide access to cluster capabilities like pubsub, processes, etc. It is not yet fully implemented, but it does succeed in negotiating anrpc.Conn
with the host.Users are able to write processes as ordinary Go programs, e.g.:
To compile:
tinygo -o main.wasm -scheduler=asyncify -target=wasi main.go
To run:
ww run main.wasi