New book for beginners

I found there are many texts to learn Rust, but all of them are for experienced programmers.
So I started to write a free book for beginner programmers. The only prerequisite is a one-semester C language course (or about a language derived from C).
So far, I wrote the first 84 pages, and published them here:

Any comments and corrections are welcome.
Notice that I am not an English native speaker.
Edit: This book is no more freely available. It has been published as "Beginning Rust - From Novice to Professional" (Apress, 2018).

47 Likes

Neat! Ill try to check it out. Always excited for more books!

1 Like

I've started going through the book - as someone whose experience consists solely of as-needed MATLAB and a single semester of C++, this book seems like a really good resource! I definitely did have some issues with the existing guides, as they do tend to ramp up extremely quickly from the basics.

3 Likes

My book has reached 283 pages, and it is not finished yet. I think I'll stop at around 360 pages. In the last month, I got in average 67 page views per day, but still no feedback.

2 Likes

Hi Carlo,

I am one of those 67 views/day :^)
I jump here and there looking for the topic I have at hand in that moment.

I'm a complete beginner, so I don't have yet a substancial feedback. Perhaps a more detailed TOC would be a nice addition as I couldn't find a page searching for "borrow", "ownership" (the topics I'm tackling a.t.m.); only after a while I discovered that are covered in the the Drops, Moves, and Copies section (although I'm not sure because they are not explained using the usual Rust terminology and this is a bit awkward for a newbie like me).

But as far as I am concerned, the results are worth your efforts! Thank you!

4 Likes

My book is not meant as a reference material, but as a textbook, to be read sequentially. So, chapter titles are just a vague indication of the contents of chapters. However if you download the book, for example in PDF format, you can search for strings. Though, I think that to learn a programming language you really need a textbook, not a reference.
I am a professional programmer, expert in C++, and I am myself still learning Rust. I write something as I learn it. I think that ownership is a rather advanced concept, and should be taught only when the basic concepts have been grasped. By the way, I am now completely rewriting the last chapter.
In general, the book is still a work in progress, and every now and then I change even previous chapters.
I asked for feedback for two reasons: first, I am Italian, and I don't know English language very well; second, I am not a Rust expert, and so I may write something unclear or plainly wrong. Though, to make the language more approachable, I chose to start with a simplified version of the language, and I make it progressively more accurate; so, sometimes, what appears to be an error is just a simplification to make the material more understandable.

4 Likes

I'm an Electrical Engineer and Python programmer, but have been subscribed to Rust on reddit for a while and playing around when I get free time. My C is really rusty, but intrigued about the use of Rust on low level hardware, in addition to normal PC libs and programs. I look forward to working through your book as an intro.

3 Likes

Is there a place on the Rust website where community learning materials like this book by @carlomilanesi can be featured? It looks like a lot of effort has gone into this, and I feel confident people would benefit from it!

2 Likes

I've used the Rust Learning page quite a bit. I bet they take pull requests. :slight_smile:

The page is linked from the documentation page at the bottom of the learning section.

2 Likes

That page contains already a link to my book, as a work in progress (marked as "soon"). I am going to ask to remove that marker within three months.

2 Likes

I am beginner in Rust, and find your book more easy to learn from and more particularly start using Rust to write simple programs immediately. I like the text book kind of approach to the explanation of the language and concise examples or line of code to explain a concept or feature.
I have been reading and learning from the "The Book" for last few days. "The Book" has a lot of details and also explains the reasons behind the design decisions taken by authors of Rust.
I believe reading your book first to get hands on experience and then reading "The Book" will give better understanding of the Rust language.

2 Likes

I think it's worth walking people through the hello world fail example.
Ie. show them that println!("Hello " + "World"); doesn't work, because Strings and &str hit you in the face really early on as it's a fundamental datatype. I know you cover this but maybe move the strings a 100 pages closer to the front :wink:

I really like the way you spell out a lot of the basics. It's refreshing.

I would use other variable names than truthy / falsey as this implies Rust is a bit like Python/JS with bools. As far as I know this isn't the case, they're bog standard just like C# or Java.

Debug print mension {:#?} so you get pretty printing.

Like that you go through how to code an iterator.

"Implementation od references to traits"

I found Vec in rust relatively painless. (I'm a commuter rust coder a year in).
I found and still do find Hashtables hard work. I think the documentation should talk a lot more about the entry api because not using it leads to pain.

An example of the interplay of a Hashtable with a self made Tree struct using some Rc / RefCell or some such would be great.

Also showcasing how awesome threading is along maybe with a hyper request showing futures would be great given everyone's going to be getting something from the web at some point.

Again a really readable style of writing, like a conversation. Very pleasant.

3 Likes

good job but you have a lot of grammar mistakes.

When a process asks to the operating system the permit to use, say, 200 more memory bytes, and the operating system satisfies such request by reserving for such process, say, the portion of memory from byte 300 to byte 499, the operating system communicates to the process of having allocated 200 bytes, by it does not communicates to it the number 300 as starting address.

i seriously didnt understand anything from this.

1 Like

Thank you. I appreciate any feedback to my book. I am sorry for my English, but I am Italian and I studied English only at school. But with the help of people sending comments to the book, I am slowly improving it.
Regarding the cited sentence, there was a typo. I meant "but" instead of "by" (after "200 bytes, ").
However the style was indeed cumbersome, and so I just rephrased it as:

Consider this: a process asks to the operating system the permit to use 200 more memory bytes, and the operating system satisfies such request by reserving for such process, say, the portion of memory from machine location 300 to machine location 499. Then, the operating system communicates to the process of having allocated 200 bytes, but it does not communicates to it that the starting address of such portion of memory is 300.

@carlomilanesi are you going to publish with Leanpub or physical book?

I am going to publish this book with the Apress publisher (with another title). So I removed it from the Gitbook website.

@carlomilanesi is there a possibility to take look into your book right now?

No. Sorry, but I sold the copyrights to Apress. But the contents is getting better.

I was looking forward to reading it, will it no longer be a free book for beginners?

Sorry, it will no longer be a free book. Next year, it will be published here: