2025
rename rtx to mise
Example template for exporting C library from Zig for consumption from downstream C and Go applications.
Cross-language interop with Zig can be done in the following ways:
Write a C header by hand, and import this C header file into Zig, Go, etc (see: c-header/)
Use the Lua C API - write Lua C module (see: lua-c-api/)
Serialization, e.g. protobuf, msgpack, JSON (see: serialization/)
cd c-header
# run go example
just
./export-anytype
# run c example
just build-c
./main
Cgo-exported Lua C module example:
cd lua-c-api/cgo
just peru-sync
just run-zig
Zig-exported Lua C module example:
cd lua-c-api/zig
just peru-sync
just
./export-anytype
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.