Skip to content

Commit bf6b34c

Browse files
authored
Revise instructions for running components in C/C++
Documentation is not my forté but the current "running things from C is impossible due to #issue (closed)" is _definitely_ out of date. Needs revision into a more helpful pointer to the code introduced in this PR, whatever its project name and contents shall end up being. Possibly broken out into a separate .md fragments like the rust one, possibly that was only necessary to share instructions with rust.md and the existence of the c/c++ host can stay local to this file.
1 parent 4a77b60 commit bf6b34c

File tree

1 file changed

+10
-11
lines changed
  • component-model/src/language-support/building-a-simple-component

1 file changed

+10
-11
lines changed

component-model/src/language-support/building-a-simple-component/c.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -323,20 +323,19 @@ if you followed the manual instructions above):
323323

324324
{{#include ../example-host-part2.md}}
325325

326-
## 7. Run the component from C/C++ Applications
326+
## 7. Run the component from the example C host
327327

328-
It is not yet possible to run a WebAssembly Component using the `wasmtime` C API.
329-
See [`wasmtime` issue #6987](https://github.com/bytecodealliance/wasmtime/issues/6987) for more details.
330-
The C API is preferred over directly using the example host Rust crate in C++.
328+
After setting up the wasmtime toolchain
329+
*TODO: somehow,*
330+
the `example-c-host` project can be built, and run our `adder` much like the rust one.
331331

332-
However, C/C++ language guest components can be composed with components written in any other language
333-
and run by their toolchains,
334-
or even composed with a C language command component and run via the `wasmtime` CLI
335-
or any other host.
332+
*TODO: the C++ API is nicer and may be more appropriate for example code*
336333

337-
See the [Rust Tooling guide](./rust.md#running-a-component-from-rust-applications)
338-
for instructions on how to run this component from the Rust `example-host`
339-
(replacing the path to `add.wasm` with your `adder.wasm` or `adder.component.wasm` above).
334+
C/C++ language guest components can also be composed with components written in any other language
335+
and run by their toolchains, or even composed with a C language command component and run via the
336+
`wasmtime` CLI or any other host.
337+
338+
*TODO: work in `wasmtime --invoke 'add(2,2)' adder.wasm`*
340339

341340
[!NOTE]: #
342341
[!WARNING]: #

0 commit comments

Comments
 (0)