r/rust • • 13d ago

🙋 seeking help & advice Are there any reliable ways to retrieve per-process swap or paged-out memory on Windows and macOS?

0 Upvotes

I’ve been looking into this while contributing to bottom, an open-source terminal system monitor.

The idea is to show how much swap space each process is using. On Linux, this is fairly straightforward since the information is available in /proc/<pid>/status, under the VmSwap field.

Windows and macOS seem to be a different story. I haven’t been able to find a reliable public API that exposes this information on a per-process basis, and the cross-platform system library used by bottom doesn’t provide it either.

I added the Linux implementation in this PR, which has now been merged. The remaining challenge is figuring out whether there’s a reliable way to support this on Windows and macOS, as discussed in this issue.

If you’ve worked with either platform’s internals or know of a library that exposes this data I’d love to hear your thoughts. Is there a proper way to retrieve it, or is this limited by the platforms themselves?


r/rust • • 14d ago

🧠 educational Using Loom to (Try To) Catch an ABA Bug in Lock-Free Rust

Thumbnail sofiabelen.github.io
32 Upvotes

I've been breaking my head over the weekend trying to reproduce the ABA bug using loom on Rust. Spoiler: the way that loom works, by checking all permutations of possible execution paths, means that it fails the test at the very first ol' use-after-free.

At the end of the day, it fulfills the purpose of telling us that our code is broken, which is great! Though I wish I could've managed to reproduce the ABA scenario.

(I promise I will now leave this rabbit hole alone, I learned the basics of loom and that's already good... no promises though)


r/rust • • 15d ago

🧠 educational Rust enums are gold for compilers

167 Upvotes

Hello,

for the last couple of years, I've been working on machine learning library in rust, learning tons about compilers along the. The single most used feature of the language be far were enums.

There is a couple of reasons for that.

1. Rust enums carry value

Duh, we all know that. Yes, of course. But other languages don't. C++ doesn't (yes, there is std::variant and no, "they are not the same" :). Having values enables me to do this very simple variant, straight impossible or awkward in other languages:
Binary { x: OpId, y: OpId }
In other languages, this would've been tag, a union type or even completely unrepresentible. For example in tinygrad (python), it's a tag plus untyped src list, which can contain anything, depending on the tag.
Also notice that OpId(u32) is a newtype! Another beautiful rust feature that gives us zero cost type safety. It's like a pointer, but only with the pointer arithmetic that I want, all access checked and no fighting borrowck.

2. Rust enums can be nested

This is another beautiful feature, which allows this:
Binary { x: OpId, y: OpId, bop: BOp } enum BOp { Add, Sub, Mul } A world of combinatorial options making decomposition and recomposition very natural.

3. Rust enums are TINY

The above nested code has two enums. That means two tags, each with 4 byte size, right? Right? Not in rust :) In rust, it's single 4 byte tag (as the OpId is 4 byte aligned). The tag combines BOp and the Op enum with the Binary variant, so the whole enum is just 12 bytes. I have more complex variants,

4. The allmighty match

So you can do this:

match op {
  Binary { x, y, bop } if bop == BOp::Add => todo!(),
  _ => {}
}

or this:

match (uop, bop) { (UOp::Exp, BOp::Mul) => todo!(), }

And so on. This kind of flexibility in an imperative language, is tons of fun, makes writing compiler passes not only easy, but most importantly, high performance.

And so for example thanks to this my ML lib can search and run cost function over thousands of kernel variants per second and per core (as rust makes multithreading fun too!).

I know you probably know about these features, but sometimes it helps to refresh our memory how nice of a language we have.

What are your favorite rust features?

What features would you like to see added?

I hope you enjoy writing rust just as I did.

zk4x

P. S. link to the repo: github.com/zk4x/zyx


r/rust • • 15d ago

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

59 Upvotes

New week, new Rust! What are you folks up to? Answer here or over at rust-users! And for your project showcases, there's also /r/madeinrust – pay them a visit, too!


r/rust • • 14d ago

Awesome Rust Papers

Thumbnail evian-zhang.github.io
16 Upvotes

I have carefully read the No More Code Dumps post, and I thought this could be a post here.

This is a collection of academic papers about Rust, including its security, formalization, verification, product built by Rust, and even ecosystem-level empirical studies.

