1# Working with `externref`
2
3You can also browse this source code online and clone the wasmtime
4repository to run the example locally:
5
6* [Rust](https://github.com/bytecodealliance/wasmtime/blob/main/examples/externref.rs)
7* [C](https://github.com/bytecodealliance/wasmtime/blob/main/examples/externref.c)
8* [C++](https://github.com/bytecodealliance/wasmtime/blob/main/examples/externref.cc)
9
10[code]: https://github.com/bytecodealliance/wasmtime/blob/main/examples/externref.rs
11
12This example shows how to pass opaque host references into and out of WebAssembly using `externref`.
13
14## Wasm Source
15
16```wat
17{{#include ../examples/externref.wat}}
18```
19
20## Host Source
21
22<!-- langtabs-start -->
23
24```rust
25{{#include ../examples/externref.rs}}
26```
27
28```c
29{{#include ../examples/externref.c}}
30```
31
32```cpp
33{{#include ../examples/externref.cc}}
34```
35
36<!-- langtabs-end -->
37