Campbell Ritchie wrote:Does Rust work on all platforms as C and C++ do, Carl? It can hardly replace them if it is platform‑specific.
The real question is "can Rust run in any environment from cold iron up?"
I could not do OS-level programming on IBM mainframes in Fortran, COBOL, or PL/1. They could only run under their respective language environments (which were not friendly to interrupt-level coding, privileged modes, real-time or small-footprint uses.) One cannot extend
Java's "write once/run anywhere" to cold iron, as Java needs its JVM environment. Likewise, Python, although an essential part of the Red Hat Linux boot process, cannot run on bare metal.
Granted, there are exceptions. Prime Computer wrote most (but not all) of its OS in Fortran (the hardware was actually optimised for Fortran, as I've mentioned occasionally). They also later adopted a dialect of PL/1, as Fortran was not the best language to do byte manipulation in on a word-addressed machine. I'm fairly certain that the Honeywell GCOS minicomputer systems could do OS-level code in COBOL (
!!!).
But the point is, those were
exceptions. C and C++ can run OS-level code on virtually any platform. The languages are designed for a very minimal external language environment. Well, C was specifically designed to write an OS in (Unix).
Rust is at heart a safer C and its language environment is, so I understand, to be suitable for even low-level OS code just like C. So much that the Grand Penguin himself (Linux Torvalds) has been looking towards having Rust code in parts of the Linux OS.