A modular, cross-language stack-based interpreter with semantic search capabilities.
LLMVCS/
├── vc-database/
│ ├── source/ # Human-readable function definitions (.txt)
│ ├── vectors/ # Vectorized outputs (.dat)
│ └── vcdb.py # Converts .txt → .dat and semantic search via TF-IDF (pure Python)
├── vcs-js/ # Working JavaScript interpreter + compiler for .vcs
│ ├── modules/ # Opcode modules (registered into the engine by moduleId)
│ ├── stacks/ # Example .vcs programs
│ └── vcs.js # Single-file interpreter + compiler (JS)
├── vcs-pseudo/ # Language-agnostic single-file interpreter specification
│ └── vcs.pseudo
Define operations in a simple format. Each entry separated by \n\n gets a sequential ID (0, 1, 2...).
add | Adds two types.
subtract | Subtracts two types.
multiply | Multiplies two types.
cd vc-database
python vcdb.pyConverts .txt files to .dat (JSON TF-IDF vectors) for semantic search.
# Run this from inside `vc-database/`
from vcdb import search
results = search(
query="how to add numbers",
db_path="vectors/llmvcc-ops.dat",
top_k=3,
)Compact instruction format: moduleId.methodId(params)
// Comments start with //
0.13("Hello") // print("Hello")
0.11("x", 10) // store("x", 10)
0.17($x, 5) // add($x, 5)
0.5(0, true) // jump_if(0, true)
0.1() // stop()
The current JS compiler (vcs-js/vcs.js) parses numeric moduleId.methodId(...) only. Named variants like math.add(...) are a potential extension, but are not implemented today.
- Numbers:
10,3.14 - Strings:
"hello",'world' - Booleans:
true,false - Variables:
$varName
LLMVCS relies on stable numeric IDs:
- Module IDs are derived from the entry order in
vc-database/source/vector-categories.txt - Operation IDs / opcodes are derived from the entry order in each
vc-database/source/*.txt
Reordering existing entries is a breaking change. Prefer only appending new entries to preserve old IDs.
Recommended convention (optional): add a format version header to .vcs programs:
// vcs:1
- Create
vc-database/source/your-module.txtwith operations - Add entry to
vc-database/source/vector-categories.txt - Implement the module in your interpreter (for JS, add a class under
vcs-js/modules/witheval(methodId, args, ctx, regs, strings)) - Register it into the engine at the desired
moduleId - Run
vcdb.pyto update the search index
The interpreter design is intended to be portable across languages. The authoritative portability reference is vcs-pseudo/vcs.pseudo, and vcs-js/ is a working reference implementation.