Settings

Theme

Go-legacy-winxp: Compile Golang 1.24 code for Windows XP

github.com

137 points by Oxodao 6 days ago · 80 comments

Reader

OsrsNeedsf2P 3 days 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

  • dataflow 3 days 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?

    • robinsonb5 3 days 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.)

      • Borg3 2 days ago

        Win2003 Enterprise does NOT need activation either. It runs smooth offline.

        • piperswe 2 days ago

          There are tools out there (like UMSKT) that can activate MS software from that era fully offline too. They cracked the cryptography used by the activation system and reimplemented the tool used for phone activation, so you can “activate by phone” using UMSKT instead of calling MS.

    • acuozzo 3 days 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.

    • p1necone 3 days 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.

    • 2b3a51 3 days ago

      In my case I have an old Thinkpad that is chugging on reliably into its third decade soon, that ran XP when it left the factory. Newer linuxes don't work too well (accelerated graphics components such as mesa have accelerated beyond the hardware's capabilities) and the BSDs are a little spartan (very little software for i386 now for understandable reasons).

      So I'm thinking of putting an XP install back on the thing with my licenced MS Office 2000 and a few other bits and pieces of software just for retro fun, and a reminder about how things were 20 years or so ago to avoid the rose tinted glasses effect.

    • rootsudo 3 days ago

      Why not? XP was formative for many people who are in the profession now.

      For me, it's knowing what I know now, what could I've done back 25 (wow!) years ago. It's a fun exercise.

    • itopaloglu83 2 days ago

      Well, I can give you millions of reasons in the form of industrial hardware that’s running Windows XP and will continue to run for another 10 years at least.

    • badsectoracula 3 days 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.

    • userbinator 3 days 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.

    • efskap 3 days 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.

    • jlarocco 3 days ago

      Why not? I strongly prefer Linux, but if somebody wants to use Windows, why not use XP? It was definitely a better user experience.

      I stopped using Windows at work as Win7 was rolling out but got another job using it again as Win11 started rolling out. Having missed out on the slow decline, it's very obvious to me how much better the older Windows were. The new ones have a dumpster fire UI with built-in advertising that shoves Microsoft web crap and AI down your throat at every chance.

    • akka47 2 days ago

      It is actually incredibly fast and already does basically everything you want from an operating system I guess.

    • unleaded 3 days ago

      It's fun and interesting. most people don't actually daily drive it

    • reactordev 3 days ago

      Wait till everything you do is exfiltrated by copilot…

  • AlbertoLuna17 3 days ago

    Another browser alternative is Supermium[0] it's an up to date Chromium based browser that also works great in Windows XP.

    [0] https://win32subsystem.live/supermium/

  • roytam87 3 days ago

    My browsers[1] still target XP and developing in Win7.

    [1] https://msfn.org/board/topic/185966-my-browser-builds-part-5...

  • userbinator 3 days ago

    There's a Windows 9x community too, although maybe not as large.

deniska 3 days 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

  • archargelod 3 days 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

  • anthk 2 days ago

    TCL/Tk 8.6 for XP, and as a bonus you get a gopher and gemini browser from gopher://hoi.st called BFG:

    gopher://texto-plano.xyz:70/1/~anthk/bfgxp

    Unzip the file and launch "lanzar.bat" in order to test it. I think I added tcllib and tklib just in case, so you can do a lot with that interpreter.

  • userbinator 3 days 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.

  • zoobab 2 days ago

    I used CoLinux with pubuntu, and from there install GCC.

  • acuozzo 3 days ago

    Anything for Win9x?

    • unleaded 3 days 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.
    • badsectoracula 3 days ago

      I haven't tried it but i saw this a few days ago: https://github.com/crazii/MINGW-toolchains-w9x

    • Jigsy 2 days ago

      I'm guessing this no longer qualifies as "modern," since the last update was in 2018 and is no longer in active development, but I'd like to say that the 32bit version of the Tiny C Compiler by Fabrice Bellard works on Windows 98 SE.

      https://www.bellard.org/tcc/

nasretdinov 3 days ago

I wonder if some of those things can be solved via a shim DLL that provides the necessary missing WinAPI functions instead of modifying the source code. Although the number of changes required seems vanishingly small anyway, so either approach coukd work just fine.

metaPushkin 2 days ago

