3 ms·
> Safer alternatives exist. Do they? The only “safe” comparable alternative is unsafe Rust which as the name suggests isn’t actually safe.
by tomp 4y ago
> Safer alternatives exist.
Do they? The only “safe” comparable alternative is unsafe Rust which as the name suggests isn’t actually safe.
- jesse__ 4y agoYou're right. Alternatives that tick all the boxes that C does, and are also safer, do not exist. This guy is just doing the typical religious yelling about people doing their jobs (writing kernels, drivers, browsers, games, etc) with the most flexible tool for programming we've developed to date. Maybe one day Rust will become dominant. Maybe someone will overhaul the aliasing rules of C, write some similar lifetime tracking tooling, and it will live on for another 50 years. Who knows. The reason people still use C and C++ isn't because they're good languages (or even that people like them, as the comment states), it's that until recently there have been very few viable alternatives, and for some domains literally none at all. They've largely been the only option for a long time.
- notriddle 4y agoThe article is about Ada SPARK, and nVidia using it to develop their firmware today.
- jesse__ 4y agoYes, I wasn't referring to the article, I was referring to the person comparing C to asbestos. It makes sense for nVidia to trade development time and prefer a language with formal verification for their firmware.
- nordsieck 4y ago> The only “safe” comparable alternative is unsafe Rust which as the name suggests isn’t actually safe. And for some applications, Rust isn't even an alternative. Not every chip is supported by LLVM.
- Gigachad 4y agoYou typically don't have to write any unsafe Rust as an end user. The unsafe stuff is contained in very small and very rigorously analyzed standard library types. Which then provides you a safe interface to do all the stuff you normally do.
- nyanpasu64 4y agoIn practice unsafe Rust is necessary to write many classes of nontrivial code, and is harder to get right in many ways than C++ (possibly C) and I think Zig.
- Gigachad 4y agoExamples? I have been writing production rust for about 6 months now and haven’t had to use unsafe yet. Looking at the standard library internals I see it a lot but everything I have had to do works in safe.