rust-lang / rust

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

Request: Support for more vintage operating systems #132610

Open mcandre opened 9 hours ago

mcandre commented 9 hours 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 8 hours 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 7 hours 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 7 hours 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 7 hours ago

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

lolbinarycat commented 3 hours 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.