r/rust 2d ago

πŸ™‹ questions megathread Hey Rustaceans! Got a question? Ask here (30/2026)!

9 Upvotes

Mystified about strings? Borrow checker has you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so ahaving your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last week's thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.


r/rust 2d ago

🐝 activity megathread What's everyone working on this week (30/2026)?

15 Upvotes

New week, new Rust! What are you folks up to? Answer here or over at rust-users!


r/rust 6h ago

Announcing Topcoat: a framework for building full-stack reactive web apps

Thumbnail tokio.rs
134 Upvotes

r/rust 8h ago

Improving std::simd::swizzle_dyn

Thumbnail shnatsel.github.io
89 Upvotes

r/rust 8h ago

Hardening Rust for Production

Thumbnail corrode.dev
56 Upvotes

r/rust 12h ago

πŸ› οΈ project Retrofire: 90s-inspired software rendering library with strong typing (no_std, no_deps, no_llm)

112 Upvotes

Hi all,

Given that there's been a lot of discussion about AI projects for a change, I though this is a good point to finally write a post about my very much hand-written 3D renderer retrofire, which I also used as a case study in my recently-accepted M.Sc. thesis titled "Type-safe(r) Model of Geometry in 3D Graphics".

retrofire is (optionally) no_std and has zero non-optional external dependencies. It also contains zero unsafe and, as mentioned, zero lines of LLM-generated or designed code. Last but not least, there are zero emojis :P

Please see the README for screenshots, can't post pictures in r/rust.

Umbrella package: https://crates.io/crates/retrofire

Git repo: https://github.com/jdahlstrom/retrofire

My thesis: https://www.utupub.fi/items/645d25b4-de42-4959-bd50-f96fb98b202a

A tiny example:

```rust

let verts = [
    vertex(pt3(1.0, 1.0, 0.0), rgb(1.0, 0.2, 0.0)),
    vertex(pt3(-1.0, 1.0, 0.0), rgb(0.0, 0.8, 0.2)),
    vertex(pt3(0.0, -1.0, 0.0), rgb(0.4, 0.4, 1.0)),
];

let shader = shader::new(
    // Vertex shader
    // Transform vertex position from model to clip space
    |v: Vertex3<Color3f>, mvp: &ProjMat3<Model>| {
        vertex(mvp.apply(&v.pos), v.attrib)
    },
    // Fragment shader
    // Just turn the float color to u8 RGBA format
    |frag: Frag<Color3f<_>>, _| frag.var.to_color4(),
);

let dims = dims::VGA_640_480;

// Render into a 2D buffer
let mut framebuf = Buf2::<Color4>::new(dims);

// Move the camera away a bit
let modelview = translate((0.0, 0.0, 2.0)).to();
// Use perspective projection
let project = perspective(1.0, dims.aspect(), 0.1..1000.0);
// Use the whole buffer as the viewport
let viewport = viewport(dims.into());

render(
    // Render a triangle with the given vertex indices
    [tri(0, 1, 2)],
    verts,
    &shader,
    &modelview.then(&project),
    viewport,
    &mut framebuf,
    &Context::default(),
);

```


r/rust 4h ago

πŸ™‹ seeking help & advice Learning programming and i choose rust.

12 Upvotes

I'm stubborn ik, people often jump from other languages like c or python, java to rust but I wasted a lot of time and decided to go the hardest way.. till now I didn't feel like that.. but still if I say why i choose it? idk I see the future with this language probably.. if i learn python or other languages now the market is already filled with all roles.. rust has less jobs in my country but I'd at least try outside right so.

I'm learning basics from scratch the system works and how to code.. and all from gpt.. I've made my mentor and given specific instructions not to break rhythm not to provide code unless i do stuff myself and all yeah it's silly but that's how I learn slow but properly.

ai will eat up everyday then why learn? cause I want to learn that's the answer.. could've gone with any but yeah choose rust. ai will give me code I'm sure if it but I want to know stuff right.

now my question to you all.. ofc about jobs.. as I've seen mostly prefer someone with experience atleast with other langs but here I am.. is there any hope for me? ya ik still choose to learn and the reasons are above.

what projects should I keep doing.. is leetcode neet code imp? cause when I tried learning java back then , I was really really bad at data structures and gave up cause I got a support role but now it isn't for me and I want to learn but yeah practicality matters.


r/rust 8h ago

πŸ™‹ seeking help & advice Want to practice rust

13 Upvotes

I just finished the Rust book and I'm starting my second year of college. I want to practice it, so I'm currently doing Exercism exercises. I want to extend my scope. Which website should I go to?


r/rust 58m ago

πŸ› οΈ project Orbiscreen β€” virtual secondary display for Linux streamed to Android, written in Rust

