r/rust • • 6d ago

🙋 questions megathread Hey Rustaceans! Got a question? Ask here (47/2026)!

14 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 • • 3d ago

📅 this week in rust This Week in Rust #678

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

r/rust • • 4h ago

Advice for the next 100 Rust GUIs

Thumbnail linebender.org
83 Upvotes

r/rust • • 18h ago

Compile time improvements for derive(Debug)

Thumbnail yoyo-code.com
144 Upvotes

r/rust • • 15h ago

🛠️ project Biparse: write an AST parser, get the CST free!

20 Upvotes

Crates.io link: https://crates.io/crates/biparse

Have you ever handwritten a `rowan` CST parser and thought that you're writing a ton of boilerplate for a source-to-CST-to-AST parser? Well my (small and limited) audience, this may be for you!

Taking heavy inspiration from `chumsky`, Biparse uses type-driven parser combinators for dual AST-CST construction and correspondence.

Unlike existing parsing options (I'd say the combination of `treesitter` and `rust_sitter` comes closest to what Biparse does currently, and they have their own set of advantages), you don't need two separate passes, or to omit CST generation (which may be useful for eg. error diagnostics in programming languages). CST accumulation and construction happens automatically and produces total trees, with `associate` parsers providing the "readback" from an AST to a CST tree. This way, span information etc. need not be explicitly retained in the AST payload.

This project is kind of in extremely early days (I'm already planning a v0.2.0 for additions and improvements, expect that by the end of the year!), constructive criticism and feedback welcome!


r/rust • • 1d ago

15 million web servers on one VM - smoltcp, DPDK, AF_XDP

Thumbnail kapteko.com
58 Upvotes

r/rust • • 2h ago

A cargo fork that attempts to solve disk usage

0 Upvotes

I bumped into this interesting cargo fork -- has anyone used it? https://huacnlee.github.io/cargo/why/

It's apparently by the guy who built https://gpui-kit.com/

I wonder why this issue is not more upfront and center nowadays as I see many complaining about it.


r/rust • • 1d ago

🎙️ discussion Whats your thoughts on graphics programming? Or is it just better to do it with C++?

49 Upvotes

im not doing it as a resume thing or anything. i want to make a cool big project out of some low level language and im gonna do graphics programming with either Rust or C++

goals: make new technology one day, or get cracked at programming


r/rust • • 7h ago

🗞️ news Rust parallel frontend on nightly: set or disable threads

Thumbnail importstatic.com
0 Upvotes

r/rust • • 7h ago

🛠️ project It's fascinating to see how often people love naming their Rust projects after the language itself. We can discuss some more of these cool projects.

0 Upvotes

I don't think this is as common with other languages... at least not to this extent.

I recently came across RustFS and RustDesk.
Edit: Tell me more such products to explore which are cool and useful as well.


r/rust • • 8h ago

🛠️ project bunsen-tool: 0.43.0 - speech asr, tts; language: chat, decision; 80+ pretrained models

0 Upvotes

Discord · Repo · API docs · The book

Do you want HPC AI on Rust? Because we're building HPC AI in Rust.

Between a paper's model and a Rust program that runs it lies the dungeon of theory and practice: missing layers, checkpoint formats, tokenizers, streaming, and the question of whether the port computes what the original does. We clear it one model family at a time. Expand: port the family. Consolidate: give it a real runtime, validated against the reference. Unify: fold what the families share into common parts. Upstream: hand the stable parts to burn.

bunsen is where that work lives: a "batteries included" standard library for the frontier of burn. It has the blocks models are built from, a kit per model family, a pinned catalog of 87 pretrained checkpoints that load by name, and the drivers that run them: streaming speech recognition, chat, text to speech, typed decisions.

bunsen-tool is the loot you can carry out today: those models on the command line, in one cargo install:

cargo install bunsen-tool --features wgpu          # or vulkan, metal, cuda; the CPU is always there
bunsen-tool asr live --diarize                     # Parakeet, Qwen3-ASR, Voxtral, Whisper; Sortformer
bunsen-tool tts run --play "Hello from Rust."      # ZONOS3-Mini, Qwen3-TTS
bunsen-tool chat repl                              # Qwen3/3.5, Gemma, nanochat
bunsen-tool decide run request.yml                 # Laya: typed questions, calibrated answers

r/rust • • 16h ago

Dioxus Native on FreeBSD

0 Upvotes

How difficult do you consider adapting Dioxus Native for FreeBSD to be?


r/rust • • 10h ago

🛠️ project iPhone Backup Sync: An open-source Windows tool built with Tauri v2, Rust, and Vue 3 for incremental iPhone DCIM backups

0 Upvotes

I recently released iPhone Backup Sync, a Windows desktop utility built with Tauri v2 (Rust backend) and Vue 3 + TypeScript (frontend).

The Problem: Transferring large media libraries from an iPhone to a Windows PC over USB is notoriously unreliable. Native MTP/DCIM transfers frequently stall, fail silently, or force you to manually sort through duplicates if a transfer gets interrupted.

The Solution: This app compares the iPhone's DCIM directory against a local or external backup folder and performs a clean, incremental copy of only the missing files.

Tech Stack & Highlights:

  • Backend: Rust (Tauri v2) for fast filesystem scanning and safe file operations.
  • Frontend: Vue 3.5 + TypeScript for a minimal, responsive UI.
  • Privacy: Completely offline, zero telemetry.

If you work with Tauri on Windows or deal with iOS media backups, I'd love to hear your thoughts on the implementation or any edge cases I should handle next.


r/rust • • 9h ago

🛠️ project I just finished building a side project using rust, because I'm tired of having to review the PR from AI, I've also reviewed one more, most of which look correct even though the contents are slop

Thumbnail github.com
0 Upvotes

hey guys i put together a small side project called yupp a deterministic cli and mcp , how it works under the hood JUST simple

  1. grab the diff

2, parses before & after with tree-sitter

3 flags slop, secrets, and blats radius

I also don't expect anyone to use this, so what's wrong with sharing it?

oh yeah, the license is MIT


r/rust • • 2d ago

🧠 educational Breaking 1000 Rust crates in Nixpkgs for security (and what you can do)

Thumbnail blog.rsmyth.net
121 Upvotes

r/rust • • 16h ago

🛠️ project DNS Switcher: a small egui app that times DNS resolvers with a hand-built UDP query

0 Upvotes

I've been working on a Windows utility in Rust + egui (eframe 0.28) to switch DNS resolvers and pick the fastest one from your own connection.

A few bits that might interest people here:

- The probe builds the DNS query by hand (12-byte header, QNAME labels, type A, class IN) and times the reply on a std::net::UdpSocket with a read timeout. No DNS crate needed for this part.

- All system work (netsh, ipconfig, probes) runs on worker threads and reports back over an mpsc channel, so the egui frame never blocks.

- The app icon is an SVG rendered with resvg in an example binary into PNG + multi-size ICO, then embedded with winresource from build.rs.

Repo: https://github.com/Devzinh/dns-switcher

Planned next: multi-sample probing (p50/p95, jitter), DoH/DoT, and detecting which anycast PoP answers. Code review and PRs welcome, especially on the probe.


r/rust • • 20h ago

What do you actually know that AI agents don't?

0 Upvotes

I've been stuck on this since 2023 and need a sanity check. A lot of the best devs barely write code by hand anymore, so isn't the job basically turning into building and maintaining AI workflows?

Even a very experienced dev's knowledge had to come from somewhere. Most of the tricks or optimizations they use already existed before they learned it, which means an agent can have that same knowledge too. And even when someone actually hits a brand-new technical problem, how long is it before the solution ends up out in the open for anyone to use?

The consensus I've seen among devs is that the real value in 2026 is in system design and picking the right context. I'm still not convinced. If you give an agent the right context, it can do system design too, and as long as the relevant info is written down somewhere, finding that context is mostly a search and filtering problem that agents are already getting good at. Once you actually know what you want to build, it really looks like anyone will soon be able to spit out optimal solutions without ever reading the code.

Outside of critical systems, I just don't see why deeply understanding code is going to stay necessary. Even there, a lot of the work is still known patterns and structured testing. Where does the confidence come from that a human reading the code is going to catch what a good automated workflow misses?

Call it psychosis, call it what you want, but I really need an answer here. Why would a business hire and pay a regular implementation engineer (not a researcher) instead of just having "someone who knows computers" do it?

What real-world engineering judgment do you use that you don't see AI workflows automating anytime soon? I am hoping for a healthy discussion.


r/rust • • 1d ago

Laptop recommendations for rust programming

0 Upvotes

Folks, I’m wonder if a MacBook Air M5 with 16 GB RAM is enough for the workload. Do I need more RAM? What is the minimum SSD size?

Thanks


r/rust • • 2d ago

Should I learn Rust for my project? Hand-Written code.

41 Upvotes

Hi, I have small background on Python due I'm using python script to create scripts on After Effects.

Now, I have a personal project on mind that is basically an inventory manager, should I learn Rust for this or there would be better language? Not planning to use LLM on the process to write the code would like write it entire myself.


r/rust • • 2d ago

How do you keep a mid-sized Rust codebase from accumulating too many small dependencies?

9 Upvotes

I'm working on a Rust service that started simple but has grown to a few dozen crates. A lot of the transitive dependencies feel like they're only pulling in one or two small features (date parsing, small CLI helpers, etc.). I've started wondering whether it's worth spending time to consolidate or replace some of them.

What practices have you found helpful for deciding when a dependency is worth keeping versus when it's better to implement the functionality yourself or reach for a heavier but more complete crate? Any tools or workflows you use to audit this regularly without it becoming a weekly chore?


r/rust • • 2d ago

🎙️ discussion Ubuntu 26.04's Rust coreutils vs GNU 9.12: I diffed 27 utilities, and most of the gap is already fixed on uutils main

10 Upvotes

Ubuntu 26.04 ships uutils 0.10.0 as its coreutils (since the 26.04.1 update) and keeps GNU 9.7 as gnu*. I wanted to know how close those are to current GNU, so I compared five builds against GNU coreutils 9.12: Ubuntu's uutils 0.10.0, uutils 0.12.0, uutils main, and Ubuntu's own GNU 9.7. 27 utilities, about 2,000 generated cases each (every flag, boundary values, invalid UTF-8, odd flag combinations), three seeds, en_US.UTF-8.

Results:

  • Most utilities match on almost everything. cat, tac, tr, paste, seq, sha256sum, expr and printf are at 99-100% in every build.
  • uutils main has closed the biggest gaps already. Against GNU 9.12, from 0.10.0 to main: head 66% -> 98%, cut 67% -> 99%, comm 57% -> 95%, fmt 90% -> 97%. Ubuntu users just don't have those fixes yet.
  • GNU moved too. Ubuntu's own GNU 9.7 scores about the same as uutils on head (67%) and cut (71%), and worse on tail (50% vs 96%), because 9.12 quotes some headers differently and added flags. So part of "uutils differs from GNU" is really "GNU 9.7 differs from GNU 9.12".
  • What's left on main is mostly edge cases: sort, uniq, ls, split, nl and numfmt are in the 83-91% range, mostly around locale ordering, invalid UTF-8 and numbers past 2^63.
  • wc shows 59%, but that's one flag: most cases add --debug, where uutils prints an extra line. Without those, every build is at 97-99.5%.

Two you can hit on Ubuntu 26.04 today (both fixed in 0.12.0):

  • comm -12 a b on two files sorted by the system's own sort, in en_US.UTF-8, fails with "file 1 is not in sorted order".
  • Plain ls in your home directory puts capitalized names first (byte order) instead of sorting by locale.

Caveats: these are generated edge cases, not real scripts, so a low number means "differs on unusual inputs", not "breaks your scripts". Some utilities have few distinct command lines, so a cell can move a lot between seeds (the write-up shows the ranges).

The data, the heat map, the corpora and a Dockerfile to rerun everything against any uutils commit are here: https://github.com/karolkulesza/port-anything/tree/main/showcases/ubuntu-uutils

I built the comparison tool (port-anything: https://github.com/karolkulesza/port-anything, TypeScript, open source). It reads a program's --help, generates cases, and runs the original and the rewrite side by side in a sandbox. If you maintain a Rust rewrite of a CLI and want it measured against the original, tell me which one.


r/rust • • 2d ago

Tales from the Embedded Rust Frontier: Bootstrapping a brand new ecosystem - Jonathan Pallant | EuroRust 2026

Thumbnail youtube.com
20 Upvotes

There’s a big gap between Raspberry Pi-class and STM32-class chips, and Rust’s embedded ecosystem is only now filling it. At EuroRust, Jonathan Pallant told the story 🦀✨

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


r/rust • • 1d ago

Which language would be best to learn after python?

0 Upvotes

Hello Rust community, I am currently learning python in order to familiar with how programming works. I would like to do programming for system and open source software (game dev is also a fine route). I figured I could just learn c# which I’ve heard is relatively easy if I ever wanted to do game development, but I am more so torn between C, C++, and Rust. C would be good for its wide use in open source projects and has historical significance. C++ would be good for if I wanted to become a more advanced game developer, and I personally just like the philosophy of Rust, and it is greatly increasing in popularity (unfortunately due to AI). I would like to get the thoughts of more experienced programmers, so I can get a roadmap figured out. Thanks!


r/rust • • 1d ago

🛠️ project I built an electrical CAE in Rust + egui that runs natively and as wasm – notes on a 24-crate workspace, one Draw trait for screen/PDF/DXF, and a 446-tool MCP server

0 Upvotes

OpenECraft is an open source (MIT/Apache-2.0) electrical CAE: the kind of tool used to design the control cabinets of machines. It does schematics where a contactor is one device across many pages, generated reports (bill of materials, terminal diagrams, PLC tag tables), and the cabinet laid out in 3D with the wires routed through the ducts.

Disclosure first: the project started a month ago, and most of the code was written with AI coding agents (Claude Code): 348 of 478 commits carry the co-author trailer. [Your own words: what you did yourself, e.g. the electrical domain, the specifications, review, testing against real cabinets.] I’m posting because the engineering that keeps ~265k lines of Rust in shape may be interesting here. I’m not pretending I typed them.

Rust things I’d like feedback on:

  1. Headless core, thin front ends. openecraft-core has no UI dependency. It holds the project model, netlist, checks, reports, 3D layout and routing, and the SVG / PDF / DXF / DWG export. The PDF writer, TTF subsetter and the XML / ZIP / XLSX writers are small in-house modules. The editor, CLI, MCP server, two axum servers, a parts manager and the website sit on top of it.
  2. Layering inside one crate, enforced by a test. A table lists which modules each core module may use, and a test parses the crate:: paths. A new edge fails cargo test. That was cheaper than splitting the crate further.
  3. One Draw trait (line, poly, circle, text, plus defaulted link, layer and image), implemented by the egui canvas, SVG, PDF and DXF. The defaults let a back end ignore what it can’t express, and screen and print can’t drift apart.
  4. A plugin registry is the single source of commands. Every operation is a Spec { name, help, params, run: fn(&mut Project, &Args) } entry. The CLI, the MCP server and the editor’s command pane are generated from these tables. External plugins are any process that speaks JSON on stdin/stdout.
  5. MCP with 446 tools. Listing them all costs ~255 kB of context. So the server lists the ~50 tools for schematics (29 kB) and adds find_tools / describe_tool / call_tool to reach the rest. An agent drew a direct-on-line motor starter in 129 calls, and it passed the checks with 0 errors and 0 warnings. Has anyone found a better pattern for large tool sets?
  6. wasm size: 61 MB → 32 MB (8 MB Brotli). 16 of the 20 language catalogs are fetched on demand behind a cargo feature, there’s one serialisation format instead of two, and a web profile uses opt-level = "s", fat LTO and codegen-units = 1. That profile makes routing 7% slower, so the desktop keeps release. What else would you try?
  7. No font fallback in native egui. A test checks every string literal in the workspace against the bundled fonts. CJK uses Noto Sans subsets cut to the characters the translations actually use.

Honest state: schematics, reports, checks and exports are the solid part. 3D routing in buildings, floor-plan scans and STEP/IGES import are young. Bug reports and criticism are welcome.

project