VOGONS


First post, by TinPlat

User metadata
Rank Newbie
Rank
Newbie

Hi everyone,

Over the past few months I've been working on a project to bring several modern web engine components to 16-bit Windows for Workgroups 3.11. The goal was to make it possible to parse HTML5, CSS, and run JavaScript directly on period hardware without relying on a proxy or modern machine.

Here's what I've ported:

- FreeType (compiled with MSVC 1.52c) – TrueType/OpenType font rendering
- Gumbo-parser (compiled with Open Watcom 2.0) – HTML5 parser
- LibCSS + libparserutils + libwapcaplet (Open Watcom 2.0) – CSS parsing and selection engine
- QuickJS (Open Watcom 2.0) – modern JavaScript engine (ES2020 support)

All of these are compiled as 16-bit DLLs and can be loaded dynamically or statically by Win16 applications (FreeType is dynamic-load only).

Current status:

- FreeType, Gumbo-parser, and the LibCSS family successfully compile and can be initialized from a test program. Basic functionality should work, though not every feature has been thoroughly tested.
- QuickJS also compiles and JS_NewRuntime / JS_NewContext work without GPF. However, JS_Eval currently hits a GPF when performing string concatenation inside an OP_add bytecode handler. The root cause appears to be a stack-pointer corruption issue when the JavaScript code uses string operations.

The project is hosted on GitHub:
Win16WebStack

Each subdirectory contains the original project's license and the modified source files.

I'm sharing this in the hope that the retro computing community finds it useful, and maybe someone with a deep knowledge of Open Watcom's code generation or QuickJS internals might be interested in taking a look at the remaining QuickJS bug. I've spent a lot of time on this, but I'm not sure how much more I can personally dedicate to it. That said, I'd be very happy if others want to pick it up, improve it, or even build something cool on top of it.

Building:

I've kept the project files intact, so you can open and compile them directly in the IDE.

If you have questions, feel free to open an issue on GitHub or reply here.

Thanks!

Reply 1 of 6, by leon22

User metadata
Rank Newbie
Rank
Newbie

Thank you so much for your work!

Hopefully I have time to test the WebStack. Will let you know.

Best regards

PS: maybe it's better to use plain English in the Readme

https://funwithretrocomputers.blogspot.com/

Reply 2 of 6, by TinPlat

User metadata
Rank Newbie
Rank
Newbie
leon22 wrote on 2026-08-05, 20:20:
Thank you so much for your work! […]
Show full quote

Thank you so much for your work!

Hopefully I have time to test the WebStack. Will let you know.

Best regards

PS: maybe it's better to use plain English in the Readme

Thanks for your kind words! I look forward to your feedback when you have time to test it. Good suggestion about the README, I have updated it to English. Thanks for the advice! I just published a Release, feel free to check it out.

Reply 3 of 6, by youxiaojie

User metadata
Rank Newbie
Rank
Newbie

great work!

Reply 5 of 6, by OzzFan

User metadata
Rank Member
Rank
Member

This sounds like a very cool project!

Hobbyist Developer : https://www.shelteringoak.com/du/

Reply 6 of 6, by TinPlat

User metadata
Rank Newbie
Rank
Newbie

I want to share a frustrating issue I ran into while porting QuickJS to 16-bit Windows, and ask if anyone knows of a more portable JavaScript engine.

QuickJS assumes that int is 4 bytes. On 16-bit compilers like Open Watcom, int is only 2 bytes. This is not a small issue, it causes serious memory corruption.

For example, JS_DefineProperty takes a flags argument. The engine defines a flag called JS_PROP_NO_EXOTIC as (1L << 16), which is 65536. But when flags is declared as int, it is truncated to 16 bits. The condition !(flags & JS_PROP_NO_EXOTIC) then always returns true, because the high bit of the flag is lost. This leads to infinite recursion and a crash.

This assumption causes problems in many other places too, and I have spent a lot of time fighting them.

So, does anyone know of a JavaScript engine that does not assume int is 4 bytes? One designed for portability and using explicit 32-bit types like int32_t where needed? It would be even better if it supports a reasonably modern version of JavaScript.

I will try to port such a project when I have time, and I will drop QuickJS support and updates.