r/Compilers • u/Hopeful-Ad-1665 • 5d ago
I got tired of Python-wrapped VMs, so I rewrote my language’s entire frontend in Pure C. Here’s what happened in FoxVC v2.0 & the 0.7.1 “Titan” update.
Hey r/Compilers !
A while back, I started building FoxVC—a lightweight, zero-dependency scripting language and bytecode virtual machine designed around 25 deterministic keywords
(act, emit, pick, alt, spin, pulse, etc.).
Like a lot of hobby language projects, it originally started with a classic architecture: a Python frontend (lexer, AST parser, bytecode compiler) that called
into a fast C VM (foxvm.so) via ctypes.
It was fun, it worked, but eventually, I hit what I call the "3-language duplication trap":
1. You write a feature in Python.
2. You have to sync it with your C VM.
3. Then you want a WebAssembly browser playground, so you end up maintaining a third JavaScript parser that slowly drifts out of sync.
4. Worst of all: cold-start latency sucked. Spawning Python just to parse a 20-line .fox script took ~200ms before the C VM even touched the first bytecode opcode.
Over the last few weeks, I pushed two massive updates—v2.0.0 (Engine 0.7.0) and today’s v0.7.1 “Titan” update—to completely overhaul the engine.
5
u/good_name_0 5d ago
Is it ai generated like your post is?
3
u/Key_Detail15 5d ago edited 5d ago
How often do you have to cold-start Python? Anyway my tests show CPython has start-up overhead of 50ms on Windows and 30ms on WSL. Maybe there is another reason for that 200ms. (node.js is genuinely poor at some 500ms latency.)
If it needs Python then it's not quite zero! Unless you assume that a Python implementation exists (it doesn't on Windows).
I've had worse:
This sort of worked, but I got all sorts of horrendous 'phase' errors if I wanted to change details such as inserting a new bytecode. Changes were made to A's sources, compiled with the B interpreter whose binary still had the old codes..
In the end there was a 20-point step-by-step list to get everything updated, involving the old versions, new versions, and mixed versions.
Eventually the idea was dropped.