rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
99.41k stars 12.84k forks source link

Request: Support for more vintage operating systems #132610

Closed mcandre closed 1 month ago

mcandre commented 1 month ago

In the interest of extreme portability, I am curious about opportunities to deepen tier support for vintage operating systems, including MS-DOS, OS/2 Warp, Mac System 7, BeOS, 386BSD, Commodore 64, AmigaOS, and others.

Today, I can probably setup clang or GCC cross-compilation toolchains for these platforms by writing my applications in C/C++. But I'd much rather use Rust, and I'd rather consume reusable, builtin, standard rustup target toolchains. So that I can spend my time writing applications.

Unlike Go, Rust is uniquely positioned to support retro operating systems, due to Rust's significant improvements in memory usage and application size. While Go does have a more complete UX for out of the box crosscompilation, its memory model assumes very modern, larger RAM and disk minimum system requirements. Even if Go tried to add support for DOS variations, Hello World risks failing to fit into RAM. But Rust optimizes exactly for memory usage and program size. It has a chance of enabling retrocomputing closer to what (POSIX) C supports.

Scientific applications, legacy applications, computer museums, backwards compatibility initiatives, and fans of these kinds of wizened hosts all stand to benefit from such additional rustup targets. Let's continue to steal thunder from C.

workingjubilee commented 1 month ago

see: https://doc.rust-lang.org/nightly/rustc/target-tier-policy.html

but for OS/2 and any other 32-bit target, it seems plausible and the primary barrier is that someone shows up and agrees to do the work.

VorpalBlade commented 1 month ago

This might be of interest as well (though it targets a slightly later system): https://www.wezm.net/v2/posts/2023/rust-classic-mac-os-app/ is about writing a simple GUI program for classic Mac OS (PPC) in Rust for example.

mcandre commented 1 month ago

Indeed, Haiku is the successor. I welcome efforts to support Haiku, MINIX, MirOS, Illumos, Plan9, HardenedBSD, Bottle Rocket, and other modern fringe platforms. As well as BeOS, System V UNIX, (Open)Solaris, PDP-11, MULTICS, CoreOS, and other elder platforms.

PPC macOS, 32 and 64 bit x86_64 macOS also welcome. Curious how Tigerbrew is doing these days.

workingjubilee commented 1 month ago

iirc our current x86_64-apple-darwin target still works ...but yes, it does seem like it will be "vintage" soon.

lolbinarycat commented 1 month ago

It's worth noting that it should already be possible to write rust code that runs on most of these, simply by linking to system libraries or handwriting system calls, just as you would on an embedded system. what's desired here is support from the standard library.

Noratrieb commented 1 month ago

As pointed out by Jubilee, we have a target tier policy and welcome new tier 3 targets for all kinds of obscure systems you're thinking of. The problem here is mostly finding someone willing to maintain them. I'm closing this issue since it's not really useful, and welcome anyone who wants to add support for their favorite vintage OS.