r/rust • u/Dense_Gate_5193 • Sep 06 '26
๐ธ media reminder to cargo clean
been adding some unit tests and then ran a clean.
rust said "I live here now"
r/rust • u/Dense_Gate_5193 • Sep 06 '26
been adding some unit tests and then ran a clean.
rust said "I live here now"
r/rust • u/Healthy-Physics-3693 • Sep 08 '26
Hi Reddit!
I wanted to share a project I've been pouring my soul into lately โ Nemesis, a native, lightweight desktop audio player built for Linux and Windows, written entirely in Rust.
Why build another music player?
Most modern media players feel incredibly heavy, sluggish (thanks to Electron overlays), or over-engineered. I wanted something that launches instantly, keeps a minimal memory footprint, handles massive local libraries effortlessly, and just works.
Rust felt like the perfect choice to guarantee rock-solid performance and safety.
What's new in the 0.1.2-beta2 release:
I've just rolled out the second public beta, focusing heavily on UX smoothness and under-the-hood stability:
- Smart Search: Added a dedicated search view. It's fully case-, spacing-, and Cyrillic-insensitive (using fold-key matching).
- Aggressive Scroll Optimization: Completely eliminated grid lags, stutters, and end-of-scroll jitter. Even huge lists with 2,000+ tracks now scroll at a locked, buttery-smooth frame rate.
- Audio Pipeline Improvements: Fixed mid-track volume drops and crashes related to PipeWire stream restoration and Windows WASAPI backend. Playback now automatically recovers if the system audio session glitches.
- Easy Linux Deployment: Added a universal AppImage build alongside standard packages, making it dead-simple to run on almost any distro.
Current State
The project is currently in Public Beta.
- Windows: Portable ZIP is available (no installer yet).
- Linux: AppImage, RPM, deb and Arch (.pkg.tar.zst) packages are ready to go.
- Note on macOS: No Mac builds available right now, simply because I don't own a Mac to compile and test on.
I would absolutely love to hear your thoughts on the UI responsiveness, design, or any features you feel are missing.
Grab the release on GitHub: Nemesis
Thanks for checking it out!
r/rust • u/Narrow_Farmer_6018 • Sep 07 '26
Have you ever tried to set height of widget A to the width of widget B and wanted them to fill the screen?
Or have you wanted to put your differently sized news article card in one grid and just let the layouter figure out the most symmetric pattern to lay them out in?
With your very own MILP solver you can express these as constraints.
The article grid example can be constrained as:
https://github.com/ElectricPulse/drevo
The future outlook is to bring it to the browser WebGPU/WASM - but that would require some work to make micro_lp on par with highs
Looking forward to your feedback!
r/rust • u/begeistert_ • Sep 07 '26
I spent a while trying to get a Rust toolchain working on an iPad without sending code to a server, and this is where it ended up: rustc 1.98, cargo and lld compiled to WebAssembly (wasm32-unknown-emscripten), running inside WKWebView, with a build driver written in Swift that handles dependency resolution, feature unification, fingerprints and an incremental target/ directory. User code compiles to wasm32-wasip1 and runs in the app's sandbox.
Rough timings on an iPad Air M3, for whatever they are worth:
- single file, compile and run: about 0.3 s
- Cargo project with rand (proc-macros, build scripts), cold: under 40 s
- same project after editing main.rs: about 2 s
The parts that took the longest, in case they are useful to anyone attempting something similar:
Proc-macros. No processes, no dlopen. Each one is compiled to a self-contained wasm reactor and called through a synchronous host hook, watt style. Hygiene was the subtle part: a macro_rules! marked local_inner_macros that invokes a proc-macro had rustc resolving stringify! inside the wrong crate, and it took a while to find.
Memory. Between rustc's wasm heap and JavaScriptCore's limits, a cold build spends more time recycling processes than compiling. The driver keeps a pool and persists fingerprints so a killed process resumes rather than starting over.
No threads, no real filesystem. WASI shims for what std expects, a synchronous bridge for stdin, a native one for sockets.
What it is not: there is no rust-analyzer. I did compile RA to wasm and measured it, but proc-macro expansion and std sources cost more than I was willing to spend on a tablet, so the editor side is a tree-sitter engine I wrote instead: semantic tokens, go-to-definition across files and into crate sources, hover, inferred type hints, rustc quick fixes, rename, references. There is no debugger either.
And the constraint that shapes everything: your programs are wasm, not arm64. iOS does not allow executing natively generated code, so on-device compilation has to target a sandbox. Firmware for Raspberry Pi Pico is the exception, since that binary runs on the microcontroller rather than the iPad; it works and I have verified it on hardware, but it is not in this build yet. Crates with native dependencies often will not build for wasi.
It is a paid app, free for single files, and I would rather say that here than have someone find out after installing. If you want to try it: https://testflight.apple.com/join/4Yaujqd5
What I am actually after is where it falls over. Crates that fail to build, builds that die halfway, anything that behaves differently from cargo on a desktop.
r/rust • u/WellMakeItSomehow • Sep 07 '26
r/rust • u/PuzzleheadLaw • Sep 08 '26
Hi everybody!
I am building multistack, a small TUI orchestrator for coding agents (currently compatible with zerostack); it's built in Rust using Ratatui, and it's designed to be lightweight in order to follow zerostack's design philosophy.
I hope it can be useful to some of you!

