2 ms·
What bothers me about rust is the designers are people that have been bitten hard by working on browsers written in C++ with it's manual memory management and n
by Gibbon1 4y ago
What bothers me about rust is the designers are people that have been bitten hard by working on browsers written in C++ with it's manual memory management and no way to enforce object lifetimes. Rusts solution to that seems like a big hammer when it comes to embedded where you usually have either stack allocated or compile time allocated objects.
- galangalalgol 4y agoIf you code in that style you won't even notice the borrow-checker is there. Unless you have a bunch of shared global state, the the overhead of arc will seem silly on your single core uc.
- Gibbon1 4y ago> bunch of shared global state A good indication of embedded is having to manage shared global state. This is very unlike a browser where you can hide all that behind OS calls.
- jandrewrogers 4y agoThat kind of style is often correlated with a lot of shared global state, even in relatively high level software like database engines. Most software avoids shared global state by delegating that implementation to the operating system, which often comes at the cost of performance.
- galangalalgol 4y agoI have worked in embedded code bases like that. While some of it is unavoidable for io, I have worked in other codebases where the compile time allocated memory was moved around in a way that would have satisfied the borrow checker except for that first mutable borrow. I haven't done rust for uc yet, so I won't claim it is a good fit, but it didn't seem like the parent poster had either, and I think there is a decent chance it could work well of the tooling is there. Which I'm not sure it is.