Comments by "" (@pierreollivier1) on "No Boilerplate"
channel.
-
33
-
@NoBoilerplate For better or for worse C is kind of all we have with Assembly, a stable ABI is a step in the right direction, but fundamentally we simply don't need what Rust offers. For what we do its more cumbersome, for example Rust solves memory safety, ok great in embedded you only have two scenarios, first one is no memory allocation at all, second, is taking a chunk of memory and using it as an allocator. The hard part in embedded is not to write the code, it's to work within the constraints of the system, it's reading and understanding the hardware, what it can or cannot do. What makes C great is that it's really just a more readable assembly. C is a terrible language in many regards, but it's like assembly you can just do whatever you want and it will work if you are correct. C is basically just a a language that you can define with header files, if you put in your stdint.h that a int is 12bits it's 12bits. It's that simple, There isn't a lot of values for us. Same thing with parallelism, Rust solves that, but most of the time you just have a single core, and the "parallelism" is simply interrupt based. Or if you work on a more powerful chip you use RTOS, where you organize threads in a very different way than what most are used to.
Now there are some areas where maybe one day Rust might be kind of good, like automotive and aerospace, but even that is like years away, because while this kind of code would benefit from Rust features, you still need proving software, and a ton of testing infrastructure to make it viable, and compliant.
2