News for hackers. Stuff that matters.
Re:How I went about learning Rust by mprovost on Friday July 15, 2022 @05:40AM (#32106376)
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/

Re:How I went about learning Rust by cercatrova on Friday July 15, 2022 @10:22AM (#32108494)
Interesting, seems similar to the book Command Line Rust which also teaches you by reimplementing Unix commands, any thoughts on the differences?
Re:How I went about learning Rust by mprovost on Friday July 15, 2022 @11:21AM (#32109052)
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.
Re:How I went about learning Rust by Scarbutt on Friday July 15, 2022 @02:43PM (#32111454)
Nice, is the BSD C source unchanged in the book?
Re:How I went about learning Rust by mprovost on Friday July 15, 2022 @02:54PM (#32111569)
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.