Rust for C-Programmers -- a few more book chapters

In the last four weeks I have revised chapter 22 about concurrency and created chapter 23 about Cargo.

Rust for C-Programmers

I think the book is now mostly complete. In the next months a chapter about testing might follow, and then I will revise all the chapters and see what I forgot to mention or what is not explained in enough detail. Macros and async is delayed at least to the end of this year or to 2026 or later. I have seen dedicated books about async at Amazon, so maybe just referring to such a book for interested people is enough.

Unfortunately Google seems to have some problems finding the online book. The title "Rust for C-Programmers" might be not the best choice -- not for Google and not for people searching for a compact Rust introduction. "Rust for adults" or "Rust for Seniors" might be alternatives. Or just "The Best Rust Book" -- I wonder how that title would promote a book at Amazon :slight_smile:

1 Like

How about "Rust for Polyglots"? I had considered "Rust for the Jaded", but that's not terribly inviting.

"Polyglot" kind of implies "this isn't a book for your first language". To the point made in your intro, it's a book for people who have past experience. You could also add a subtitle that explains the title.

Polyglot is a familiar term for jaded industry types and "Rust for Polyglots" is probably pretty unique within search engines.

EDIT: As I get past the intro, I see that you have a lot of very specific references to C. Hate to move the goal posts, but it would be interesting to fork the book into multiple different languages. If the book was online, a header dropdown would suffice.

I know C and have written it for many years. For someone who has used lot of languages, C is probably sufficient. For others who graduated college on a diet of Java, it may not be sufficient.

1 Like

Thank you very much for your constructive suggestions. The actual point of the book is, that it is intended for people who have already a bit experience in systems programming. So that we have not to explain all the basics like what is a pointer, what is the internal binary representation of integers or floats, what is stack and heap, and all these foundations. C or C++ programmers typically know all this, Python or JavaScript users might not know it. The official Rust book sometimes tries to address to inexperienced people, maybe only with some Python background. That might be justified, but can be a bit boring for people with some experience. (I have to admit that some of the explanations in the official book are really nice, they seems to be written by a native English speaker with really good writing skills.)

"Rust for Polyglots" might be a title option indeed. On the other hand, my book is a good choice for people who have only some minimal C experience, knowing at least what an invalid NULL pointer is.

Actually the book does not contain that much comparisons to C code. C is a very simple language, for many Rust concepts like its powerful enums (option and result types), pattern matching, and traits, there is no C equivalent.

Creating a book variant for people coming from other languages is indeed an option. Still I would recommend most people interested in Rust to learn (or already know) some C basics before starting with Rust(or some other systems programming language, maybe Zig, Nim, Ada). MDBook has support for collapsed section (with such a tiny triangle symbol), so I already considered integration some example code for other languages into the book, hidden by default. But I am not sure how helpful that would be. Another idea of mine was to later create a book variant with much more detailed textual explanations. Again, I am not sure if long verbose text blocks really help that much, but at least such longs texts can give some inexperienced people a good feeling.

I have just shipped chapter 25 about "Unsafe Rust". I have never used unsafe Rust myself actively, and do not really intend to use it, but I think that chapter is a useful compact introduction into the foundations of Rust's unsafe features. You might report issues on the associated GitHub repository, even when it might not yet contain all of the Markdown files of the book.