Hacker News new | ask | show | jobs
by caaqil 53 days ago
> there are plenty of "Rust for C Programmers" articles on the internet, but little to no "C for Rust Programmers" articles out there.

Why would a Rust programmer learn C? Isn't that basically a regression?

3 comments

The first language is formative. It gets the programmer to think at a particular level of abstraction. If that level is wrong for the problem at hand, the programmer needs another language.

Write, say, a boot loader, for enlightement.

It is easier to write a C compiler from scratch than a Rust compiler from scratch. No usage of LLVM or anything like it.

That also reflects in that many embedded systems offer C support and do not offer Rust support.

Not a regression. Most of the systems code you'll ever touch is still C, and knowing C makes Rust's unsafe blocks and FFI story way less mysterious. I learned C after Rust and it changed how I read Rust too: the ownership rules click differently once you've managed memory by hand and felt the bugs they prevent.