lmcode-cpp-sample
lmcode-cpp-sample is the canonical C++17 reference Shop and Ledger host that defines the 123-case portable sample suite for all lmcode runtimes. It embeds the header-only lmcode-cpp SDK, binds 45 host signatures plus lmcode_std_v3, dispatches @item and @total rule entries, and emits LMCODE_RETURN frames.
Quick reference
git clone https://github.com/lmctl-ai/lmcode-cpp-sample.git
cd lmcode-cpp-sample
python3 scripts/sync.py check
./test.sh
| Aspect | Value | Role |
|---|---|---|
| Language & toolchain | C++17 | Reference host implementation embedding lmcode-cpp (include/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-cpp-sample --version
./build/lmcode-cpp-sample --lmcode-schema --json
./build/lmcode-cpp-sample --lmcode-signatures
./build/lmcode-cpp-sample --lmcode sample-suite/bytecode/001-literals.dslb