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 • • 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 • • 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 • • 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 • • 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 • • 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.


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 • • 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 • • 6h ago

I replaced Linux on my home router with a pure #![no_std] bare-metal Rust OS (zero C, zero floats, live on fiber)

Thumbnail ayeos.com
0 Upvotes

Happy Thanksgiving r/rust!

For the past stretch I’ve been running **AyeOS / AyeFire** (`seq=125`) — a pure `#![no_std]` bare-metal Rust operating system — exclusively as our real home router on Verizon FiOS carrying 30+ devices, streaming, and Wi-Fi 7.

Link + unedited 20s physical HDMI boot video + 30s QEMU boot instructions: **https://ayeos.com**

### The Rust / Bare-Metal Stack

- **Zero-C UEFI Boot (`AyeBoot v0.2.0`):** Pure Rust bootloader (`check_zero_c_boot.sh` verified) that arms the Intel iTCO hardware watchdog, validates a **3-of-4 Ed25519 quorum** signature over the **6.1 MiB** kernel, and hands off to bare metal in <300 ms (~20s BIOS-to-live-FiOS).

- **16/16 SMP & Direct Silicon:** Intel I226-V RX/TX rings, lock-free 32bpp 1080p HDMI framebuffer (`QWave` `[F1]` / Firewall `[F2]` / Silicon `[F3]`), bounded C64-style memory layout, and A/B rollback slots.

- **Pure-Rust Networking & Real Bugs Fixed:**

- `0.65 ms` LAN ping (0% loss), `0.74 ms` DNS cache hits, `8h 28m` zero-crash soak (`48–50°C` MSR thermals).

- Wrote full **RFC 2131 T1/T2 WAN DHCPv4 lease renewal** in pure Rust after our FiOS 2-hour lease dropped overnight (`renewals=1`, zero downtime).

- Traced an Apple TV movie-night pause straight to an overly aggressive kernel connection gate (`held=0` across 17k+ checks) while keeping IoT cameras isolated (`iot_budget=0`).

- Built-in pure-Rust local UniFi Wi-Fi 7 controller (5/5 APs/switches verified).

- **Zero-Float Exact Math (`AYETLM01`):** Instead of FP32/cloud inference, local anomaly classification uses exact `p/q` rationals and balanced ternary `{-1, 0, +1}` (720,896 trits packed in SPQT Base-243 running at **525 tok/s on CPU**, 73 tok in 139 ms). Four strict architectural walls separate local learning from kernel/policy authority.

### What’s Live Today vs. Next

- **Live today:** 7.7 MiB USB / QEMU UEFI image (`seq=125`, SHA-256 + 3-of-4 signed OTA manifest), interactive zero-float BigInt `p/q` browser workbench, and research library (`library.8b.is`). Core offline router stays free forever.

- **Next gates:** Clean **Apache 2.0 kernel source drop** (final secret/history scrub underway — alerts via `/feed.json`), wider x86_64 PCIe/Wi-Fi matrix, FiOS DHCPv6-PD, and AArch64 bring-up (RPi 5 / CM5 / Apple Silicon) — the arch-independent `ayefire-*`, `ayeos-tlm`, `ayeos-dns`, and `mem8-*` crates already compile cleanly.

Happy to answer any `#![no_std]`, UEFI, NIC ring, or zero-float ternary questions! `{<3,<3,<3}`


r/rust • • 12h 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 ! :)