Hacker News new | ask | show | jobs
by charcircuit 945 days ago
gcc is programmed in C++ too. The language of the compiler doesn't matter. What matters is C makes it too easy to make memory errors which Rust protects you from. This is why Linux should migrate to Rust and you can see this migration starting with adding support for Rust based drivers.
1 comments

I disagree that the language of the compiler doesn't matter. It absolutely matters in some cases, all of which are cases where (ANSI) C is pretty much the only option because of the inherent difficulty of C++ compilers.
This still doesn't explain why the language of the compiler matters. I could write a C compiler in Pony-lang targeting a 30-year-old MCU were I so inclined.

The available compilers targeting your microcontroller certainly matter, though. You certainly still find lots of options that aren't Rust-compatible, but a non-trivial number microcontrollers are ARM or RISC-V based now, and can be targeted by LLVM/Rust.

What target are you compiling to that gcc doesn't support?
Typically if this is the case, won't you be cross compiling for that target anyway?