this post was submitted on 10 Aug 2025
832 points (95.0% liked)

Programmer Humor

25671 readers
2386 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] NeatNit@discuss.tchncs.de 4 points 3 days ago* (last edited 3 days ago)

Thanks for this. I was paraphrasing (badly, it seems). The video actually says it better:

To write code that lives in an embedded environment, it has to run in this mode in Rust called "no standard" (#![no_std]) and this mode called "no main" (#![no_main]). Basically you have no access to any of the core utilities in Rust, you have to write a lot of them yourself.

He then explains how embedded code necessarily has global mutability which is "the antithesis" of Rust development.

So yeah, you could make all of those wrappers, but at the end of the day you'll end up with about the same amount of "unsafe" code as you would making the same thing in C++.

Edit: but if what you said still applies, it does seem like Rust would watch your back somewhat better than C++ would in that it wouldn't even compile unsafe operations outside of unsafe blocks, unlike C++ to the best of my knowledge where you kind of have to review the code yourself to make sure it only uses the appropriate wrappers.