-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 support for documenting the C API #1928
Conversation
@@ -0,0 +1,2538 @@ | |||
# Doxyfile 1.8.17 |
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.
It's worth pointing out that I generated this file with doxygen -f doxygen.conf
. I've tweaked a number of settings internally but I'm hoping that most of this file can basically be ignored.
5d7979f
to
f04b9bf
Compare
This commit adds a bit of a skeleton of what it might look like to document the C API. Today the C API has virtually zero documentation because the upstream documentation does not exist and we haven't put a ton of effort into documenting our own extensions. Given that this is one of the main vectors we expect users to use Wasmtime, we should make sure it's thoroughly documented! I've never really done much documentation generation of C myself before, but I did a bit of searching and Doxygen seems reasonable proficient for doing this. This commit sets up what it might look like for Doxygen to be used for the C API. One nice feature of DOxygen is that we can document the items in `wasm.h` without actually modifying `wasm.h`. For those purposes a `doc-wasm.h` file was added here which is where we can put Wasmtime-specific documentation about `wasm.h`. There's quite a few functions in the C API so I didn't want to get them all done before getting consensus on this. I've started some skeletons of documentation for global types in `wasm.h` and also confirmed that documentation works for our own `wasmtime.h` and such header files. If this looks good to everyone and it runs reasonable well on CI then I can spend more time filling out the rest of the documentation.
Subscribe to Label Actioncc @peterhuene
This issue or pull request has been labeled: "wasmtime:c-api"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
This seems great to me! (Apart from the preposterously large config file, but I saw your comment about that, and oh well 🙃) One question: do you expect people to find this via a link from the overall Wasmtime docs, or do you plan to add a link to it somewhere else? |
The intention is that this will be available (once merged) at https://bytecodealliance.github.io/wasmtime/c-api/ (similar to https://bytecodealliance.github.io/wasmtime/api/wasmtime/ for Rust). I'd imagine we'd update our documentation to link to that, such as:
I'm also hoping that we can use this to help drive forward adding documentation to the upstream API when it's appropriate. |
@alexcrichton ok, that all sounds great to me! It probably makes sense to get a review from someone better capable of actually evaluating the technical parts, but as an approach, this looks great to me! |
FWIW, IMHO this is an excellent effort, thanks @alexcrichton! |
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.
LGTM! I'm guessing that the rest of wasmtime.h
docs will be added as we go, right? Also, IMHO this is a huge game changer for embedding wasmtime
in different languages. FWIW, I wish it was there when I was drafting out the basics of wasmtime-zig! So huge thanks @alexcrichton!
Thanks for taking a look @kubkon! And yeah I've actually got everything else filled out, which I'll post as a PR next |
This commit adds a bit of a skeleton of what it might look like to
document the C API. Today the C API has virtually zero documentation
because the upstream documentation does not exist and we haven't put a
ton of effort into documenting our own extensions. Given that this is
one of the main vectors we expect users to use Wasmtime, we should make
sure it's thoroughly documented!
I've never really done much documentation generation of C myself before,
but I did a bit of searching and Doxygen seems reasonable proficient for
doing this. This commit sets up what it might look like for Doxygen to
be used for the C API. One nice feature of DOxygen is that we can
document the items in
wasm.h
without actually modifyingwasm.h
. Forthose purposes a
doc-wasm.h
file was added here which is where we canput Wasmtime-specific documentation about
wasm.h
.There's quite a few functions in the C API so I didn't want to get them
all done before getting consensus on this. I've started some skeletons
of documentation for global types in
wasm.h
and also confirmed thatdocumentation works for our own
wasmtime.h
and such header files. Ifthis looks good to everyone and it runs reasonable well on CI then I can
spend more time filling out the rest of the documentation.