Show HN: WinGPT – AI assistant for Windows 3.1 (opens in a new tab)dialup.net
382 pointsHey HN, I didn't want my Gateway 4DX2-66 from 1993 to be left out of the AI revolution, so I built an AI Assistant for Windows 3.1, based on the OpenAI API.
The most interesting parts of building this were:
- Getting TLS 1.2 and 1.3 working on Windows 3.1 so that WinGPT could directly connect to OpenAI's server without relying on a modern machine for TLS termination.
- Learning about the memory segmentation architecture on 16-bit Windows, including the difference between far and near pointers.
- Building the UI in plain C code with the Windows API and limited selection of controls in Windows 3.1.
You can check it out here and learn more about what it was like to build it: https://www.dialup.net/wingpt/
Comments (90) 29 threads
IIRC it ships with Windows 2000, but works on Windows 95 too.
That's in a separate page here: https://www.dialup.net/wingpt/tls.html
...and is well worth reading. I'm surprised you had trouble getting a TLS implementation to fit in 64k of code and data, since a lot of deeply-embedded stuff (some even using 8-bit CPUs with bankswitching) for IoT and similar applications support TLS 1.2.
It's a sad day when slightly older operating systems have trouble accessing the internet.
Now half of my UIs have "Tap to...." labels when localized. So many amazing modern UI tools and the rockstar developers wielding them can't even make a draggable sidebar.
I do, however have considerably more time for script kiddies.
Even resizing regular windows was not always an option, and if it was, it was very rarely thought through by the developers. I vividly remember that the Swing framework for Java was very special just because of this, as in you couldn't really specify it in pixels where your components would be placed, you'd have all sorts of strategies to divide and position them. (Not saying it was any good, but certainly a notable effort.)
Not only that, but window resizing was something that had to be implemented for each window, so lots of applications had unresizeable dialogs and only the "document" area was resizeable.
Even worse, the use of pixel positioning meant that nothing was scaleable. High-DPI display? Choose (a) not being able to read anything or (b) bad linear rescale by a limited number of scales.
I too am a fan of the simplicity and clarity of the old Windows UI, and Microsoft haven't really managed to improve on it, but let's not pretend it doesn't have serious limitations.
Continue this thread — 1 reply
You can trade space for CPU time using SAX-style parsing[1]. SAX-style parsing visits each node of a tree from top to bottom, firing events for each node visited. The amount of memory required compared to fully parsing JSON is negligible, and writing a custom SAX-style parser for JSON shouldn't be too difficult. There are existing SAX-style JSON parsers you can examine as well.[2]
[1]: https://en.wikipedia.org/wiki/Simple_API_for_XML [2]: https://rapidjson.org/md_doc_sax.html
All comments shown.
Couldn't load more comments. Check your connection and try again.