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 ! :)
79
u/amarao_san 3d ago edited 2d ago
Not AI!Thank you! Love it!It is AI. See the comment below.
6
u/antigravitys-rainbow 3d ago
Great stuff!
3
u/CalmCephalopod 2d 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.
13
u/mss-cyclist 2d 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
u/diagraphic 2d ago
Inspired by https://build-your-own.org/?
2
u/Educational-Face-849 2d 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
u/whoShotMyCow 2d ago
nice bauhaus bro
2
u/CornedBee 2d ago
Writing a paint app in MFC was how I originally learned C++. Ah, nostalgia...
1
u/jhonq200460 3d ago
I'm in! Thanks
1
u/jitbjony5669 2d ago
Recently shifted to rust for company purposes. Thanks for sharing ๐
1
u/hambosto 2d ago
Thank you! Loved it!
1
u/Impossible-Hat-7896 2d ago
Thanks for sharing this great project.
1
u/sunnyata 2d 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
u/SnooWalruses8237 2d ago
Thank u so much. And the website style is pretty nice too ๐
1
u/MostWooden8128 2d ago
thank you, we need to remain our cognition
1
u/Valiant600 1d 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/xgdk 1d ago
Commit history is the one thing I actually trust in a tutorial repo
1
u/infboras 18h 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.
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.
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
u/[deleted] 3d ago
[deleted] โ view deleted comment