-
Notifications
You must be signed in to change notification settings - Fork 57
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 initial documentation for C tooling #66
Add initial documentation for C tooling #66
Conversation
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.
Thanks @seanisom! I was able to get this all working and running on the example host! There were a few parts where i deviated from the flow and a little bit more information we can add
wasm-tools component new ./add-core.wasm -o add-component.wasm | ||
``` | ||
|
||
Do note this will fail if your code references any WASI APIs that must be imported. This requires an additional step as the WASI SDK still references `wasi_snapshot_preview1` APIs that are not compatible directly with components. |
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.
The adapter may have evolved in Wasmtime 13 as I am able to successfully create a component when adding print
and the adapter automatically imports the wasi worlds
>wasm-tools component wit ./component.wasm | ||
package root:component | ||
|
||
world root { |
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.
My output does not have any of the WASI imports:
package root:component
world root {
export add: func(x: s32, y: s32) -> s32
}
however, if i add print
(necessitating the wasi cli imports) then my output matches
Co-authored-by: Kate Goldenring <[email protected]>
Co-authored-by: Kate Goldenring <[email protected]>
Co-authored-by: Kate Goldenring <[email protected]>
Hey @sunfishcode @kate-goldenring , sorry for letting this go stale! Will rebase on top of the latest post #44 and incorporate the feedback. Regarding host component support for C in wasmtime, I need to follow up on bytecodealliance/wasmtime#6987 - Bailey mentioned Alex may have already started this work. If that is complete or a significant uplift I can address that in a follow-up PR. |
@seanisom @kate-goldenring what's the state of this PR - is this blocked on anything in particular? |
If this PR is going to be merged, don't forget to update the links on the landing page in Go wasn't included there and at first I thought support for Go didn't exist. See: #128. |
I think it would be great to start getting some docs in for C development that can grow over time. There really doesn't seem to be a good source generally (compared to other languages which have detailed docs elsewhere) and in the time this has been in review it's gotten outdated:
Those kind of updates would be easier to make in small PRs if the C docs became available. |
Fixes #38
Creating as a draft for now as I would like to see #44 merged first as that will change the structure of
/language-support
- I will update the table of contents to match that once I can rebase from that.