Hacker News new | ask | show | jobs
by accelbred 558 days ago
I write pure embedded C at work. I used to pretty much only write Rust prior to going into the embedded field. Rust gives you memory safety, but has costs. It is a complex language (like C++ but not to same extent) with a lot of non-local code flow. Certain patterns useful in embedded to save memory dont jive well with the borrow checker. It also makes it hard to avoid dynamic memory allocations, panics, and large binary sizes; at work, we've been considering Rust and it looks like we'll have to use no_std. That cuts out most of the ecosystem, which isn't the worst because dependency explosion is also a problem.

At work, we'll likely end up incorporating no_std rust, but for personal stuff I just use Zig these days. It a simple language that makes embedded style programming easier, and has a usable std lib due to not using global allocators or panic-like mechanims.