Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm self-publishing "Rust From the Ground Up" which takes this approach: each chapter rewrites a classic Unix utility (head, cat, wc, ...) from the original BSD C source into Rust. I find for systems programming it's easier to understand how things work in C, and then teach the idiomatic way of doing it in Rust. C is pretty easy to follow along in "read-only" mode with some explanations.

https://rftgu.rs/



Interesting, seems similar to the book Command Line Rust which also teaches you by reimplementing Unix commands, any thoughts on the differences?


Yes I saw that... I released mine first but I'm publishing it a chapter at a time and mine is about half done. I haven't read the O'Reilly one because I don't want to inadvertently copy anything or be influenced by it. I think the main difference between my book and this one is that I go through the original BSD source and translate it into idiomatic Rust. I also teach how to work with the borrow checker without resorting to copy/clone or reference counting which I think is unique. And I don't use lifetimes anywhere in the book - they're an advanced topic that really puts off new Rust programmers and aren't needed in most cases.


Nice, is the BSD C source unchanged in the book?


Yes! I use the (final) 4.4 release from 1993. Some were written by Bill Joy! But if you look at the modern OpenBSD or FreeBSD (or MacOS) versions they’re still about 90% unchanged. The older versions are a bit shorter which makes it easier to explain.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: