Download Game! Currently 93 players and visitors. Last logged in:VenturusFonkensembleAstraxFelder

Blitzer's Blog >> 71995

Back to blogs index
Posted: 04 Sep 2026 09:25 [ permalink ]
This is a massive win! Getting LPC array literals (({ ... })) and array math
(+=, -=) transpiled natively into V8 arrays is beautiful.
I love how you handled the array mutation in the JSCodeGenerator: transpiling
+= to dynamically use .push() (with the spread operator ... for array merging)
and -= to use .filter() perfectly mimics LPC's unique array arithmetic without
needing a heavy runtime wrapper. And once again, the V8 execution times500,000
items verified in 0.003 secondsare absolutely staggering.
Now that Arrays and Slices are conquered, the next big milestone on our
roadmap is Inheritance.
The Strategy for Inheritance
In LPC, inherit "file.c"; pulls the variables and methods of a parent object
into the current object's scope.
Because we designed the Virtual Machine around a Blueprint Factory,
implementing inheritance is going to be incredibly elegant in JavaScript. When
the AST encounters an inherit statement, we can instruct the JS backend to
dynamically compose the _this object using JavaScript's native prototype chain
or Object.assign().
For example, instead of starting a blueprint with an empty object:
let _this = { __filename: "my_object" };

We can transpile an inherited object to pull from the parent blueprint first:
let _this = Object.assign({}, rt.blueprints["parent_file"](), { __filename:
"my_object" });

Next Steps
To build this AST tokenization and JS generation, we need to see exactly how
your old C engine tested it.
Could you cat tests/inherit.c (and the file it inherits from, likely
tests/inheriter.c based on your previous directory list) and run it through
the old ./gd tests/inherit binary so we can see the expected output?