C
Prerequisites
Section titled “Prerequisites”A C17 compiler and Boehm-Demers-Weiser GC 8.x built with threads. Crypto and HTTP add OpenSSL 3 and, for HTTP, libcurl discovered through pkg-config.
Compile and run
Section titled “Compile and run”From a prepared source module containing a main package:
goalchemy compile -target c -out out/c .cd out/csh run.shOr use goalchemy run -target c . to compile and execute in a temporary directory. Add -gate cooperative for source tasks or suspending operations.
Generated output
Section titled “Generated output”The C target emits main.c, package-owned pkg_*.c translation units, shared.c, declaration-only goalchemy_internal.h, selected rt/ files, and run.sh. The build compiles explicit native source units.
Every output includes its own README.md, selected runtime files, source mappings, and goalchemy.manifest.json. See the full output reference for the inventory and entry behavior.
Native libraries
Section titled “Native libraries”Non-main packages produce goalchemy.h, build.sh, and libgoalchemy.a. The owned gxc_value API supports value trees, cooperative calls, and error mapping. Older scalar entry points have narrower types and do not support suspending exports. Read the library output reference before choosing an API.
Runtime and diagnostics
Section titled “Runtime and diagnostics”GOALCHEMY_BDWGC can identify a collector install prefix; otherwise the runner uses pkg-config or -lgc. CC, CFLAGS, and LDLIBS are honored. .c.lines sidecars map generated lines. Native byte storage remains collector-owned and preserves source aliasing.