r/rust • • 11h ago

๐Ÿง  educational I wrote a step-by-step tutorial to learn Rust by building a small Paint app from scratch

Thumbnail buildyourownpaint.com
244 Upvotes

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 ! :)


r/rust • • 17h ago

๐Ÿ“ธ media Qt Bindings compared: CXX-Qt vs Qt Bridge

Post image
86 Upvotes

Hey there!

I'm one of the developers of Qt Bridge (https://crates.io/crates/qtbridge). One of the questions we receive most often (aside from licensing) is what makes Qt Bridge different from CXX-Qt.

This takes more than a couple of lines to explain and is best illustrated with an example, so I wrote a blog post about it: https://www.qt.io/blog/rust-bindings-cxx-qt-vs-qt-bridge

We hope it demonstrates the strengths and value of both crates. As always, let us know what you think!


r/rust • • 6h ago

I love the complier and its hints

18 Upvotes

I just started learning Rust and running cargo check every now and then has helped me find typos, small syntax errors, or other general information I can't seem to find until it's pointed out.

Something like this is simple, but I didn't see the syntax issue until running it:

error[E0308]: mismatched types
  --> src/commands/holdings.rs:86:19
   |
86 |         .find(|p| p.kind = "DEFAULT" && !p.deleted)
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
   |
help: you might have meant to compare for equality
   |
86 |         .find(|p| p.kind == "DEFAULT" && !p.deleted)
   |                           +

I've really been enjoying my time with Rust and taking it slow!

Another example:

error: format argument must be a string literal
  --> src/commands/holdings.rs:66:14
   |
66 |     println!(breakdown_body.len());
   |              ^^^^^^^^^^^^^^^^^^^^
   |
help: you might be missing a string literal to format with
   |
66 |     println!("{}", breakdown_body.len());

r/rust • • 6h ago

๐Ÿ“… this week in rust This Week in Rust #679

Thumbnail this-week-in-rust.org
15 Upvotes

r/rust • • 20h ago

Advanced Projects in Networking with Tokio

11 Upvotes

Hey everyone,

I've been learning Rust and recently started exploring concurrency and asynchronous programming with Tokio. Im familiar with the fundamentals of ownership, lifetimes, channels, synchronization primitives, and task spawning.

I want to deepen my understanding of Tokio by building a non trivial networking project rather than just following tutorials or reading documentation.

What networking projects would you recommend for someone looking to develop a deeper, practical understanding of asynchronous Rust? I would also love to hear about projects youve personally built that helped you understand these concepts better.


r/rust • • 16h ago

Building a Query System - Arya Dradjica | EuroRust 2026

Thumbnail youtube.com
6 Upvotes

Ever wondered how a compiler remembers what it already worked out? ๐Ÿค”

At this year's EuroRust, Arya walked us through how she built her own query system for a new Rust compiler and put it up against salsa. Check out the new video! ๐Ÿฆ€

In 2027 EuroRust is going to Prague! Learn more and get your ticket at eurorust.eu.


r/rust • • 23h ago

๐Ÿ™‹ seeking help & advice Considering Rust for backend services handling 10k+ req/s - real experiences with dev velocity?

6 Upvotes

I'm evaluating languages for a new internal backend service that needs to sustain high throughput with strict latency requirements. Rust keeps coming up because of its performance profile and lack of GC pauses, but I'm curious how it actually plays out in practice for teams.

Specifically:
- How much slower is initial development compared to something like Go or Kotlin when you have to fight the borrow checker on complex request/response flows?
- Once the core logic is in place, do you see meaningful maintenance wins from the type system (fewer runtime surprises, easier refactors)?
- Any gotchas with common patterns like connection pooling, structured concurrency, or observability that eat into the perf advantage?

Not looking for "Rust is the best" takes

- more interested in concrete tradeoffs people have measured on similar workloads. If you've shipped something in this range, what surprised you (good or bad)?


r/rust • • 1h ago

๐Ÿ› ๏ธ project Strand: offline dependency and impact analysis in Rust (CSR graph engine + mmap store), looking for design feedback

Post image
1 Upvotes

Hi guys, I've been working on Strand. Strand is a local command-line and GUI tool which can tell you a node's dependencies, and what would happen if those changed. Strand is in Rust and analyses Rust, Python and JS/TS code, and also some lock and build metadata. Nothing is sent outside your computer.

https://github.com/Biggest-Bee/Strand

Functionality

- Analysis of dependencies, analysis of secondary effects (see above), cycle analysis and 'whyโ€™, which identifies the minimal chain of dependencies.

- Inter-language relationships where possible.

Design:

- Graphs are represented using a compressed sparse row format. Data is stored in a file and accessed with mmap. [Insert specific data e.g. โ€˜Analysis of requires Xs initially and Yms to analyse secondary effects for N nodesโ€™.]

