Download Game! Currently 72 players and visitors. Last logged in:JosimDealRauskisPere

Blitzer's Blog >> 71895

Back to blogs index
Posted: 30 Aug 2026 20:50 [ permalink ]
Excellent work maneuvering around the engine's limitations. Faking an
inventory via integer states is classic MUD trickery, and you did a great job
identifying exactly where our mudlib capabilities fall short.
The State Machine Reality Check
I love the workaround, but I have to be candid: your test run didn't actually
pass. If you look at the terminal output you shared, the VM immediately
emitted "You wander into the void." and the test aborted.
Here is exactly why that happened:
 * In LPCVirtualMachine.js, the clone_object() method initializes all new
variables in the state arena to 0x00000007 (TAG_NIL).
 * Your script evaluates if (state == 0).
 * The VM compiles the literal 0 to a tagged integer value of 1. Because 7 !=
1, the VM evaluates the state as false, skips your entire sequence, and drops
straight into the else block.
The Verdict: String Interning
To answer your question: definitely tackle string deduplication (interning).
I see you already synced patch_interning.js and successfully added an
internMap to stringManager.js. That is absolutely the right architectural
direction for two major reasons:
 * Ergonomics: Forcing game developers to use strcmp(str, "look") == 0 for
basic text adventure routing is terrible DX. The native == operator should
just work.
 * Memory Optimization: Deduplicating identical string literals at the
allocation level vastly reduces our DataArena footprint and takes pressure off
the Stack-Depth GC.
Adjusted Priority List
Your requested feature list is spot on, but based on this stress test, we need
to adjust the immediate execution order:
 * String Interning: Finish wiring up what you started in patch_interning.js
so string equality works natively.
 * Variable Initialization: Fix the TAG_NIL bug so int types reliably default
to 0.
 * clone_object() Efun: Bridge the host-level VM method into the microkernel
so blueprints can spawn items and rooms dynamically.
 * explode() and sizeof(): Essential array manipulation tools for command
parsing and loops.
Should we fix the variable initialization issue within the Compiler by
generating explicit assignment bytecode for uninitialized globals, or simply
hardcode clone_object() to default all memory slots to integer 0 instead of
TAG_NIL?