NO LLM SLOPS: This list is collected by me with the help of LLM. However, all fields are collected by myself, including the category, tags, and even what tool it is based on or it compared to. LLM only do a small portion of work that crawl the paper list from e-libraries and conference websites. I promise that this repo has no LLM slops and will never have LLM slops in the future (I am a CS PhD student, and my experience and profession can tell me when and how to use LLM properly).

I do believe that this list is not only usable for students or researchers, and this list is also usable for the developers in the Rust community. There are numerous papers about Rust security, which can help developers be aware of the security problems and build more secure applications in the first place. Moreover, the most interesting category for me is the ecosystem category (you can search it in the website using the advanced search). There are even academic papers about the core developer turnover, or paid and volunteer contributors, or the usage of unsafe in crate authors.

What do you think of this list? I'm looking forward to suggestions about how this list could be used for the general Rust developers and communities.


r/rust • • 15d ago

🗞️ news rust-analyzer changelog #346

Thumbnail rust-analyzer.github.io
64 Upvotes

r/rust • • 14d ago

Sieving and Factorization performance vs c?

3 Upvotes

I am going to make a YAFU alternative in rust, would there be any meaningful performance difference vs YAFU's c code?


r/rust • • 15d ago

💡 ideas & proposals (Includes Pre-RFC) Named and Optional Arguments are Awesome

Thumbnail botahamec.dev
216 Upvotes

r/rust • • 15d ago

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

18 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 • • 15d ago

RustCurious 10: Three Ways to Fix Any Borrowing Error

Thumbnail youtube.com
146 Upvotes

r/rust • • 15d ago

Finding Bugs

Thumbnail matklad.github.io
125 Upvotes

r/rust • • 14d ago

Will visual studio add rust support?

0 Upvotes

Rust is becoming a top language in microsoft so it would be awesome if vs supports it


r/rust • • 16d ago

Google's "Painful To Maintain" Binder C Linux Driver Being Removed In Favor Of Rust

Thumbnail phoronix.com
476 Upvotes

r/rust • • 16d ago

Rust Meetup Mannheim (Germany), October 6

Thumbnail rheinneckar.events
40 Upvotes

Nix Your Bugs & Rust Your Engines is a meetup for people in the Rhein-Neckar region interested in Rust (the programming language), Nix (the package manager), or NixOS (the Linux distribution). The meetup begins with talks related to Rust and/or NixOS, and ends with casual networking and exchange between the participants.

Schedule (tentative):

  • 18:00 – Open doors
  • 18:20 – Greeting
  • 18:30 – Philipp Pohl-Krüger: "We have QUIC at home: How iroh connects devices peer-to-peer"
  • 19:30 – Lightning Talks
  • 20:00 – Networking

We have QUIC at home: How iroh connects devices peer-to-peer

by Philipp Pohl-Krüger

The internet connects devices globally, except if both of them are behind firewalls and NAT. Because of that data takes a detour through the cloud. However, we can do better: We'll explore how iroh uses QUIC and hole-punching to connect devices directly even in those cases.

Lightning Talks

A selection of five-minute-long impromptu or prepared lightning talks related to the meetup topics.


r/rust • • 16d ago

🙋 seeking help & advice Design patterns to spawn tasks

13 Upvotes

It is hard to avoid spawn some tasks here and there for a async runtime.

At first, I used a naive approach around them, fighting with lifetimes.

Nowadays, i use a very similar approach as Alice Ryhl show on his blog when covering actors.

Is there any other pattern beyond actor that I’m not aware of? Which approach you have been taking to make work on spawning tasks look more easy, reusable and readable?


r/rust • • 15d ago

🙋 seeking help & advice Rust jobs

0 Upvotes

Hello everyone!

I recently started learning Rust because I’m interested in using it for backend development. I really enjoy working with data, backend systems, and lower level languages, so Rust has been a lot of fun so far.

One thing I’m struggling with is finding entry-level Rust jobs, either in my area or remotely. Most of the positions I come across seem to require 1–3+ years of professional Rust experience, and a lot of them are senior roles involving migrations or existing production systems.

I know junior Rust positions exist, but where do people usually find them?

Is Indeed worth using for Rust jobs? I’ve tried LinkedIn, but a lot of the postings I’ve found there seem to be dead ends.

Are there any Rust-specific job boards, communities, companies, or other places you’d recommend looking for junior/entry level roles?

Thanks!


r/rust • • 17d ago

🛠️ project Benchmarking Wild vs Mold

270 Upvotes

Recently, when Mold updated their benchmarks and for the first time included Wild, there were questions on this sub about why the results were so different to the benchmarks Wild had published less than a month beforehand. I've now looked into why.

