top | item 35328008

(no title)

grawp | 2 years ago

I have the exactly opposite experience. Rust move semantics, borrowing, Send&Sync types and checks and type based compile time state-machines is exactly what I was missing specifically on embedded systems in C/C++ and what I'm sorely missing in Zig.

In Rust you start by splitting peripheries to blocks, then to registers, then to register parts and distributes these (these are zero cost operations!) into irq handlers and tasks and the type systems will check that everything that need exclusive access has it .. that you do not use read-modify-write operation on a same register from two interrupts where one can preempt the other without using some guard as mutex.. while it perfectly allow you to do this with write-only registers without guard etc... it is just so nice to work with.

People who find it complicated and/or not worth it are usually doing either some rudimentary super duper easy stuff on architectures or OSes which does not have or utilize nested interrupts or they do it on some IOT like noncritical stuff where they don't give a s** (vs industrial machinery, drones, other vehicles..).

discuss

order

No comments yet.