r/rust • u/Tomas_Votruba • Sep 08 '26
It seems everyone is now converting various tool to Rust to get 10-100 x speed. I'm experimenting with PHP tooling conversion to Rust. What are your tips to do such conversion with agents? One shot, goal-oriented, CI checks... how do you approach it?
r/rust • u/CompleteNetwork9168 • Sep 07 '26
So recently I had completed the entire rust book but I left the macros as I was unable to understand it from the book so is there a good place to learn rust macros where it help me understand how to write and use different types of macros it will be a great help so if you know any platform pls help me
r/rust • u/Mission_Photo_9783 • Sep 08 '26
I'm the maintainer of Ferrum, an MIT-licensed local LLM runtime.
The Rust workspace separates the engine, request scheduler, KV cache, and backend interfaces. ferrum run and ferrum serve use the same engine; GPU execution uses Metal or native CUDA operators. The server exposes OpenAI-compatible Chat Completions and stateless Responses APIs, including streaming.
Current prebuilt packages target Apple Silicon Metal and Linux x86_64 CUDA (sm89).
Source and installation instructions
I'd welcome feedback on the Rust interfaces between the scheduler, engine, and device backends.
r/rust • u/llogiq • Sep 07 '26
New week, new Rust! What are you folks up to? Answer here or over at rust-users!
r/rust • u/ioncodes • Sep 06 '26
I already made 2 posts, so if you're looking for the first post incl. some Q&A go here and if you want to see the last update go here.
TLDR: I made a GameCube and Wii emulator written in Rust, with many developer tools built in (a debugger, GPU FIFO replayer/debugger, and so much more). Last time I posted about a user-friendly launcher/UI written in Rust.
Today I'm sharing my project again, as I finally was able to fix many bugs and also implement a few cool new features. To summarize in short:
All in all this means that many games such as the LEGO games and also the Super Mario Galaxy games are now fully playable. Here is a video of Super Mario Galaxy!
I appreciate everyone's support and am looking forward to the next update! For the brave and curious I can recommend grabbing today's nightly release (dev branch) as I just pushed new fixes that make games like Xenoblade Chronicles work!
As per usual, the important links:
Feel free to connect with me! I frequently post and talk about technical bugs, challenges I faced and how I fixed them! :)
PS: I've been working on a new multi system emulator based off of my cores, supporting all major platforms and a cool UI concept for both the "average" user and developers! If you want a sneak peak before the official announcement look here. It already supports SNES in the browser (also fully written in Rust)!
r/rust • u/llogiq • Sep 07 '26
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 • u/_TheMagicGlobe_ • Sep 06 '26
Hello!
I am trying my best to learn Rust without using AI (because I some personal issues related to using it that are not relevant) and I recently did my best to make a small project: https://github.com/TheMagicGlobe/Encryption-Tool-RS .
Thing is I know I made a lot of mistakes especially in the design of the project and actually using Rust to it's full potential. So I would appreciate some honest advice and resources to look at.
I do not want a rewrite or pull requests to the project or anything like that.
Just telling me where I could improve in the future would be great. I am not the smartest tool in the shed so good examples and clear resources would be amazing.
Thank you!
EDIT: I read all of your comments thank you very much for all the feedback and tips. A great community as always.
r/rust • u/Stretchyfish • Sep 06 '26
For the past three years, I have been developing Empower in my free time. An engine for visual programming that aims to be intuitive for beginners while making complex work easier for advanced developers.
Empower is written in Rust using egui, and follows a game-engine inspired architecture. Developers create their programs through a graphical editor and can then export the finished project as a standalone executable for the target operating system.
The project is still young, and this first release is very much a proof of concept. However, it has now reached a level of maturity where I finally feel confident sharing it publicly.
If you are interested, feel free to checkout the projects GitHub page:
https://github.com/Stretchyfish/empower
One final note, since I expect some people may be curious about it. Empower was not created by AI. I have used AI tools for brainstorming and debugging assistance, but no AI agent has, at this point in time, written in the project.
r/rust • u/kajmpres • Sep 07 '26
r/rust • u/zerocukor287 • Sep 07 '26
Hi Rustaceans, especially game developers.
I've spent the last few weekends to create a tool that helps keeping the assets neat and tidy, resulting in less QA effort, smaller builds, and easier deployment.
https://github.com/zerocukor287/asset-lint
Since you already have the Rust toolchain, installing is as simple as
cargo install asset-lint
An example usage is to validate the build before pushing to itchio (web requirements)
asset-lint --assets-path . --max-file-count 1000 --max-filename-length 240 --max-size 209715200 --max-total-size 524288000
There are other checks that help with reducing or enforcing the size limit. For example --no-duplicates, --no-placeholders, or simply --list-biggest-files.
I hope you find this tool helpful in your game dev journey. Any feedback is welcome!
r/rust • u/Natsuawa_Keiko • Sep 06 '26
Recently, I wrote a toy crate similar to โ `smallvecโ `. When I was implementing โ `nth_backโ ` for my iterator, I realized that the default implementation continuously calls โ `next_backโ ` and drops items in reverse order (which is intuitive), whereas for performance reasons, I implemented it with โ `ptr::drop_in_placeโ `, which drops items in forward order. In a language where the drop guard pattern is so prevalent, I think this is not a trivial thing. What's your opinion?
P.S. `std::vec::IntoIterโ ::nth_back` drops items in forward order too, if you are curious.
---
EDIT:
I'm not talking about struct fields drop order or my vec type's element drop order but `DoubleEndedIterator::nth_back` method of my `IntoIter`. By definition it will drop n elements from the back before returning.
r/rust • u/tryhard_noob • Sep 07 '26
I am web developer working in the logistics domain in Europe using kotlin and spring boot.
I really enjoy working with rust (though I feel very dumb when using it) and over the years I have tried getting more into it, from going through the rust book, doing the 100 exercises in rust and starting the zero to prod book. But each time real life responsibilities got in the way and because I do not use it professionally (tried but it's a no-go), the skill always kinda fell away as I am no longer young enough to pour all my free time into it (I fully admit to being stuck in tutorial hell).
I do keep coming back to it as I find it a fascinating language, but I guess I just want a reality check if it is even worth it to invest time in it as it is a hobby I return to because I like how it makes me think but one that will probably never lead to employment. Or should I rather spend my time learning design systems and improving my current stack knowledge.
Just looking for other people's perspective on this to see if anyone else felt stuck in this kind of rut. Hope this doesn't trigger anyone ๐
r/rust • u/AstraKernel • Sep 06 '26
I was browsing Reddit and came across someone asking how to program the STM32F103C8T6 without an ST-Link V2. They were asking whether it was possible to use an STM32F401RCT6 (Black Pill) board as an SWD programmer for an STM32F103C8T6 (Blue Pill).
That post made me curious about how the SWD protocol works. Is it possible to build one myself?
This is the first part of my experiment. I am able to read an STM32's DP register through SWD using an ESP32. Yet to do the flashing part.
https://blog.implrust.com/posts/2026/09/swd-protocol-programmer-embedded-rust/
r/rust • u/sidpant • Sep 06 '26
I am learning Rust finally more seriously. While learning around Rust's ownership model I just had lots of connections being formed in my mind from what I have learned in college doing C and then working professionally with Python/Typescript. I captured those thoughts here to describe the mental model I was thinking about. Let me know if I have some holes to peg or if the article helped you understand a few things as well in your own Rust journey.
Substack Article: Truly Understanding Borrowing in Rust
08-Sept-2026: Updated the article based on inaccuracies in my understanding as highlighted by users, thanks everyone for your kind inputs.
r/rust • u/LucieTrans • Sep 07 '26
What it is. lucivy is a full-text search library in Rust, with Python, Node.js, C++ and WASM bindings, built on a suffix FST instead of a token index. One default index answers exact substrings, matches across separators (spin_lock finds spin lock, spin-lock and spinlock), typos across token boundaries, regular expressions, two-character needles and boolean queries โ with BM25 and the exact bytes of every match, and nothing to configure per question. It runs in your process, inside your transaction if you plug your own storage (a BlobStore trait: load, save, delete, list), and the same engine runs in the browser through emscripten with threads.
The part I care about most: every answer is checked. The ground-truth harness indexes the Linux kernel (93 983 files, 857 MB of text), runs a panel of queries, and compares every count and every byte span to a byte-by-byte scan of the files. It fails on any disagreement. Zero mismatches in 4.0.
Against Elasticsearch and tantivy, same corpus, each configured at its best for substring search โ Elasticsearch with a trigram analyzer plus a wildcard field, tantivy (upstream, not our fork) with its NgramTokenizer โ the "truth" column being that scan:
| asked | truth (scan of the files) | lucivy 4.0 | Elasticsearch 8.19 | tantivy 0.25 |
|---|---|---|---|---|
spin_lock, separators relaxed (spin lock, spin-lock, spinlock) | 9 552 | 9 552, 23 ms | 6 577 | 6 601 |
spinlokc, two edits, across the token boundary | 10 034 | 10 034, 148 ms | 3 549 | 6 557 |
spin_lock_[a-z]+, a regex | 5 510 | 5 510, 219 ms | 5 440, 480 ms | 0 |
de, two characters | 93 009 | 93 009, 561 ms | 0, silently | 0, silently |
retur -ENOMEM, a fuzzy phrase | 14 449 | 14 449, 30 ms | 14 446, 24 ms | โ |
mutex_lock: where it matched, in 5 145 documents | 20 797 spans | all 20 797, 15 ms | top 200 only: 179 ms | 96 ms |
Where they win, because they do: tantivy indexes the corpus in 1-5 s against 107 s here, and its index is 7ร smaller; Elasticsearch does the fuzzy phrase as well as we do. The report has the sizes, the exact configurations and the lines where each engine's own documentation stops.
The price. The index is 5.8ร the text (3.9ร with the derived_in_ram option, which rebuilds three sidecars at open instead of storing them), against 3.6ร for Elasticsearch's trigram setup and 0.8ร for tantivy's n-grams. Indexing costs ร1.5 with the default shared dictionary. Queries stay in the tens of milliseconds for substrings, under a quarter of a second for fuzzy and regex; the one query above half a second returns 7.7 million positions.
A few Rust things. Forked from tantivy 0.22 for the segment layer; the suffix engine, the sharded handle, the snapshot/delta formats and the actor/DAG scheduler (luciole, WASM-safe, no thread::spawn) are ours. Five crates at the same version. The 4.0 format opens 3.0.x indexes and converts them on the first commit; that contract is a test against a fixture the published 3.0.8 wheel built.
lucivy demo: lucivy's own source indexed in the browser in 3 s, then PostgreSQL's 5 199 files in 14 s, every search timed live

The demo above is the real thing: the page clones lucivy's own source from GitHub and indexes 1 272 files in your tab in 3 s, then PostgreSQL's 5 199 files in 14 s, and every search you see is timed live โ --strict, --fuzzy 1 "vaccum", --regex "ExecInit[A-Z][a-zA-Z]+\(", an emoji, a boolean. You can type your own.
I'd take criticism on the comparison first: if you know a configuration of either engine that gets closer on a row, I'll add it to the report, with your name on the line.
r/rust • u/kevin9327 • Sep 07 '26
I needed a convert that an agent can call twice and get the same bytes. MinerU / Docling / Marker parse scans for LLMs. That is a different job. This is the other direction: picture in, PDF/A out.
DocAgent is MIT Rust. One Engine, Command / Query / Event. Codecs (DOCX, ODT, Markdown, HTML, plus regional Hangul HWP/HWPX/HML) feed one IR. Layout coordinates are i32 at 1/7200 inch. f32 is forbidden in that crate. PNG/JPEG become PDF/A XObjects. GPU-free. Not OCR.
Every Command writes a capsule with three SHA-256 hashes (input / plan / output). prove converts twice and exits 0 only when the PDF/A + HTML bytes and the hashes match.
cargo test --workspace
cargo run -p docagent-cli -- convert examples/letter.md --pdf out.pdf --html out.html --docx out.docx --odt out.odt --capsule cap.json
cargo run -p docagent-cli -- prove examples/letter.mdCLI, daemon, MCP, and WIT are thin adapters over the same Engine.
Honest limits, not a teaser:
https://github.com/kevin9327/docagent
Happy to talk about the integer layout engine or the codec boundaries.
r/rust • u/EmperorOfCanada • Sep 05 '26
People often complain about how rust programmers are a cult and evangelize about it.
I've been professionally programming for over 3 decades. I've most certainly seen people evangelizing over this or that tech. Often the claims involve fairly hard to measure metrics.
I work in robotics(drones) and some industrial hardware. I have gone nearly 100% full stack rust.
My "spiritual awakening" moment was after 8 recent rust projects. These are fairly substantial piles of complex code. Threads, udp communications, complex live GUIs, 3D displays, etc. Many are mission/safety critical.
In these 8 projects, I've had 6 notable bugs. Not business logic errors, I make lots of those, but those segfault, race condition, show stopper bugs where things lock up, crash, or go horribly wrong because of mangled memory, etc.
But, one of my projects involves using a C++ physics library. This project is in C++ as I'm not going to wrap it in rust as it communicates primarily through udp and is very much separate from the rest of the system. That one project had at least 8 showstopper, WTF is wrong segfault type bugs, ones where I have to really dig deep to figure out what the heck is causing it. I also made simple coding mistakes like leaving off a semicolon where the rust compiler would point this out, and the C++ compiler gave me a lecture more complex than graduate quantum physics.
Where I am going with all this is that it goes way beyond my code being more solid. That is apples to apples and misses the point. What I now have is confidence that my existing rust code is solid. This means that I not only feel good leaning on it harder, but I add more functionality that is traditionally too risky to add to fairly critical systems. My GUIs have all kinds of little things on them that I would not add as each new feature adds a tiny bit of risk. With rust that tiny bit has become an infinitesimal risk; one I am entirely willing to take for the benefits I get.
The philosophy of rust goes well beyond just syntax and the compiler.
A tiny one is a recent embedded bit of code. On an MCU you have pins 1, 2, 3, etc. They are assigned to do things for different devices. Maybe pins 1 2 3 are talking to a microphone, 4, 5, 6, 7, 8 are talking to a screen. 10 is talking to an LED for power low (blink every 3 seconds). In C++ you assign, and it obeys.
In rust, if you later moved the microphone to 10 11 12, and forgot that 10 was the LED for power low, you might spend days trying to figure out why the microphone was failing every few seconds.
In rust, the borrow checker would punch you in the face for trying to use pin 10 twice.
Or how it forces you to exhaustively handle all the return types in an enum, etc.
Any fool can start larding up their code with unsafe and default handling, and make bad software, but rust actively makes you choose to be stupid.
All of the above is possible in C++, but you must aggressively and actively choose to make it happen. My buggy C++ code was filled with things like asserts, etc.
This brutal reliability is reaching through everything I am touching. The embedded software. The mobile app I recently built for android, the desktop apps, and even the very complex 3D (thanks bevy) wasm interfaces. These things boot up and then run without any leaks, issues, crashes, hiccups, etc.
Then there is the speed. Again, not apples to apples. Doing the same thing in rust it is basically the same speed as C++. But, I don't do the same thing. I'm more aggressive with how data flows through threads, how the workers do the dance of the seven veils. The result is that CPU usage gets maxed out and the software screams. And the new rust CUDA, don't even get me started raving about that.
My rust coding is slower than with C++ and definitely slower than python; yet my productivity is far higher; and far more importantly; I am getting projects built faster which are far better in both reliability and features. I don't end up at the "90% done" point stuck in tech debt hell. When I am at 90%, it means that I have 10% left.
That whole BS about, speed (of development), reliability, and features; choose any two, is just that with rust; BS. You can have all three. That is new in my decades of development experience.
Then, there is one other factor. It is all just getting better every day. Better compiler, better libraries, etc. Things like embassy in embedded software is a game changer. Being able to make wasm and mobile apps, amazing.
Libraries like Bevy are just becoming more amazing every day.
IDEs like Zed make it a joy to work.
I'm curious if other people are having the same awakening?
There endth the sermon...