- There is single writer access. Multiple readers can mmap the file. I am currently considering how best to handle situations where the file is modified whilst being mmapped (which can cause SIGBUS).

- This is a may analysis and there is no type analysis. Consequently, there are areas which cannot always be analysed โ€“ for instance, in JS and Python, calls such as obj.m() on an object created within that code, plus more generally issues of dynamic dispatch.

- For large graphs, the impact analysis is approximate. This is noted in the results.

Please let me know your views on:

  1. Of lock files, temp-file-write/ rename and/or checksum verification upon opening, which do you favour for use with an mmap? What have you found problematic?
  2. Should I first implement a basic name-based function to find function calls, and then add type-aware functionality? Or should I jump to a more sophisticated solution?
  3. Any specific issue relating to my Rust implementation. Perhaps structural or performance related.

I am happy to discuss further the inner workings of Strand.

(in case anyone want to try it out, run these commands: cargo install strand-cli(for the cli), cargo install strand-gui(for the gui), or cargo install strand-gui strand-cli(for both))


r/rust • • 7h ago

๐Ÿ™‹ seeking help & advice Started a Rust blog

Thumbnail asaft.dev
0 Upvotes

Hi rustaceans,

I have started a blog with the purpose of writing Rust oriented content.

I have been mostly using Rust for the last 2 years and
I think I can share some insights with other members of the community.

How do you guys feel about the overall look, any suggestions or reprimands?

I was thinking of writing an allocator in the near future and documenting the implementation (seems like a fun experiment with the stabilization of the Allocator trait as well).


r/rust • • 5h ago

Where does tail latency actually come from in a thread-per-core Rust service?

0 Upvotes

We're building a streaming server in Rust that runs one shard per core with io_uring, and in benchmarks our p99.9 stays close to p99. But those runs were on local NVMe with hugepages, a single node, below saturation, so we honestly can't tell how much comes from the design and how much from the setup.

For those running thread-per-core services in production: what actually brought your tail latency down, and what made it creep back once real traffic, more nodes or noisy neighbours showed up?


r/rust • • 5h ago

๐Ÿ› ๏ธ project CUDA memory allocator using Rust 1.100 Allocator trait

0 Upvotes

When Allocator trait was finally stabilized I thought to make use of it. I'm working on a AI/ML framework that has some cool ideas behind it, and also provide good tools to work with NVIDIA ecosystem. The primary backend is CUDA, at least for now.

The Allocator-implementing CUDA allocator is called PinnedHost. You can find it on:

The only way I think it makes sense to use the allocator trait with a GPU is CUDA host pinned memory. Maybe somebody has more ideas.

Pinned (or page-locked) memory is host RAM that the OS doesn't move or swap out. GPU memory from cudaMalloc can't be read from the CPU. CUDA "managed memory" can be read from CPU and GPU, but it's possible to cause a segfault while a kernel runs. Pinned memory seems the only way to use std allocator trait.

Here's how to use it, given a CUDA context and a stream:

let pinned = context.pinned_host();
let mut input: PinnedVec<f32> = Vec::new_in(pinned.clone());
input.extend((0..4096_u16).map(f32::from));

let mut device = DeviceMemory::<f32>::zeroed(&context, input.len())?;
stream.sync_scope(|scope| device.copy_from_pinned_scoped(&input, scope))?;

You get a Vec that CUDA can copy to and from asynchronously, with no staging copy. The GPU can't read normal pageable memory directly (DMA). When you copy from a Vec, CUDA first copies the data into its own pinned buffer and transfers it from there (this is called staging). That costs time. Pinned memory allows the GPU to use the buffer directly.

The copies are scoped in sync_scope, which waits for the stream to finish before it returns. The allocator can't know what GPU is doing with the memory. E.g. if you drop PinnedVec while a copy from it was running, its memory would go back to the pool. The next allocation could then get the same memory and overwrite it while the GPU is still reading it.

This is part of my AI/ML framework "Singe": https://github.com/tinrab/singe


r/rust • • 9h ago

Rust Git Tower

0 Upvotes

r/rust • • 3h ago

Declarative Rust UI with hints of Erlang

0 Upvotes

https://ljos.dev/

Fun, declarative, fast UI framework. Perfect for use with AI agents, writing your own code, or maintaining and debugging it.

By using shells, you or your users can restyle it however they want, as the website demonstrates.

Use TypeScript for scripting if you want, but you can also go Rust only.

Using some of the amazing capabilities of egui ( native ) and Solid.js 2.0 ( web ).

We also have a basic studio app for wysiwyg.

But how well it does depends on you, if you like it and want to use it. This project couldn't exist unless a lot of people had built the fundamental building blocks I'm putting together.