Hacker News new | ask | show | jobs
by Dinux 892 days ago
We have switched to Rust about 4 years back for most of our robotics and embedded control systems. I has been a blessing to move away from C/C++ after 10 years. Sure Rust has its problems and issues, especially when it comes to async and concurrency. Yes it has a steep learning curve, yes the compiler gets in the way often but the number of _actual_ bugs (not design flaws) is probably less than 10 over 4 years. Every time I work on a C/C++ i'm painfully reminded how easy it is to shoot yourself in the foot. I hope coreutils and Rust in the kernel will eventually become the default
2 comments

I genuinely can't get enough of rust tbh. It "just" works. Don't get me wrong, a few things could be better, e.g. compile times, but it's so much easier to work with.
Please include the domain you’re working in and what you’re comparing against when making value statements like this. It can be helpful for others and the debate at large.
I do software analysis, with some query engines, and backend. My comparisons are against java, python, and C, though I did try to get into C++.

I also contribute to rust-lang/clippy and other rust projects.

i wonder how much of that is due to rust being too young to have myriads of dubious code to copy from.

Perl is even more memory safe than Rust, but the amount of crappy code is overwhelming...

That's the thing about a compiler enforcing rules: you can't even get some kinds of dubious code to compile, so therefore, it will never meaningfully be copied.

Of course, that doesn't mean that all bugs are prevented, or that Rust code has no bugs, or that you can't write bad Rust code. But in the context of robotics and embedded control systems, Rust solves a lot of those "bad code" issues at compile time. And you're not using Perl in that context regardless.

oh, now I'm wondering if Ada might be interesting for robotics.

As it is another language that is said 'compiler driven'

It is one of the domains it was created for, so I would assume that it is. I barely know Ada, however, and so can't really say.