Hi all, On tech forums everyone is talking about Rust making it to the Linux kernel, which probably will mean more and more programs that will be Rust-based.
In the Firefox discussions, I read it was impossible to port Rust to OS/2. I’d like to better understand why, because I see that as an increasing difficulty to make OS/2 apps by porting Linux ones…
Not impossible, just really hard. We use a patched (and with helper programs) GCC (Gnu Compiler Collection) along with the system linker to port/build programs.
Rust uses the LLVM toolchain, which has no support for our system so that would have to be ported, a large project for a knowledgeable compiler expert who would also need a good understanding of OS/2 internals. Given a few million dollars and luck in finding the right developer, it could be done. Probably the patches to make the port work wouldn't be accepted upstream so like our GCC, a fork would have to be maintained.
The other big problem is memory, or rather address space. It takes a lot of memory to build and link some of this stuff. We ran into a lot of problems building Firefox around version 4. There were source files that used 2 GB's of memory just to compile, doable one at a time and the linker had problems. Ilink5 stopped working and we switched to wlink, which we have the source for and that needed quite a bit of patching to link Firefox and today QT5 is barely linkable. Rust is way more memory intensive then C++, both for compiling and linking.
The linker problem could maybe worked around with spill files (think swap), be slow and once again would need an expert to do it.
Another option is cross-compiling, compile and link the code on 64bit Linux. Once again there needs to be a tool chain built to do the cross compiling.
In summary, given a large amount of money or a really inspired volunteer and the right developer, it could be done but is very unlikely.
Another solution might be if the GCC people ever have a compatible (Rust keeps changing, another problem) Rust compiler, it would be much more trivial to get that working.
As others have said, it is doubtful that Rust will spread that fast. A bigger problem is lack of support for 32 bit systems. More and more projects take it for granted that there is a 64 bit address space and they stop supporting 32 bit systems with programs expecting to be able to allocate GB's of memory at a time. I think that is what will kill OS/2 eventually, at least as far as porting modern stuff goes.