Hacker News new | ask | show | jobs
by _xerces_ 560 days ago
Is it a nice language? As an embedded software person who writes mostly pure C (and hates C++), I have been avoiding Rust as it seemed tedious and annoying when I last dipped my toe in. Perhaps I am just old and stuck in my ways :) I would love it if Rust was nice to use, especially if that is where the future of embedded is.
2 comments

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.

I love it, but yes it can feel a hair pedantic. I just enjoy the tooling a lot and it's compiler is really amazing at what it can guarantee.