lmcode-kotlin-sample
lmcode-kotlin-sample is the idiomatic Kotlin reference Shop and Ledger host built on the vendored lmcode-java SDK and passing the canonical sample suite. It demonstrates Kotlin SAM lambda bindings, byte-exact VmString handling, R49 @item and @total rule entry dispatch, and LMCODE_RETURN framing.
Quick reference
git clone https://github.com/lmctl-ai/lmcode-kotlin-sample.git
cd lmcode-kotlin-sample
python3 scripts/sync.py check
mvn package -DskipTests
./test.sh
| Aspect | Value | Role |
|---|---|---|
| Language & toolchain | Kotlin (JDK 21) | Reference host implementation embedding lmcode-java (vendor/lmcode-java) |
| 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 |
./bin/lmcode-kotlin-sample --version
./bin/lmcode-kotlin-sample --lmcode-schema --json
./bin/lmcode-kotlin-sample --lmcode-signatures
./bin/lmcode-kotlin-sample --lmcode sample-suite/bytecode/001-literals.dslb