Add initial documentation for C tooling#66
Add initial documentation for C tooling#66kate-goldenring merged 6 commits intobytecodealliance:mainfrom
Conversation
kate-goldenring
left a comment
There was a problem hiding this comment.
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.
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.
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 <kate.goldenring@gmail.com>
Co-authored-by: Kate Goldenring <kate.goldenring@gmail.com>
Co-authored-by: Kate Goldenring <kate.goldenring@gmail.com>
|
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.