4 ms·
The idea that Rust is more portable than C is laughable. C is the most portable language of all time, and Rust has a long way to go to compete. Git already runs
by ddevault 6y ago
The idea that Rust is more portable than C is laughable. C is the most portable language of all time, and Rust has a long way to go to compete. Git already runs on more platforms than Rust can target.
- mwcampbell 6y agoIt's true that the C language is available on more platforms, including more exotic platforms, than Rust, and that will probably remain true for quite a while. But in another sense, Rust tends to be more portable in practice. Take a random, non-trivial C program or library and try to compile it for something that's not a Unix (edit: or cross-compile it). How hard is it to do? Now, do the same with a random Rust crate. It's probably a lot easier. I think there are two key differences. First, Rust has a standard build system (Cargo) that is dominant, while there are many competing build systems for C. Second, the Rust standard library was designed much more recently, and covers far more of the functionality in today's platforms than the C standard library does. (For example, contrast Rust's OsStr and Path types with the pain of supporting Unicode filenames on both Unix and Windows in C.)
- camgunz 6y agoI think this is a good point, but I think you're mostly talking about building rather than porting. It's way more likely you'll be able to port something from a popular architecture to an obscure one in C because the lingua franca is C, and shipping an architecture generally means shipping C compiler support for it. I would guess this will slowly change as LLVM gets more backends, but that's pretty hand-wavy. The other option is we move more towards platform monoculture, which is probably more likely? Not sure.
- steveklabnik 6y ago(Another option is a gcc frontend for Rust, which the gcc folks have said that they're not opposed to)
- camgunz 6y agoYeah actually I think this would be a great idea. Surely some defense contractor or aerospace company would fund this work.
- littlestymaar 6y ago> Git already runs on more platforms than Rust can target. cough cough Windows cough
- steveklabnik 6y agoWhat do you mean? Both Git and Rust run very well on Windows.
- mwcampbell 6y agoI think the point is that Git for Windows needs a whole Unix compatibility layer (msys2), whereas gitoxide easily compiles to a self-contained executable even on Windows.
- steveklabnik 6y agoAh, I just install the binaries and use it entirely outside of all of that, so I forget it even exists. But yes!