Unofficial "Tier 4" Rust Target for older Windows versions

3 months ago (github.com)

I wish more languages support old platforms. I'm working in a company and a lot of our customers are running Windows 7 and 8, few of them running Vista. I have to use ancient versions of development tools to target those. For example stuck on Java 8 for eternity. It's PITA.

  • The problem is, as usual, that some people want that support, but nobody is actually interested in helping out with that support - and that doesn't only include people willing to help out with the code, it includes things like CI. Just how the riscv targets won't be able to reach tier 1 without GH or someone else offering CI support.

    Rust's target tiers, while historically not as enforced as they are today, have requirements attached to them that each target has to fulfill; demoting a target or removing support isn't done for fun, but because of what the reality reflects. In Windows 7's case, support from the Tier 1 Windows target was not so much removed as it was acknowledged that the support guaranteees just didn't exist - host tools had long been dead with LLVM having removed support for running on Windows 7, and tier 1 support wasn't guaranteed without any CI to test it on. Thus support was removed, and very soon contributors popped up to maintain the win7 target which is tier 3 and accurately reflects the support gurantees of that target.

    (Not a jab at your situation btw, and I wish I could offer you a solution beyond the win7 target - but as it's essentially the preexisting Windows 7 support extracted into a target that matched its reality, it works quite well in practice)

    • I do wonder how much support is removed because of genuine maintenance or compatibility burden, because I've encountered enough examples where it was done solely because some target was deemed "too old" arbitrarily, even if it would still work without any modifications.

      10 replies →

  • Languages that compile to C (e.g. Nim) are great on older systems. If a system has a working C compiler (or cross-compiler), there’s a good chance that it’ll just work.

    I’ve myself compiled Nim on Windows 7, Windows XP, and Haiku, and have run simple Nim programs on the C64 and GameBoy Advance.

    • Tried to use Nim with VBCC to cross-compile to Amiga, but I failed. I think Nim does some pretty heavy assumptions about the C compiler that is used to compile the generated code.

      7 replies →

  • I thought the entire point of Kotlin was to allow you to write in a more modern language, and then compile to older versions of Java no? I've not kept up with Kotlin much, but I would expect it to help a little.

    I know uh FreePascal targets everything including the Gameboy. But then Pascal isn't super modern or sexy unfortunately.

  • seeing Windows 8 called old really did some psychic damage to me. If it's not a secret, what kind of customers do you have? Is it some industrial stuff as usual?

    • Medicine. I'm living in third world country and probably they don't have enough money to upgrade often, they just install something and work with it for many years. Works for them, I guess, I often see computers with 2-4 GB RAM and some ancient Celeron.

      5 replies →

  • What kind of business are you in that you need to be able to support these platforms that have been end-of-life for quite some time? Genuine question.

    • In my country the Government requires any salesman to have some computer for the sake of sending the info about any sell preferably immediately. I don't know why does they need this, maybe it is making easier for them buying the gold toilets. For example we still have corona-style limitations like no paying with card if the country is bombed somewhere or the businessman risks to be fined. The thing is that nobody wants to buy something more expensive than Pentium 4 or Core2duo especially because most of accounting software still does not support multithreading. So we the businessmen use to mass-buy that cheap hardware, then we install W7 as a good enough OS with no irrigating/pesky/unneeded nanny notifications. The used motherboard if dies it makes no problem, it costs $10. Believe me, the 7 is a perfect OS for self-spying to our Governments and if you want to lobby Rust into this business you have to support W7 somehow.

      3 replies →

  • The question is how much are people willing to pay for this trouble. Usually industries that stick to very old system did so because they didn't want to invest resources in the migration.

    • > Usually industries that stick to very old system did so because they didn't want to invest resources in the migration.

      That can be the case, but there's also a lot of instance where it's not a matter of not wanting to invest, but that being stuck on an older system is the only option until a larger component also goes EOL or dies and cannot be repaired.

      I see this all the time in manufacturing. User control interfaces that run on Windows XP or 2k. Machine is still great, can still get parts & repair it, but the software has long ago since stopped being supported. The manufacturer isn't going to spend 6 figures to replace a machine that hasn't fully depreciated yet.

      In these instances, you just air gap it off and you're fine.

  • Why? That effort is far better spent on developing new things and taking advantage of modern hardware.

    People need to upgrade. I'm surprised any machine running Vista could even use the modern web.

    • The only things really driving upgrades are gaming and web browsing. If you dont need to do either of those, you could probably get by with windows 9x

    • Upgrade all you want, some modern machines just can't run the software needed to talk to and control old industrial, fire, medical, etc equipment.

      Somewhere out there is a Windows 98 machine controlling an industrial machine that will out live early posters on HN.

  • It's not hard to do either, especially on Windows where backwards-compatibility is almost completely guaranteed.

    Of course those in the planned obsolescence mindset would fight hard against it, because then it would be harder for us to take the good without the bad.

    • I really hate my bakery, the buns are only edible for some days, after that, they grow mold!

      Without sarcasm, it is entirely reasonable that when the OS is EOL by the 1st party, software support for it by 3rd party also ends soon after that.

      5 replies →

  • I’m a huge Java fan, modern versions are amazing, but being stuck on 8 is the only time I’d recommend just using Kotlin or Scala and compiling to v8 byte code. 8 is just a miserable experience.

    • Do you happen to know some good learning resources (books, etc.) for modern Java versions?

      My last job used Java 8 exclusively and it was indeed a miserable experience, but I am contemplating using modern java for my next project.

      1 reply →

Shameless plug: Some of my hobby projects written in C (e.g. https://github.com/pts/bakefat) can be built reproducibly for Linux >=1.0 (1994), FreeBSD (same ELF executable program file as for Linux) and Win32 working on all versions of Windows (Windows NT 3.1 (1993)--Windows 11). The C compiler (running on Linux i386 and amd64 host) used for the release build is self-contained and included in the project, along with the libc.

Doing such backward compatibility is definitiely possible for command-line tools. Once set up, it's automatic, and it needs extra testing after major changes.

MinC for XP and up: (MinC is not Cygwin, you get cc, ncurses, ksh, git and some goodies).

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

IronTCL for XP and up

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

Updated SSL/TLS certs, again for XP and beyond:

https://legacyupdate.net/

Tiny Pascal-like language targetting DOS, CP/M and Unix:

https://t3x.org/t3x/0/index.html It's no Free Pascal but it can do good stuff with very little:

https://t3x.org/t3x/0/programs.html

JimTCL, a tiny TCL with bundled TLS, JSON, Sqlite3 and, optionally, some SDL2 support:

https://github.com/msteveb/jimtcl https://jim.tcl-lang.org/home/doc/www/www/index.html

You can compile JimTCL with MinC under XP, and maybe T3X0 too. With JimTCL you can build a quick TCL expect clone, some netcat clone too with TLS can be done in minutes too, really good for debugging or to create a simple IRC/Email/Gopher/Gemini client in text mode.

For someone who is not a rust programmer, but would like to keep up to date, can somebody tell me what "Tier 4" is. And why must it be quoted?

This target might become more viable in the future as Stable Rust adds options to rebuild libstd with custom features as part of building a project.

The idea of running Rust code on Windows 95 is very funny to me. Two completely different universes colliding.

considering the all-insistence of rust on using internet for all the libraries, this doesn't seem like a good idea...

  • What insistence? I do 99% of my Rust development with this ~/.cargo/config.toml:

      [net]
      offline = true
      
      [source]
      
      [source.crates-io]
      replace-with = "debian"
      
      [source.debian]
      directory = "/usr/share/cargo/registry"
    

    Works great.

  • What do you mean? Cargo downloads packages from the internet by default programs do exactly what they’re programmed to do. No more and no less.

    Just because you’re targeting windows xp doesn’t mean you need to run windows xp to do development.