Post

Facts

Orual@nonbinary.computer

unironically best thing about embedded rust is that you can basically write arduino (pin.set_high()) but it'll compile to something efficient in a lot of cases. the HAL crate layer is where you do unsafe mostly, and you can write drivers targeting the safe abstraction and they work crossplatform

How easy is rust for those of us who aren’t in tech? My brain is so fried from using stats software pretty much exclusively that I had to install pycharm again to debug a simple py script I wrote

It's complicated. 1) rust has lovely pycharm style interfaces to all the cool user friendly stuff rust does 2) rust is a systems programming language and is at least as hard as C but the compiler (or IDE linter) will yell at you for writing bad code.

The difficult bits in rust, IMO, are things that are difficult about programming without a memory manager full stop. You have to care about ownership of pointers, you have to care about allocation. It will help you in ways that C-like languages but the language is not the hard part.

This is really helpful, it also tells me I need to maybe stick to scripting languages for now which manage the bulk of that for me (admittedly, quite badly often) I have some time off coming up soon and was thinking of learning a new language and rust was on the “maybe” list.

For sure. Rust is only really useful where you would want to use C or C++. So embedded devices or operating system/driver programming are both great choices or high performance code. But Python is an objectively better tool for hacking out a solution that doesn't need to be small or fast.

legit I use (micro)Python a fair bit for rapid prototyping on embedded, especially if I *know* for sure i am going to throw away the prototype or perf just does not matter one bit. if I think the prototype might become production I will often try and write it in rust.

I think most people do although I'm working on reversing enough of it to understand how much real estate is taken up by the bytecode interpreter compared with a similar baremetal app.

yeah, the interpreter is *heavy* and function calls are slow as fuck. and the c HAL is basically always also in there, too. so you are at like 3 abstraction layers, and they're not cheap ones.

No replies yet.