Since hardware prices have skyrocketed, it is very important to run software on low-end hardware and use a suitable operating system, such as Windows 7, whose support, amusingly, has been dropped by nearly every project recently. Backporting software to Windows 7 is something we must do, for our freedom and our wallets.

  • hexagonwin 2 days ago

    vxkex works really well, give it a try

  • FatCat1979 2 days ago

    Literally just use linux. if you're fed dogshit, don't go back to dog vomit, use an actual operating system like an actual adult.

    Going back to win7 is just a neurological pathogen level of stockholm syndrome. give your head a shake.

    • metaPushkin 2 days ago

      Modern Linux is bad, nothing works completely, and on top of that, fragmentation between X and Wayland makes it worse. I just want to use my favorite software on a convenient operating system that doesn't eat up a lot of resources. And yes, that’s Windows 7. Just give me back the ability to use Steam or SourceTree and stop forcing bloatware like Windows 10 or Windows 11 on me.

      • johnisgood 2 days ago

        > nothing works completely

        Such as? Everything has been working for me the past >20 years.

        As for X vs. Wayland: you do not have to care about it. Just install a distro with X.

        Steam works on Linux, and lots of games run under Linux now thanks to Proton.

        • metaPushkin 2 days ago

          I have 8Gb RAM and HDD. Windows 7 works perfectly, windows 10 work acceptable. Linux bad work: horrible performance browser and IDE especially on distr with snap (browser performance near zero). On linux desktop huge problem with shortcuts. I don't know what the DE developers are doing, but I've never been able to get the key combinations I need and find convenient to work without conflicts with the system ones. Or it's just impossible to set them.

        • niij a day ago

          Starting with the very basics: hibernation & track pads.

legacybuilder 3 days ago

Dotnet 10 for Windows XP

https://github.com/kalnod/Win32Dotnet10Starter

itopaloglu83 2 days ago

Strangely, AutoHotKey v1.1 scripts when compiled in ANSI mode runs perfectly on Windows XP.

AHK came in very handy we needed a quick tool to track mill operators, roughly 20-30 lines of code and we had a working GUI app.

parhamn 3 days ago

> Added back 5ms sleep on Windows 7/8 in (*Process).Wait (reverted f0894a0)

This was interesting!

larodi 3 days 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?

  • itopaloglu83 2 days ago

    Mostly legacy industrial machines that need some additional software for telemetry, scheduling, automation etc.

    These machines are likely to live at least another 10-15 years and even the brand new ones being sold today uses Windows 7.

    Modern languages and frameworks proceed and leave these old systems behind, but everything from our infrastructure to manufacturing capacity that exists runs on legacy systems, not modern computers. The cost of replacing the computers is usually more than the machine itself.

Lord_Zero 3 days ago

Is it hard to write software that compiles and can run on windows XP now? What about like rust and python?

  • abbeyj 3 days 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.

    • oguz-ismail2 3 days ago

      > Python 3.4.4 is the last version of Python that will run on Windows XP.

      Pity. You can compile and run pretty much any version of Lua on XP with VS 2010 or lcc and it works just fine https://ibb.co/d0pMK7Jk

    • anthk 2 days ago

      IronTCL with the BFG gemini/gopher browser from gopher://hoi.st:

      gopher://texto-plano.xyz:70/1/~anthk/bfgxp

      Also, from some http proxy:

      http://portal.mozz.us/gopher/texto-plano.xyz:70/1/~anthk/bfg...

      MinC, a tiny C SDK plus Git and goodies from OpenBSD's base (ncurses it's included too):

      https://minc.commandlinerevolution.nl/english/home.html

    • king_geedorah 3 days 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.

      • pjmlp 3 days ago

        Most new APIs introduced since Vista are COM based, and after Windows 8, WinRT based (basically COM with IIinspectable, application identity, and .NET metadata instead of type libraries).

        Plain old Win32 C API is basically frozen on Windows XP view of the world, although there are a couple of new .....ExNum() suffixes for stuff like HDPI or various IO improvements, the userspace drivers initially COM (UMDF), but reverted back to plain C struct with function pointers on version 2.0.

      • SleepyMyroslav 2 days ago

        The only officially (at least partially) supported way from Microsoft is to add into Visual Studio the toolchain named "C++ Windows XP Support for VS 2017 (v141) tools". It is still there in the "individual components" of Visual Studio Installer for the latest VS but it is marked as [Deprecated]. It is a safe bet that MS will never fix any existing bugs in it or update it so at this point your best bet might be with the open source tools.

        All other currently supported toolchains rely on runtimes that are explicitly not compatible with Win XP.

godudewinxp 2 days ago

sadly doesn't work on winxp x86 - just tried. not a valid win32 application.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection