Go-legacy-winxp: Compile Golang 1.24 code for Windows XP
87 points
3 days ago
| 6 comments
| github.com
| HN
OsrsNeedsf2P
6 hours ago
[-]
There's a surprisingly large Windows XP community; everything from security patches to browsers[0] to third party Discord clients[1].

[0] https://www.mypal-browser.org/ [1] https://github.com/DiscordMessenger/dm

reply
dataflow
5 hours ago
[-]
What I don't understand is... why? I understand keeping alive software for the sake of hardware compatibility, but browsing the web and running Discord? Is it all really just to save a few hundred dollars over... 24 years?
reply
robinsonb5
5 hours ago
[-]
Perhaps because the level of respect that Windows has for its users has dropped with each successive version?

Not to mention bloat: I have a keyboard with a dedicated calculator button. On a machine with Core i5 something or other and SSD it takes about 2 seconds for the calculator to appear the first time I push that button. On the Core 2 Duo machine that preceded it, running XP from spinning rust, the calculator would appear instantly - certainly before I can release the button.

But also WinXP was the OS a lot of people used during their formative years - don't underestimate the power of nostalgia.

Also, for some people the very fact that Microsoft don't want you to would be reason enough!

Personally if I were into preserving old Windows versions I'd be putting my effort into Win2k SP4, since it's the last version that doesn't need activating. (I did have to activate a Vista install recently - just a VM used to keep alive some legacy software whose own activation servers are but a distant memory. It's still possible, but you can't do it over the phone any more, and I couldn't find any way to do it without registering a Microsoft account.)

reply
refulgentis
4 hours ago
[-]
“On the Core 2 Duo machine that preceded it, running XP from spinning rust, the calculator would appear instantly - certainly before I can release the button.”

This reminds me that there’s an NBA rule that disallows any basket made after a clock stoppage with 300ms or less in the clock - i.e. if player A managed to pass to player B who then attempted a shot, it’s impossible for all that to occur before 300 ms has elapsed.

Meaning, I’m sure you remember it fully launched, 100% certainly before the key came back up from your press, but that is impossible.

reply
mikkupikku
3 hours ago
[-]
Your comment reminds me of that rule from baseball that says something about batters and hats, or maybe it was about helmets or something, it doesn't really matter though because the only point of this sports ball rambling is to distract you from noticing that my "nuh uh" has no substance. Did it work?
reply
refulgentis
3 hours ago
[-]
This is more than a bit out of place on HN in my experience, please, try to engage politely.

I’m not sure what I can say that will qualify as more than “nuh uh” to you, shy of getting a Core 2 Duo running with XP and the same keyboard as OP. That isn’t possible at the moment, is there anything else I could do?

reply
actionfromafar
3 hours ago
[-]
300ms is a lot of time, especially if the calculator.exe was in disk cache already.
reply
refulgentis
3 hours ago
[-]
300 ms is a long time on a computer, definitely. Just, the autistic side of me has to speak up when it’s wildly unrealistic glorification of the past.

Keypress duration is likely much less than 300 ms, top Google result claims 77 ms on average. And that’s down and up.

I see it being in cache already as sort of game playing, i.e. we can say anything is instant if we throw a cache in front of it. Am I missing something about caching that makes it reasonable? (I’m 37, so only 18 around that time and wouldn’t have had the technical chops to understand it was normal for things to be in disk cache after a cold boot)

