Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rust concept notes to Burn Book #1169

Merged
merged 6 commits into from
Jan 24, 2024
Merged

Conversation

laggui
Copy link
Member

@laggui laggui commented Jan 23, 2024

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

Closes #1155

Changes

For new Rustaceans, following the guide should be enough to get started with Burn. In the previous version of the book, we simply mentioned that people should "read the first chapters of the Rust Book" first.

While it is still recommended, this PR introduces 🦀 Rust Note indicators throughout the sections 3 (Getting Started) and 4 (Basic Workflow, aka "The Guide").

The notes are collapsible sections which provide explanations for the basic Rust concepts involved in the current context.

🦀 An Example Note

This note should briefly explain one concept (or in some cases, a few related concepts) particular to Rust and perhaps detail how it is applied in the current section.

External references are usually provided, pointing to the Rust Book as the main source.


Let me know what you think about the context notes as collapsible sections! I used the crab 🦀 emoji since the notes are supposed to be Rust specific, but it could be changed if you have any other preferences.

Also, any comments on the added notes are welcome! And if you think I missed anything let me know.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (707b610) 86.00% compared to head (595bca8) 85.97%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1169       /-   ##
==========================================
- Coverage   86.00%   85.97%   -0.04%     
==========================================
  Files         522      522              
  Lines       58783    59179      396     
==========================================
  Hits        50558    50879      321     
- Misses       8225     8300       75     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@nathanielsimard nathanielsimard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, but I think this will be really useful for people without much Rust experience, thanks!

<details id="derive-attribute">
<summary><strong>🦀 Derive Attribute</strong></summary>

The `derive` attribute allows traits to be implemented easily by generating code that will
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not only for traits, you can add arbitrary code based on the provided type, but you can't modify the existing code; you can only append new elements. Using the attribute #[my_macro], you can effectively update the provided code. Derive is frequently employed to recursively implement traits, where the implementation consists of the composition of all fields.

Comment on lines 204 to 205
In Rust, memory management is rather unique. Aside from
[primitive types](https://doc.rust-lang.org/rust-by-example/primitives.html), every value is _owned_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is related to the Copy trait, not necessarily the primitive types (although they all implement Copy, making it a great example).

@laggui
Copy link
Member Author

laggui commented Jan 24, 2024

@nathanielsimard made the requested changes! Let me know if my additions are correct :)

@nathanielsimard nathanielsimard merged commit e1d873a into main Jan 24, 2024
15 checks passed
@nathanielsimard nathanielsimard deleted the docs/rust-getting-started branch January 24, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Burn Book: Introduction to Rust
2 participants