β€’ Upvotes

side project I've been working on. turns an Android tablet or phone into a second monitor for Linux over WebRTC β€” kernel-level virtual display via evdi, not a workaround.

the stack if you're curious:

  • evdi crate for the virtual display (X11 + Wayland via DRM)
  • x11rb + ashpd + PipeWire for capture
  • GStreamer pipeline for encode (VAAPI / NVENC / x264)
  • axum + webrtc-rs + mdns-sd for transport
  • evdevil + ashpd RemoteDesktop for reverse input
  • Android client in Kotlin WebView

workspace is split into focused crates: orbiscreen-core, orbiscreen-display, orbiscreen-capture, orbiscreen-encode, orbiscreen-input, orbiscreen-transport, orbiscreen-daemon.

v0.1.0, still scaffolding the WebRTC streaming and Wayland DMA-BUF path. open to feedback especially on the GStreamer pipeline structure.

GitHub


r/rust 8h ago

cuda-oxide: Bringing CUDA to Rust with a custom rustc backend

Thumbnail youtu.be
9 Upvotes

r/rust 1h ago

πŸ› οΈ project Readmer 0.1: a compiler for building READMEs from Liquid and/or Jinja2 templates

Post image
β€’ Upvotes

As a somewhat prolific open-source author over the past 25 years, I maintain hundreds of Rust crates, Ruby gems, Python packages, and so on. One of the painful aspects of large projects consisting of dozens of packages has been the individual READMEs for each package, with lots of repetitive elements but also a great deal of necessary package-specific variation.

Now, I don't want to just have an LLM generate my READMEs. People are increasingly sensitive to AI slop, and that certainly starts with a project's README: slop is readily recognizable through LLMs' lack of good judgment on README contents. More isn't always better: "If I had more time, I would have written a shorter letter" and all that.

I believe that at this point given widespread complex formatting of READMEs, what with CI badges, headers, footers, tables, images, inline HTML, etc, etc, we've in any case realistically drifted quite far from the original human-readable vision of Markdown as such. Perhaps, then, we ought to consider whether README.md files should not best be treated just as built documentation outputs, not as sacred artisanal relics to be read on a 80Γ—24 monochrome screen?

Along these lines, I present Readmer, a first attempt at a proper README compiler. Readmer composes README.md files from Liquid or Jinja2 templates stored in an unobtrusive .config/readmer/ project directory, with lots of nifties such as support for rendering CSV files as Markdown tables. I hope it comes useful to someone!

console $ cargo binstall -y readmer $ cargo new myproject && cd myproject $ mkdir -p .config/readmer/ $ echo '# {{ package.name | capitalize }}' > .config/readmer/README.md.liquid $ readmer render > README.md


r/rust 14h ago

πŸ› οΈ project Sniffnet v1.5.1 is out

Thumbnail github.com
18 Upvotes

Sniffnet, the open-source network monitoring tool written in Rust, has reached version 1.5.1 that brings connections latency measurements, support for CIDR ranges in IP blacklists, new Sinhala and Hungarian translations of the app by native speakers, and other improvements to the app stability and packaging


r/rust 1d ago

πŸ—žοΈ news Syn 3.0.0 released

Thumbnail github.com
292 Upvotes

r/rust 32m ago

Benchmarking embedded languages in Rust

Thumbnail
β€’ Upvotes

r/rust 19h ago

I built a digital logic circuit simulator in Rust (egui/eframe)

30 Upvotes

r/rust - I built a digital logic circuit simulator in Rust (egui/eframe)

Hey! I wanted to share a project i made for logic simulation nearly 100% rust and complied to WASM for some blazing fast in browser run times.

here's the link if you want to check it out: https://theta-rnd.itch.io/logic-sim

if you do would LOVE to hear your feed back thanks!


r/rust 3h ago

πŸ› οΈ project Train model Dcc central command station

0 Upvotes

Dear all, I’m building DCC-esp32, a no_std Rust firmware for an ESP32-C6 based DCC command station for model railroading, joining my passion for train models and programming (Rust). It's a first version of a command station for bare metal in Rust. Some hw of course is needed. Lot of things remain to do (i.e, desing a circuit for Railcom, adding Can, but I'm not an hw engineer and my skills in hw are at a basic level.

