<p>Rust also has really good error messages, well-written documentation, and excellent tools that make writing code and debugging easier. I like it because it helps me make sure that my program is doing exactly what I want it to. I hope you like it too!</p>
<h2id="getting-started">Getting started</h2>
<p><strong>Where do I write Rust?</strong> Rust has two language servers that attach to your editor to analyze your code while you write it, <code>rls</code> and <code>rust-analyzer</code> (most people use the second). If you’re not already attached to a text editor, VS Code’s <code>rust-analyzer</code> extension is really good!</p>
<p><strong>Where do I find documentation?</strong> Documentation for Rust’s standard library is at <ahref="https://doc.rust-lang.org/std/index.html"class="uri">https://doc.rust-lang.org/std/index.html</a>. Documentation for crates like macroquad is at <ahref="https://docs.rs/crate_name"class="uri">https://docs.rs/crate_name</a>.</p>
<p><strong>Where do I find documentation?</strong> Documentation for Rust’s standard library is at <ahref="https://doc.rust-lang.org/std/index.html"class="uri">https://doc.rust-lang.org/std/index.html</a>. Documentation for crates like macroquad is at <ahref="#"class="uri">https://docs.rs/crate_name</a>.</p>
<p><strong>What’s cargo?</strong> Cargo is Rust’s package manager and build system. It downloads crates from <ahref="https://crates.io"class="uri">https://crates.io</a>, runs projects, runs tests, generates documentation, manages dependencies, and more! You use it from the terminal—if you’re not familiar with it, there’s a tutorial linked on the last page.</p>
<h2id="an-example">An example</h2>
<p>I’m going to walk through an example of an extremely minimal 2D game using the library Macroquad. First, you want to make a new crate (a project) with cargo. In the terminal, navigate to the folder where you want to make your project, and run the command:</p>
@ -2,6 +2,7 @@ this is a rust zine that provides an introduction to the language if you don't h
- html: <https://licynthiax.gitlab.io/rust-zine>, screenreader-accessible version + working links.
- pdf: rust-zine.pdf, to download and read.
- pdf (printable flavor): rust-zine-printable.pdf, print (double-sided!), put all the pages on top of each other, fold in half, and staple. (made with <https://jywarren.github.io/bookletize.js/>)
- pdf (printable flavor): rust-zine-printable.pdf, print (double-sided!), put all the pages on top of each other, fold in half, and staple. (made with <https://jywarren.github.io/bookletize.js>)
- also some of the example code is in the `cool-game/` folder
please don't share publicly outside of the 5Cs, thanks
download by clicking the name of the pdf, then hit the download button in the top right corner.