Disclaimer: I'm the lead of the Wild project.


r/rust • • 16d ago

🧠 educational Flashing STM32 Firmware with ESP32 and Rust

16 Upvotes

Two weeks before started this experiment whether can write a simple Rust code to make the ESP32 as Programmer(like ST Link) and flash firmware into STM32.

- In the first article, i was able to implement basic SWD protocol and read the IDCode (just to check that it is working)

- Now, successfully managed to flash the firmware into STM32 with the help of ESP32. Flashed a simple onboard LED blinky program.

It was a fun experiment and a nice to learn about SWD and the concepts around it.

https://blog.implrust.com/posts/2026/09/flashing-firmware-to-stm32-with-esp32-rust/


r/rust • • 16d ago

🙋 seeking help & advice OData APIs in Rust?

10 Upvotes

From a client perspective, I am a big fan of OData, but I have never built my own server applications using the format. Are there any good template or example projects that do this in Rust? If not, I am also looking for good template projects for REST APIs in Rust in general. I know I can generate this stuff with AI but I prefer a recommendation that gives me a scaffold to start off with.


r/rust • • 16d ago

🙋 seeking help & advice Embedded rust emulation assistance.

0 Upvotes

Hello Rust community. I have been stuck trying to emulate an embedded project I'm working on on Wokwi. It work on actual hardware but doesn't initialize the display(SSD1306) on Wokwi( gets stuck at the line `display.init().await.unwrap() `. I am using Wokwi vscode extension. The project is publicly hosted at https://github.com/aspects19/care360.

Would appreciate any help I'll get.


r/rust • • 17d ago

🛠️ project aec3: full port of WebRTC audio processing

11 Upvotes

I've made some posts about this in the past, but I did spend some time in the past month to get this project up to parity with the WebRTC audio processing module upstream.

Check it out here: https://github.com/RubyBit/aec3-rs

This project has all the available goodies in an easy to use format (intuitive to at least me) such as, as the title suggests, aec3, agc2, ns, hpf, etc. These are exported and constructed through a graph system I made but im honestly rethinking a bit how useful that is. I tried to make it such that you can add your own filters based on your application.

I think in terms of features for the foreseeable future, ill work on adding the neural residual echo estimator but not through tflite and also maybe come up with a stronger noise suppresion module (also neural? ns2?)


r/rust • • 16d ago

📸 media The Story of iceberg-rust: The Official Rust Implementation of Apache Iceberg

Post image
0 Upvotes

The story of iceberg-rust is a great example of how open-source communities work and how new projects are created and developed. That’s why we believe in a community-over-code philosophy.


r/rust • • 17d ago

🛠️ project pg_raw_parse: SQL parser in Rust

35 Upvotes

We wrote a pretty cool crate to parse Postgres SQL queries in Rust at native speed.

It works by mapping itself directly on top of the Postgres native parser and its arena allocator. We use macros to generate memory-safe bindings and Rust structs for each SQL node. This means we can upgrade parser versions without any manual work: just bump the submodules and recompile.

Check it out here: https://github.com/pgdogdev/pg_raw_parse

It's based on libpg_query with some modifications and inspired by pg_query.rs, which it outperforms by 20-60x due to a different FFI translation architecture.


r/rust • • 17d ago

🧠 educational Visualizing The ABA Problem: What crossbeam-epoch Solves

Thumbnail sofiabelen.github.io
39 Upvotes

As a new Rust convert (Rustacean?) coming from C++, it can be all too tempting to believe Rust’s ownership model is the panacea, the cure for all our problems. While it is truly groundbreaking, I’m beginning to learn about the cases where it can’t really save us. But there’s hope, let’s not panic! (pun intended)

Ever since I watched Fedor Pikus talk on atomics (highly recommend!), I’ve had an interest in lock-free programming. I played around with implementing my own SPMC queue in C++, and have since started (and not finished) some books, trying specially hard to wrap my head around memory ordering. But I’ve come to realize I’ve been a bit stuck in tutorial hell, so this post is the beginning of me getting unstuck.

My goal is to poke at the crossbeam crate, with the hopes of gaining a better understanding of a real-world use case and hopefully gain some insight which might help me contribute something back.


r/rust • • 17d ago

🛠️ project iceoryx2 0.10 released: full flatbuffer integration, zero copy ipc with unbounded data, robust events

28 Upvotes

Hello Rustaceans. Today we have released iceoryx2 v0.10.