Fun's Declarative UI Runs on Windows 95 via a 1996 IE3 Control
This demo proves that a 2026 language can still drive a UI through a 1996 browser control, with no Chromium or Node in sight. The architectural pattern, attributes as directives and event delegation, later became the basis of z-data, a library that runs in modern browsers at 8KB.
On Windows 95 OSR2 (4.00.1111), the Fun language's lib-ui.fun builds a Form that wraps a Win32 window around an embedded IE3 WebBrowser control. The UI is written in HTML and CSS, parsed by IE3's 1996-era DOM, while events from the browser are routed back into Fun objects. A working demo, a random password generator, shows the pattern: fun:data binds a Fun variable to an input's value, fun:click and fun:key trigger Fun methods, and JScript's Fun.call invokes a native window title change through COM and user32.dll.
The binding system in lib-bind.fun works at event granularity, not keystroke granularity. Bind scans document.all during beforeShow, registers elements with fun:data, and runs Save before clicks and Load after clicks. This is a deliberate compromise because IE3 lacks reliable input events. fun:key translates Win32 key codes (F-keys, Ctrl+letter, Alt+letter) into named commands that map to methods on the Fun object, allowing a single button to respond to six different input combinations.
The article clarifies what this setup is not: no virtual DOM, no dependency tracking, and the old IE DOM (document.all, srcElement, getAttribute with a case-insensitive flag). These limitations trace to the host control, not Fun itself; the same code runs on Windows 11's MSHTML WebBrowser control. The pattern is also the direct precursor to z-data, an 8KB JavaScript library that adopts the same attribute-directive, event-delegation, minimal-runtime philosophy, now hosted in browsers via WebSocket bridges instead of COM.
Running a 2026 language on a 1996 browser control is a deliberate stress test for the Fun language's FFI and COM bridge; it shows the same five-tier architecture works across a 30-year gap.
The decision to synchronize data on clicks rather than keystrokes is a candid admission that even a modern language can't fix a host DOM that lacks input events, so the abstraction adapts to the platform's limits.
The fact that the same code runs on Windows 11's MSHTML control means the Win95 demo is not about nostalgia; it's about the longevity of a COM-based embedding interface.
Describing z-data as a 'precursor' rather than a successor reframes the Win95 work as a proof of concept that later hardened into a real library, not just a throwaway hack.
Running your own language on Win95's native IE is genuinely fun, and the tinkering energy is maxed out. A single fun.js can run it, and the approach is both wild and clean.