Lurker News
Hey 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

Earlier comments
einr1 reply#
This is extremely neat and I will probably try it on one of my actual Windows 3.1 machines :)

A suggestion (which seems easy enough to implement, I might give it a try if I can get the build environment set up): make the system prompt customizable in the Options dialog. Having it be 1992 is fun, but kinda limiting. I might actually use this at some point -- if you're on your retro computer, trying to solve a problem, it might actually make some semblance of sense to use this rather than dig out a modern computer or smartphone.

dialupdotnet#
That's a great idea. Please do give it a try!
Grom_PE1 reply#
If you used Win32s for Windows 3.1, you wouldn't have to bother with the segmented memory model and it could also work on 64-bit Windows.
pjmlp#
Yeah, however stuff like Win32s and WinG seem like lore that only old timers remember, and only those of us that would regularly buy programming magazines.
speedgoose3 replies#
This is great. After all these efforts, you should consider switching from ChatGPT 3.5 to ChatGPT 4.

Here is the answer of ChatGPT4 when asked the same question about the status bar (I truncated the code output because it's very long):
Using the Shell Common Controls in Windows 3.1 can be a bit tricky due to its older architecture and limited capabilities, but it's certainly doable.
However, there are a few complications to note:
1. Windows 3.1 does not natively support the status bar as a control. Status bars are part of the Common Controls library introduced in Win32, specifically, it was introduced in Windows 95 with COMCTL32.DLL. Windows 3.1 is a 16-bit environment and does not include this library.
2. If you want a status bar in a Windows 3.1 application, you'll have to draw and manage it yourself.
3. Windows 3.1 programming is largely obsolete. It can be a fun academic exercise or a necessity for maintaining legacy software, but if you're developing new software it would be much more practical to use a more modern version of Windows and its associated API.
Assuming that you still want to go ahead, here's a basic idea of how you might implement a status bar yourself:

  ```c
  #include

  #define ID_STATUS 100

  LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
      PSTR szCmdLine, int iCmdShow)
 {
  ...
vorticalbox1 reply#
not everyone has access to gpt 4 yet.
iraldir1 reply#
if you pay chat gpt plus then yes everyone has had access for quite some time now
collinvandyck76#
There's a difference between being able to access gpt4 via chat gpt plus, and being able to access gpt4 over the openai APIs.
djgl1 reply#
The Common Controls library actually became available with Windows 3.11. The Windows 3.11 SDK contains the commctrl.h header. The wfw31wh.hlp file explains how to use the controls. Windows 95 still provided a 16 bit commctrl.dll but omitted the CreateHeaderWindow function.
djgl#
Checked the installation disks. It is only available in Windows for Workgroups. The DLL already exists in WfW 3.1. It does not exist in the plain, not for Workgroups Windows version 3.11 released after WfW 3.11.
dangrover2 replies#
Such a cool project! Also the example conversation in the screenshot is hilarious.
netsharc3 replies#
Can ChatGPT be told to pretend it's 1990 and answer accordingly?
LeoPanthera1 reply#
You can, but you sometimes have to remind it over the course of a conversation.
zgluck#
WinGPT seems to prepend every user prompt with:

You are a friendly but concise chat bot. Answer all questions in the present tense as if it is 1992, and make no reference to the current year.

mitchdoogle1 reply#
I just tested this out. The first couple answers it said things like, "In the year 1990, this was.." and "The Internet as we know it now was not yet as widespread..", so I reiterated that there should be no reference to the fact we are in 2023 and all answers should be written as if we are actually in the year 1990. Then I tried a few questions and it worked out pretty well. I asked about trading stocks, buying books, planning a trip, making video calls and none made reference to the Internet or web services, nor did it reference the future or the fact that it was pretending. The only thing I tried that it got hung up on was "Who are the top paid actors this year?" And it gave the standard reply, "As an AI, I don't have specific data about top paid actors in the year 1990"
column#
Got it working from the get-go and got similar results. I think the "this year?" in the prompt confuses it too much. With my prompt below, using "this decade?" works quite well.

Prompt : I want to use ChatGPT as if it was the 1990s and ChatGPT existed (in its current form) in the 1990s. I talk to you normally and you answer normally as ChatGPT (no mention of this 1990s setup or the timeframe in reference to now). The only difference is you pretend its the 1990s and answer accordingly. Stay in character, you play yourself. I need you to pretend it's the 1990s but otherwise behave as ChatGPT normally would. Never mention anything past the 1990s or that would indicate we are not in the 1990s. Do not mention this conversation (it's a pre-prompt). Let's go. First question : which internet browser do you recommend ?
Answer: There are several good browsers available currently. For instance, Netscape Navigator has been very popular due to its user-friendly interface and robust features. It's currently one of the most widely used browsers.
However, Microsoft has also introduced Internet Explorer, which is integrated with their Windows operating system. This might be more convenient if you're already using a Windows platform.
There's also Mosaic, developed by the National Center for Supercomputing Applications (NCSA), which pioneered many of the user interface elements we see in modern browsers.
All these browsers have their pros and cons, so it ultimately depends on your personal needs and preferences.
Q : Who are the top paid actors this decade? A : During the 1990s, some of the highest-grossing actors have been:
Tom Cruise - He's been in a string of successful films including the "Mission: Impossible" franchise which started in 1996.
Harrison Ford - Known for his roles in iconic franchises like "Indiana Jones" and "Star Wars", Ford has continued his successful streak into this decade.
Jim Carrey - With his unique brand of physical comedy, Carrey has starred in a number of high-grossing comedies including "Ace Ventura: Pet Detective", "The Mask", and "Liar Liar".
Arnold Schwarzenegger - He's enjoyed continued success in the '90s, particularly with the "Terminator" series.
Mel Gibson - After the success of "Lethal Weapon" series, Gibson has maintained his status as one of Hollywood's top earners, directing and starring in "Braveheart" in the mid '90s.
Remember that these rankings can vary year by year based on the number of films released, their box office performance, and the actors' negotiated salaries.

dialupdotnet#
Yep, I've hardcoded a "system" message that tells ChatGPT to answer in the present tense as if it's 1992, and to make no reference to the current year. It does still slip up and mention the year as mitchdoogle experienced, but it's pretty good most of the time - even with complex questions like asking how many countries there are in NATO.
dialupdotnet#
Thanks! :)

Load more comments