It uses esp-hal, Embassy async tasks, esp-wifi, ISR-driven RMT for DCC waveform generation, Z21-compatible UDP control (a Roco spec(, runtime WiFi provisioning, and early RailCom/POM integration.

I've changed also the big BTS H-birdge with a TI DRV8874 so the circuit is very easy for DCC only at the moment.

Repo: https://github.com/cc90202/DCC-esp32

I've tested with Roco, Trix and RIvarossi models and it's a pleasure to see them running.

Rust is amazing on Esp32.


r/rust 3h ago

πŸ› οΈ project Polybox: Message passing ergonomics for channels

0 Upvotes

Hello there!

I have just released the first version of polybox. Polybox provides wrappers around mpsc-channels of flume and tokio (can easily be extended for other channels), to make usage more ergonomic and ease usage of the actor-pattern.

The fundamental idea is that a Sender<T> should not have to care about the actor it is sending to. The only thing that it should care about is the messages that can be sent over the channel. A sender should not care whether it is talking to ProcessA or ProcessB, only that they both accept the same Message. This is exactly what PolyBox provides.

If this sounds interesting, and you have feedback or a use-case in mind let me know! I'm pretty happy with where it's at, but it's still in an early stage.

(No AI was used except for some basic auto-complete)


r/rust 20h ago

🧠 educational Building custom Polars expression plugins in Rust

11 Upvotes

The Polars expression plugin system has been instrumental in building the rich functionality of fenic. That part of the system is not super well discussed although it provides amazing opportunities to extend Polars in a performant way without having to fork the project.

I wrote a post going through the things we built on top of Polars with examples from the actual code base.

I thought it will be useful for anyone interesting in extending Polars and/or PyO3 and maturin among other things.

Here's the link to it

Hope you find it useful!


r/rust 1d ago

🧠 educational mmap behind the scenes in a database

Thumbnail savannahar68.medium.com
131 Upvotes

I wanted to write this for probably a year now. I've been using mmap in two append-only databases built in rust and this is everything I learned actually understanding it, including why it works in our favor even though Andy Pavlo's paper says mostly don't use it.

disclaimer: A bit of a long read though.


r/rust 1d ago

πŸ™‹ seeking help & advice Is there a way to make learning wgpu less painful?

63 Upvotes

I started by searching for tutorials and docs to learn wgpu. First, I looked at docs.rs, but it’s dense asf. So I kept looking and foundLearn WGPU. Most of the concepts are explained well, but it’s still kinda dense, and I feel like I'm just copy-pasting code.

so is there a less painful way to learn wgpu?? and do i memorise the syntax or smth?


r/rust 15h ago

πŸ™‹ seeking help & advice Working on a crate to reduce boilerplate when using tera and actix-web together.

1 Upvotes

I've been working on a utility crate to make returning Tera templates from actix-web routes more ergonomic and would welcome any feedback. Most of the documentation material I can find seems aimed at using actix-web for APIs and it is very ergonomic for that use case. In a current project, however, I am trying to make a traditional multi-page website, where all responses should be returned as full HTML pages.

I initially started by extracting a tera instance and building context directly in each route handler, but this became quite verbose, especially all the match statements I had to use for proper error handling. To alleviate this, I tried to create a custom struct that hid all of the boilerplate in its implementation of Responder. As it seemed useful, I thought I would extract it out into a crate of its own for other projects, and in the hope that it would be useful for others.

The implementation is still in an early stage (my own project is just 2 pages so far) and could do with some refinement; any feedback on the API design would be welcome! In particular, I feel that Error handling is still not ideal as error responses must currently be returned manually. This is partially due to actix-web not exposing the Request to types that implement ResponseError.


r/rust 8h ago

πŸ™‹ seeking help & advice The Embedded situation with Rust

0 Upvotes

So I started learning Rust and went straight to embedded with an ESP32 after being almost done with the book. I had previous programming experience with C++ (mainly in Unreal Engine, which uses its own build system), but I hate CMake, which was the main reason I learned Rust. I used esp-hal, embassy was ok, and all was good until I needed wifi. Tried using esp-radio, and it is so bad. There are breaking API changes from 0.16 to 0.18, which also means they did not follow SemVer, the docs on docs.rs say they failed to build for 0.18 so I am left with having to look for alternatives or use idf with the standard library which uses C bindings and takes ages to build because it needs to compile the underlying stuff too.

Is it just me, or is embedded dev prett painful with Rust because of the young ecosystem?


r/rust 16h ago

πŸ› οΈ project meon 0.5.0 - faster, better

Thumbnail github.com
0 Upvotes

r/rust 2d ago

Unbounded Channels Are Mostly a Mistake

Thumbnail fereidani.com
161 Upvotes

I would love to hear your feedback, especially regarding the addition of the new API to Kanal before the 0.2 release.


r/rust 1d ago

Rust analyzer complains over shorthand macros

19 Upvotes

In every file which uses any kind of shorthand macro it just complains. Does anybody has an idea why?

fn test_rust_analzyer() -> Vec<usize> {
Β  Β  vec![1, 2, 3]
} 

This is completely valid code but ra complains that it expects a Vec but gets ()