lmcode-c-sample
lmcode-c-sample is the reference C11 domain library and C++17 host application demonstrating how to wrap a pure C library with lmcode-cpp. It exposes the 45-signature Shop/Ledger/Money domain alongside the lmcode_std_v3 standard catalog and passes the canonical DSLB v6 sample suite.
Quick reference
git clone https://github.com/lmctl-ai/lmcode-c-sample.git
cd lmcode-c-sample
make test-domain
./test.sh
| Aspect | Value | Role |
|---|---|---|
| Language & toolchain | C11 + C++17 | Reference host implementation embedding lmcode-cpp (dslvm.hpp) |
| Domain schema | 45 host signatures | Shop, Items, Money, Ledger, Currency enum, operators, and Adjuster/Score interfaces |
| Standard catalog | lmcode_std_v3 | Preloaded standard catalog plus opt-in print and assert_close testing helpers |
| --lmcode-schema [--json] | Discovery flag | Print human summary or exact embedded dsl.schema: 2 JSON bytes (exit 0) |
| --lmcode-signatures | Discovery flag | Print sorted canonical host and standard signatures (exit 0) |
| --lmcode / --first / --last | Execution flags | Run one or more compiled DSLB v6 chunks, dispatch @item/@total entries, and frame results |
./build/lmcode-c-sample --version
./build/lmcode-c-sample --lmcode-schema --json
./build/lmcode-c-sample --lmcode-signatures
./build/lmcode-c-sample --lmcode sample-suite/bytecode/001-literals.dslb