reply
do_not_redeem
2 hours ago
[-]
Okay, let's say the cache is cold and you're on an old clunky spinning rust 5400 RPM hard drive. Do the math. How long will it take, worst case, for the platter to spin to where calc.exe is stored?
reply
refulgentis
1 hour ago
[-]
For a 5400 RPM drive, worst-case rotational latency is one full rotation: 5400/60 = 90 rev/sec, so ~11ms. Average is half that (~5.5ms). If you also need to seek (yes, we'll definitely need to move on both axes in the worst case scenario requested, likely all the time), 2006-era datasheets show average seek around 11-12ms, with full-stroke seeks around 21-22ms. So worst case total access: ~33ms.

Seagate Momentus 5400.3 manual (2005): https://www.seagate.com/support/disc/manuals/ata/100398876a....

Hitachi Travelstar 5K120 (2006):http://www.ggsdata.se/PC/Bilder/hd/5K120.pdf

WD Scorpio (October 2007): https://theretroweb.com/storage/documentation/2879-001121-a1...

reply
OsrsNeedsf2P
4 hours ago
[-]
Why is it impossible?
reply
refulgentis
3 hours ago
[-]
Tl;dr reaction time, 300 ms is the golden rule for reaction speed, and apparently there was actually a sports medicine study that came to that #. I was surprised to see that, 300 ms comes up a lot in UX as “threshold of perceptible delay” but it was still surprising to see.
reply
yjftsjthsd-h
2 hours ago
[-]
I was curious, so did a quick web search, which claims that 300ms is the average reaction time and plenty of people run faster than that.

But I think the question was the other way: Why couldn't calc.exe launch in 300ms?

reply
refulgentis
1 hour ago
[-]
300 ms is way longer than they budgeted; separately, I was alive then and it's a ridiculous claim, like, it takes a general bias we all have towards seeing the past with rose-colored glasses and takes it farcically far.

Don't want to clutter too much, I'm already eating downvotes, so I'll link:

https://news.ycombinator.com/item?id=46642003

reply
efskap
18 minutes ago
[-]
A lot of medical devices still run XP as well unfortunately, because of old proprietary software for expensive equipment that doesn't receive updates anymore.
reply
p1necone
4 hours ago
[-]
The high point is a toss up between XP and 7 for me, but imo Windows UX peaked then (although the 98 visual style is peak for nostalgia) and has either stayed the same or gotten worse ever since. Personally I just switched to using Linux full time as soon as gaming compatibility became basically the same as Windows but I totally understand why you'd want to maintain the ability to use older Windows versions.
reply
acuozzo
5 hours ago
[-]
Familiarity, I suppose.

I'm not a part of the Windows XP community, but I've gotten close. I love that I can make it look just like Windows 2000 and that I know where all the little knobs and dials are. I can get a Windows XP installation configured to be exactly as I want it to be very quickly and I know it won't suddenly change on me.

reply
userbinator
2 hours ago
[-]
It may be more savings than that, if you count all the hours wasted with fixing things that broke in a newer version or finding workarounds that will never be as efficient.
reply
badsectoracula
4 hours ago
[-]
I'm pretty sure it has nothing to do with money and plenty to do with the same reasons as people who preserve Commodore 64s, Amigas and DOS and Win9x PCs.
reply
unleaded
4 hours ago
[-]
It's fun and interesting. most people don't actually daily drive it
reply
reactordev
3 hours ago
[-]
Wait till everything you do is exfiltrated by copilot…
reply
userbinator
2 hours ago
[-]
There's a Windows 9x community too, although maybe not as large.
reply
deniska
5 hours ago
[-]
If you ever wanted to use a modern C and C++ compiler on windows xp, 32 bit version of w64devkit[1] does target it and provides a recent gcc version.

[1] https://github.com/skeeto/w64devkit

reply
archargelod
3 hours ago
[-]
Coincidentally, just a few days ago, I tried to run Nim[0] on Windows XP as an experiment.

And to my surprise, the latest 32-bit release of Nim simply works out the box. But Nim compiles to C, so I also needed C compiler. Many versions of mingw I could find online - they all failed to launch.

After some time I managed to find very old Mingw (gcc 4.7.1) that have finally worked [1].

[0] - https://nim-lang.org/

[1] - https://ibb.co/TBdvZPVt

reply
userbinator
55 minutes ago
[-]
From what I remember doing it several years ago, it was not too hard to patch MSVC 2019 to run on (not just generate binaries for) XP.
reply
acuozzo
5 hours ago
[-]
Anything for Win9x?
reply
unleaded
3 hours ago
[-]
I found out the other day you can use modern clang-cl with the MSVC6 headers and it just works. you can download them from here https://github.com/itsmattkc/MSVC600 or just copy it from an install if you have one handy.

then run (something like) this:

  clang-cl /winsysroot:"" /DWINVER=0x0400 /D_WIN32_WINNT=0x0400 -m32 /GS- -march=i586 -Wno-nonportable-include-path /imsvc"C:\MSVC6\VC98\Include" hello.c -fuse-ld=lld-link /link /SAFESEH:NO /SUBSYSTEM:WINDOWS,4.0 /LIBPATH:"C:\MSVC6\VC98\Lib" user32.lib kernel32.lib msvcrt.lib
I don't know if it's any better or worse than MinGW practically but it is definitely cursed.
reply
badsectoracula
4 hours ago
[-]
I haven't tried it but i saw this a few days ago: https://github.com/crazii/MINGW-toolchains-w9x
reply
acuozzo
4 hours ago
[-]
Thank you!!!
reply
Lord_Zero
2 hours ago
[-]
Is it hard to write software that compiles and can run on windows XP now? What about like rust and python?
reply
abbeyj
1 hour ago
[-]
It depends on what you want. If you want to install an old copy of Visual Studio from 20 years ago then you should be able to write a program and compile it and have that work on XP. But that comes with limitations. You're not going to be able to use even C++11 and will be stuck with C++03, or maybe even C++98. If that's acceptable to you then it can work. But if you want to compile something that somebody else wrote or want to use some library that somebody else wrote, it probably won't work in that environment.

Or you could install and old copy of Cygwin or MinGW.

Do you want to run a modern Visual Studio and target XP? Maybe you can make that work if you install an old platform SDK and set WINVER and _WIN32_VERSION and work around all the warnings and compatibility problems that you'll run into. It is fighting an uphill battle and it will continue to get worse with each new version of VS that you want use.

For rust there is Rust9x https://seri.tools/blog/announcing-rust9x/. But I think this is the effort of handful of people. It is behind the upstream rust and it could go away at any time. If you want to write a toy program in Rust then it is fine, but if you want something that's going to be supported long-term you're rolling the dice.

Python 3.4.4 is the last version of Python that will run on Windows XP. That's 10 years old and many things on PyPI now require newer versions of Python so you'd be stuck with old, unsupported versions of those modules, possibly containing security issues.

reply
king_geedorah
5 minutes ago
[-]
As far as I'm aware so long as you limit yourself to APIs that were available in XP you don't actually need an older SDK to develop for it with modern MSVC. The early windows platform layer stuff in the handmade hero series demonstrates doing so without anything like Cygwin or MinGW.
reply
larodi
4 hours ago
[-]
What applications are base on this? I mean it sounds super charming and nostalgic to drop a line or two which runs on WinXP, but is this actually useful?
reply
legacybuilder
7 hours ago
[-]
reply
parhamn
7 hours ago
[-]
> Added back 5ms sleep on Windows 7/8 in (*Process).Wait (reverted f0894a0)

This was interesting!

reply