This example shows the full host integration loop with generated artifacts:
- compile a Lockstep source file,
- emit LLVM IR + C header,
- compile/link with a C host,
- allocate arena memory,
- initialize data,
- call
Lockstep_Tick.
minimal.lock: a tiny Lockstep program that declares one stream and one uniform.minimal_host.c: a C host that includes the generated header and executes one tick.
From the repository root:
mkdir -p examples/build
lockstepc examples/minimal.lock --emit-ir > examples/build/minimal.ll
lockstepc examples/minimal.lock --emit-header > examples/build/lockstep_generated.h
clang -c examples/build/minimal.ll -o examples/build/minimal.o
clang -std=c11 examples/minimal_host.c examples/build/minimal.o -Iexamples/build -o examples/build/minimal_host
./examples/build/minimal_hostExpected output:
After tick: pos=10.00 vel=2.00 dt=0.50
This verifies the generated ABI end-to-end (header + LLVM IR + host application wiring).