Hacker News new | ask | show | jobs
by yjftsjthsd-h 986 days ago
If I'm using a device on one of the lower tiers, it's fair to assume that the C compiler for it has been exercised quite a lot, much more than the shiny new rust compiler that I'm introducing that I have no reason to think anybody else has ever used on this platform.
4 comments

Curl could be assumed to be one of the most well-exercised code bases in the world, and yet there are still bugs.
Why would you think that nobody has ever used Rust there ? Somebody has obviously put in the work to support that platform, rustc doesn't just blindly inherits the list of target triples from llvm.

While it's safe to assume that C gets a decent amount of use on every platform, you can't expect all platforms to be as well-supported as the major ones. Undoubtedly, some of those platforms would be listed as low-tier if the C compilers cared to maintain a platform tier list. But a platform being low-tier doesn't mean you shouldn't use that compiler there.

As for trusting Rust or C on niche platforms, C is so full of UB, platform-specific choices, and vendor extensions, that it's hard to ever fully know how well this or that project will work. Rust is much less surprising, if it works at all I expect it to fully work. I'd definitely pick Rust on niche platforms if I have the choice.

There actually isn't that much work to adding basic support for a new platform target for Rust. You're moreso banking on LLVM's ability to target it, which, given clang gives you that C compiler maturity you're after.
Likewise for C++, with standard library types having support for bounds checking, no need to wait for Rust.

While not as safe as Rust, it is definitly much safer than plain C.