Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I program mostly Python, C, C++, Javascript and Rust. Including on embedded (that goes for C, C++ and Rust)

Most people nowadays who criticize Rust do so on a cultural basis of "there are people who want this so and it changes things therefore it is bad". But never on the merits.

Rust is a good language that contains in its language design some of the lessons the best C programmers have internalized. If you are a stellar C programmer you will manually enforce a lot of the similar rules that Rust enforces automatically. That doesn't mean Rust is a cage. You can always opt for unsafe if ypu feel like it.

But I know if my life depended on it I would rather write that program in Rust than in C, especially if it involves concurrency or multiprocessing.

Practically on embedded the issue is that most existing libraries are written in C or C++. That can be a reason to not choose it in the daily life. But it is not a rational reason for which a programming language sucks. Every programming language had once only one user. Every programming language had once no dependencies written in it. Rust is excellent in letting you combine it with other languages. The tooling is good. The compiler error messages made other language realize how shitty their errors were.

Even if nobody programmed in Rust, the good bits of that language lift the quality in the other languages.



> a cultural basis of "there are people who want this so and it changes things therefore it is bad". But never on the merits.

In this mindset, arguing against change is an argument on the merits. Because everything you spend time on has the opportunity cost of everything else you could spend time on.


Yes sure, but you got to engage with the arguments on the other side as well. The argument on the other side is that a rewrite is worth it because it prevents entire classes of memory leaks that are still to this day leading the exploitable CVE lists.

We could now pretend their position is: "Oh, we got this shiny new language that magically makes everything 100% safe and thus we need to rewrite everything." But that is not the position. Most of them are aware that a rewrite is always a trade-off. You could reintroduce old bugs etc.

As I said, I program languages on both sides on the divide and if I had to write and maintain secure software that my life depended on I would certainly prefer to write it in Rust. Memory safety would be just a tiny part of that. The other factors would be the strict type system (can be used to enforce certain guarantees that contributers cannot easily fuck up) and the tooling (the builtin testing is stellar).

The future of tooling is going to be written in the language people of the coming generations like to write. There was a time when C++ or even C was the new shiny thing. Why can't we just write all software in assembly like in the good old days? Because there were some actual tangible benefits to doing it in C and that's the language people with the ability of doing the job chose.

I am not saying a Rust rewrite makes sense in every case, but if you check the past decade of CVEs on a project and half of them would have been prevented by the vanilla Rust compiler maybe that's the rational thing?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: