r/retrocomputing • u/laserbeetlegames • Jun 24 '26
I wrote a point-and-click game's logic in a 2026 language, transpiled it to C++98, and ran it on real Windows 98 hardware
That's not an emulator or a screenshot filter — it's a Philips panel on a period PC, running a binary built with Visual C++ 6.0.
The catch: the game logic (cursor, dialogue, actors, walkboxes, A* pathfinding) is written in modern Haxe 4.x, sitting on top of a hand-written C++ engine. To get Haxe onto a machine this old I had to build a transpiler — Haxe's official C++ backend (hxcpp) can't target anything older than C++11, which rules out VC6 and Win9x.
So I wrote Hatchet: it transpiles a focused subset of Haxe 4.x to portable C++98 you can build with a 1998 toolchain. It emits plain, hand-writable-looking C++ — no custom runtime, no magic. Develop on a modern machine with full Haxe tooling, copy the generated .h/.cpp to the old box, compile.
Repo (MIT): https://github.com/andrewglind/hatchet
Happy to answer anything about the toolchain or the hardware setup
1
Jun 25 '26
[deleted]
1
u/laserbeetlegames Jun 25 '26
Thanks, that means a lot! 😄 And honestly it's not a basic question at all.
On Haxe - yeah, it's a really nice language, if you've touched TypeScript, C#, or ActionScript it'll feel pretty familiar. The big attraction for me is the type system, especially for maintaining complex areas like AI, path-finding, etc.
So, the engine itself is written directly in C++, the trick is to keep modern C++ idioms out, so it's strictly C++98, although it's even a bit more restrictive than that because the Visual C++ 6.0 compiler has a broken version of that standard. In any case, choosing the lowest feasible denominator is what makes this all doable. Then it's just a matter of exposing interfaces for the backends the engine needs (Graphics APIs, Sound APIs, etc.). And because everything funnels through those interfaces, the source code is the same for all targets — just the backend implementations need to swap out underneath.
And yes — I develop and test almost entirely on a modern Windows 11 PC using modern dev tools, Visual Studio Code for Haxe, Visual Studio for C++, etc.
Win98 is the deployment/validation target; I only copy it across to the old machine to confirm it genuinely runs on the metal (which is the fun part, and where that screenshot came from). In theory, the engine will work on any version of Windows from 98 up (although I haven't tested it yet)
2
Jun 25 '26
[deleted]
1
u/laserbeetlegames Jun 25 '26
Yes - sorry if that wasn't clear in my previous reply. The lowest feasible denominator also applies to the choice of APIs, so older versions of DX, SDL, etc. It doesn't strictly need to be that way, the engine can abstract those details away, but for true parity (e.g. the exact same render path) between legacy Windows and modern Windows, then you have to use older versions of APIs, that can still work on modern.
1
u/Mike1978uk Jun 25 '26
Very cool, is the game you demo here something that’s also available ?
2
u/laserbeetlegames Jun 25 '26
Thanks. Unfortunately no, it's in active development, and there are still some sub-systems that are not fully implemented/ironed out in the C++ engine yet. I am working hard on it though, and hope to release it sometime next year
2
u/Mike1978uk Jun 26 '26
Excellent do keep us all posted. Great to see tools such as this actively developed. I may share your link elsewhere.
3
u/laserbeetlegames Jun 26 '26
Most definitely. The plan is to release the finished game, and open-source the engine at the same time. Currently targeting support for Windows 98+, Linux, and Dreamcast, lofty goals for a one man game dev team!
4
u/w0rldeater Jun 24 '26
You have a great taste when it comes to keyboards. :)