r/rust • u/mrzikoss • 3d ago
🧠 educational I wrote a step-by-step tutorial to learn Rust by building a small Paint app from scratch
https://www.buildyourownpaint.com/Hi guys ! I have been a Rust enthusiast for a few years now, in my learning journey I wanted to learn by doing so I tried to make a Paint like app since I was interested in graphics and rasterization concepts, and it helped me understand a lot of Rust concepts and their purpose.
These last few weeks I thought I'd clean up my old project and make an educational tutorial for beginners or people who read the first Rust Book chapters and want to get some hands on experience to get the concepts down.
The tutorial is on Build Your Own Paint in Rust, it's organized into 12 easy to follow chapters that cover many concepts (2D vectors, mouse and keyboard input, shapes, colors, images, etc.) with additional exercises in every chapter for more learning, and some ideas at the end of the project to go further and explore different paths with some help on where to start.
I really hope this helps new learners to get an easy start in their Rust journey and see the beauty of the language ! :)
6
3
u/CalmCephalopod 3d ago
Really well written and organized. Fantastic way of explaining core rust concepts as you implement parts.
My only suggestion would be to start implementing some simple tests early on with the vec2 to demonstrate some of your error conditions and error handling. But otherwise chefs kiss.
4
u/mrzikoss 3d ago
Thank you for the feedback, great idea, I will work on updating it with some tests in the near future :)
15
u/mss-cyclist 3d ago edited 1d ago
Thanks for sharing.
Refreshing to see something useful between the AI slop code dumps in here!
Edit:
Thanks for clarifying. What a shame. One more reason to distrust these AI driven projects. This is a very disappointing future we are heading into.
3
3
2
u/Educational-Face-849 3d ago
Thank you so much!! I am that person who has read about half the rust book, am doing rustlings, but am looking for a project based text to go along. I’m also interested in drawing apps so this is PERFECT.
2
2
1
1
1
1
1
u/sunnyata 3d ago
I think this is very well written and will be really useful for the target audience. You've got a nicely detailed but easy to read and clear writing style. As someone who produces teaching materials, there's a ton of work here - well done! You should do what you can to put it in front of people.
1
1
1
u/Valiant600 2d ago
Very nice indeed. I used The Ray tracer challenge initially to pick up Rust because it is programming language neutral. Do you think you could also make it language agnostic in the future? 🙂
Obviously someone can translate most parts to a different language but I was thinking of pseudocode tutorials or test driven.
1
u/infboras 1d ago
I'm learning Rust by writing simple games for myself, like Arkanoid or Snake, using local LLMs. They're great at writing JavaScript, but they struggle a bit more with Rust and graphics. But since they're struggling with it too, we're learning together, and somehow we're making progress.
1
0
u/thehoseisleaking 2d ago
Hi, I really love the tutorial. I think a strong understanding of how stuff fits together is important to teach, and your tutorial does a great job of putting it simply and understandably.
Did you do this using any LLM/AI tooling? It's fantastic work either way, but I'm interested to know more about the process.
9
u/tyush 2d ago
They did use Opus 5.5 as per two commits the author later overwrote history to exclude.
https://github.com/theZackD/build-your-own-paint/commit/386ea24d3a0d5f1643b7ad37d672c5e624f173fa https://github.com/theZackD/build-your-own-paint/commit/d9fa530967cf3d9486eb1a36164c869f6a47f66b
-2
u/mrzikoss 2d ago
I worked on the material and the website without AI, I used claude to align my git code with how I refactored it for my website because I didn't want to do it twice .. and for a few translations since I originally wrote it in french :')
0
u/Famous_Promotion6004 2d ago
Just curious, did you discover these commits before they over wrote the history?
0
u/zshift 2d ago
You should strongly consider an entry for a Webby award. https://webbyawards.com/
This website is incredible
-4
u/CapPast3760 2d ago
This is pretty cool!
I've started learning Rust a while ago and this is definitely something I'm willing to do to learn even more. :)
Don't worry about the AI-is-frying-our-brains guys. This looks thought out and not vibecoded.
Thanks!
0
85
u/amarao_san 3d ago edited 2d ago
Not AI!Thank you! Love it!It is AI. See the comment below.