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

“Bad programmers worry about the code. Good programmers worry about data structures and their relationships.”

I think this hits the nail on the head for me: abstract structure first, the choice of language C/C++/Rust/... is then a secondary consideration.



I don't think that holds, given the potential scale and severity of memory safety bugs in systems programming.

I'm not saying Rust is the right answer but not paying attention to, or worse, putting our heads in the sand, when it comes to our tools is not the answer.


let me tell you that Rust forces you to very carefully consider data structures and their relationships.

The point of a programming tool is to help the programmer to be a better programmer, there is indeed no point using a very strict language, statically typed with lot of constraints attached for a perfect programmer.

But for commoners it would certainly help to have some guiding.


Which brings up the question when/why to pick Rust? There are a plethora of languages which from my layman perspective seem more interesting. OTOH there are a plethora of languages with rich ecosystems, proven pedigree and with a high demand for such developers.


I am working on medical devices, where a bug can have catastrophic consequences.

Essentially the ecosystem today is C and C++ for embedded FW and middleware. Even if we are careful, we rely on static analysis tools to avoid some categories of bug. (Plus a humongous amount of tests). Typically bugs that would be caught (mostly) by the Rust compiler at compile time. I think it is a great idea to have some safety guarantee at compile time.

Would Rust fixes every problem ? Absolutely not, you'll always get logical bug or implementation not conform to the requirements but I think it is a move in the right direction, and I hope that slowly in next 10 years Rust will grow in the embedded space.

And overall cargo is nice, C/C++ don't have standard package manager. The test infrastructure is there by default, this is a breeze to add them in your code, rather than relying on an external framework, so this is also good.

I don't really see an alternative today for small footprint SW where C and C++ is king, and I hope that embedded toolchain vendors are taking notes.

If today you mostly code in javascript or python, unless you need bare metal like performance or to have stronger safety guarantee, maybe it does not make sense to move to Rust.


Sure, nobody would choose Rust over C++ if you couldn't express pretty much the same data structures and relationships in Rust that you can express in C++.




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

Search: