News for hackers. Stuff that matters.
Re:Volvo is using Rust for its in-vehicle software by 19h on Saturday September 24, 2022 @02:00PM (#32965087)
IME It's often harder to do it the unsafe way rather than to just do it the safe way
Re:Volvo is using Rust for its in-vehicle software by klabb3 on Saturday September 24, 2022 @03:39PM (#32965914)
At the end of the day it's embedded code that's inherently unsafe, so the benefits are all in the code that belongs in the safe zone. Unsafe Rust is at best equivalent to C/C++ and at worst it's a false sense of security. Mixing safe and unsafe without a clear boundary is not something I can speak to with confidence but my gut-feeling is that it's worse than C/C++.

Even OS kernels are borderline, and it's still being figured out how exactly Rust fits, but yes we are slowly moving in that direction. Kernels have a lot of logic that qualify for the safe zone, and software engineering culture that is... let's say ahead of automotive.

Re:Volvo is using Rust for its in-vehicle software by spoiler on Saturday September 24, 2022 @05:13PM (#32966578)
> Unsafe Rust is at best equivalent to C/C++ and at worst it's a false sense of security.

This is a bit of a misconception for people who've not worked with unsafe Rust. It's not like the language and most of its features disappear. It just allows a few extra features that are unsafe, like working with pointers... Which, granted, is a lot of interaction with hardware. But you can kinda "cordon" this to a small subset of the codebase dedicated to this low level hardware IO

Re:Volvo is using Rust for its in-vehicle software by kennywinker on Saturday September 24, 2022 @04:05PM (#32966120)
> embedded code that's inherently unsafe

I'm not really an expert in embedded systems, so take this with a grain of salt, but that doesn't track with my experience or with my theoretical understanding of embedded systems. First off, embedded systems are just regular systems with tighter constraints and less high-level constructs. With that understanding, if embedded code is unsafe... so is any code on any system.

Second, embedded systems have peripherals that are accessed via direct memory reads and writes. Which is only unsafe if access to those peripherals is shared in an unsafe way. Sure, the rust code that reads and writes to memory addresses will use `unsafe`, but everything above that can be written without using unsafe. Which I guess makes your statement technically correct, but imo not practically correct

Re:Volvo is using Rust for its in-vehicle software by Shorel on Sunday September 25, 2022 @02:06AM (#32969308)
I would not trust your gut feeling.

If anything Rust has a clear boundary, and that's useful for all kinds of static analysis.

And I say this as a fan of D lang. I don't really see any advantage of Rust over D except popularity.