Tell users that the interactive book is quite different (but also excellent)

I've started with the book:

And one is offered a more interactive version in the first page:

" Want a more interactive learning experience? Try out a different version of the Rust Book, featuring: quizzes, highlighting, visualizations, and more: https://rust-book.cs.brown.edu"

I think it should be added that they can be substantially different, as at least some important sections show. (like Chapter 4 on Ownership.)

Also, the fork was updated last in 2024.

I'm surprised the other one is officially endorsed, TBH.

Looks like someone else brought this up and they punted it to Brown.

2 Likes

Thanks i was quite confused.

I went through the pages and up to that chapter they are pretty much the same, but that's a key chapter, link here for others.

Just the Rust Book should add a simple disclaimer that the books can be quite different, this should be done in the main / reference version. It's quite an important detail.

Yes, I wondered also why it was not mentioned that a lot of the content is very different. I only read the original. While I find the idea of a quiz interesting in principle, my feeling is that readers might waste some time understanding the questions, instead of learning actually Rust. And for all the stack frame diagrams of the Brown book, I can not imagine that they really help beginners. But I am sure the authors had good intentions and put a lot of work into the book, e.g. the fact that one can highlight text sections is very useful. But typically browser extensions can do that as well.

As a final note: When you are just starting with that book, you might try "Rust for C-Programmers" as an alternative. That one is also freely available online, and quite good. I think for most people it should be a better Rust introduction.

My experience with the interactive book was very good so far.

I don't use other highlighters bc I don't know (or trust) what data they absorb.

So quizzes and the highlighter provided are great for my particular use case.

I just think one should be clearly notified in the mainstream version that they can be, at parts, substantially different.

That is great. Actually, I think that the Brown book is not that much outdated as you might have said yesterday. Rust has not changed that much in the the last few years. What actually is the best book for you depends on your personal history and your learning strategies. Some have problems studying textbooks, so they prefer learning from videos or start just coding. Have you been able to understand these stack frame diagrams, and do you think they are helpful? Or are all these boxes with compiler error messages helpful for you? And what do you think about exercises at the end of chapters -- are they actually useful? At least for the quizzes, I could imagine to add a few questions at the end of each chapter in my book. MdBook supports hiding the answers in popup widgets.

1 Like

The quizzes were useful to me, but may not be representative of others.

The diagrams were pretty cool for me, and I can say why in simple terms.

Frames are a way (may not be entirely correct) to map to what is in code blocks with braces, or functions.
So when the function exits, the function's frame is dropped. I assume this also fits nicely with shadowing, but I'm a beginner and may not be correct either. My idea is that the frame is dropped, and the previous variable is now visible.

The error messages are useful to me, because I learn to understand how rust reports errors. Ofc they need to be accompanied by some explanations.

As for how outdated, I think it may be more, or less of what I said, but Chapter 4 is different in any case, and the differences are substantial so as a reader I'd appreciate that this is better emphasised in the main book.

I just now had a discussion as to whether this sentence in the original version is accurate:

pushing values onto the stack is not considered allocating

I think it's not, but others disagree. However, it is factually inaccurate, but some think it's still useful.

The interactive version though, seems to agree with me (they are talking about the Stack below):

After a function returns, Rust deallocates the function’s frame. (Deallocation is also called freeing or dropping , and we use those terms interchangeably.)

At least so far. And this is to my eye the kind of reason why one should say "substantial" difference.

I would suggest you not to think too much about that wording. The important point is, that stack allocation (and deallocation) is very cheap, as it only modifies the stack pointer. Compared to this, heap allocations are much more expensive, as they have to find a block of memory with a matching size. Rust uses mostly plain stack variables and references to these, so heap allocation is not needed that often, and when it is needed it is hidden behind smart pointers like Box<T> and others.

2 Likes