1
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/Equux on 2026-04-24 21:49:11+00:00.

2
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/epanetrs on 2026-04-24 12:54:48+00:00.


EPANET is a computational model for solving hydraulic networks, such as drinking water distribution systems, sprinkler systems, etc. It is the academic and industry standard for hydraulic calculations due to its robustness, numerical stability and extensive validation.

The core EPANET codebase, although still actively maintained, is several decades old and written in C, making it difficult to maintain, extend and optimize using modern software engineering practices. In addition, modern applications of the solver, such as leak detection algorithms using Monte Carlo analysis and real-time digital twins of massive hydraulic networks require solving thousands of scenarios in parallel, something the original C code is not really well suited for.

I've spent the past few months translating the legacy C version of EPANET to a Rust project called EPANET-RS, using a modern Faer based solver. My main motivation for doing so was to learn Rust by using this project as a perfect example, and to get a better understanding of the inner workings of EPANET. My company however, also plans to integrate hydraulic models in the core automation systems (think PLC/Scada level). Mission critical systems where using 'unsafe' C code is increasingly being frowned upon.

Translating a legacy C project, that is essentially one massive global state machine full of intersected structs, global methods and variables, to clean and safe Rust code has been a challenge to say the least. Especially hard things to solve were the unit-conversion minefield, and keeping the network, solver and internal state in sync.

The last problem occurs mainly when you try to change network properties (pipe diameter/roughness for example) with a 'hot' solver based on said network. I was really struggling with the rust borrow checker to make that work, and ended up with a system that uses change tracking to notify a solver of the need to update its internal state.

The current version of EPANET-RS is capable of accurately solving most of the reference EPANET networks, and has about 90% of the features of the original C version. Performance wise it is about as fast as the C version for standard calculations, but is also able to solve multiple scenarios and timesteps in parallel for a massive performance boost.

It is my first Rust project so I'm sure there is lots of room for improvement, but I'm curious to see what you think of my work so far.

You can find the library here and the source code on GitHub

AI/LLM Disclaimer:

The use of AI/LLM models was mostly limited to generate test cases, for advice on dealing with the borrow checker, and to generate boilerplate for modifying networks. The majority of the code was written by hand (with the use of copilot autocomplete).

3
This Week in Rust #648 (this-week-in-rust.org)
submitted 3 months ago by [B] to c/rust@lemmit.online
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/Squeezer on 2026-04-24 03:19:51+00:00.

4
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/aswin__ on 2026-04-24 06:03:14+00:00.

5
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/Jules-Bertholet on 2026-04-24 04:11:49+00:00.


The Rust Foundation recently received access to Claude Mythos, and has been using it to review the standard library for security issues. The more severe issues are being kept under embargo for now, but a couple minor ones are now public:

Thanks to the Rust Foundation, wg-security-response, and Anthropic for working to find and fix these issues!

6
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/febinjohnjames on 2026-04-24 00:15:34+00:00.


Tutorial Link

By the end of this chapter, you'll learn to:

  • Understand how multiplayer games actually work under the hood, the four systems every online game needs (identity, persistence, real-time sync, and server authority).
  • See why SpacetimeDB is a fundamentally different approach: instead of stitching together a web server, a database, a WebSocket layer, and an auth system, you write one Rust module.
  • Set up SpacetimeDB locally, publish your first server module.
  • Implement the server side: a player table that stores who exists in your world, and reducers that automatically handle players joining, leaving, and coming back.
  • Connect your Bevy game to the server so that clicking Multiplayer opens a live connection screen showing your player name and who else is currently online.
  • Run two instances of your game side by side and watch them recognize each other as separate players on the same shared server.
7
submitted 3 months ago by [B] to c/rust@lemmit.online
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/Anthrofract on 2026-04-23 19:03:59+00:00.


A Rust TUI to manipulate the Jujutsu DAG.

Inspired by the great UX of Magit.

Previously named jjdag, renamed to majjit. Many new features like additional commands, worktree support, inline text entry, and fuzzy matching!

8
submitted 3 months ago by [B] to c/rust@lemmit.online
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/ZZaaaccc on 2026-04-24 02:30:18+00:00.


Wanted to let people know that my PR to get std::io::ErrorKind moved into core was merged this week! I'm hoping this is the starting point to get more of std::io moved into a combination of core and alloc, which should hopefully allow for way more no_std crates in the future, especially for format crates like image.

PRs for Error, Read/Write/etc. are on the way and largely awaiting decisions around:

  • How to handle the lack of Box in core (probably storing drop functions within the heap allocations that would need to call them)
  • How to thread OS error code information back to core for Display/etc. implementations (probably a static atomic pointer, until externally implementable items is more stable)
  • Whether moving RawOSError and the IoSlice types into core/alloc is acceptable (core and alloc are supposed to be as platform independent as possible)
9
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/IlllIIIllllII on 2026-04-23 20:15:13+00:00.


I've been working on an audio processing project and ran into a classic embedded problem — FreeRTOS scheduler jitter. Even a pinned high-priority task can still get preempted by system ticks, which is really bad for real-time audio.

But honestly the jitter problem wasn't the only reason I did this. After spending a lot of time with no_std Rust on the RP2350, going back to writing C for ESP-IDF became really painful. Crates like heapless just work, and without them in C, I am reimplementing everything from scratch. Fixed size buffers, ring queues, all of it by hand. Once I had that quality of tooling it's hard to go back.

Then I noticed something: the ESP32-S3 has two cores, and FreeRTOS only needs one. Core 1 just sits there doing nothing when you enable CONFIG_FREERTOS_UNICORE=y. So I thought, what if I just take it?

That rabbit hole turned into a pretty fun weekend project. I ended up waking Core 1 directly at the hardware register level and running no_std Rust on it completely outside the RTOS.

The post covers two parts:

Part 1 is static linking — reserving memory so ESP-IDF's heap never touches it, waking Core 1 by directly writing to hardware clock and reset registers, a minimal Xtensa assembly trampoline to set up the stack pointer before jumping into Rust, and AtomicU32 for lock-free inter-core communication.

Part 2 goes further — the Rust binary lives in its own flash partition, gets MMU mapped at runtime so it's executable, and can be updated independently without reflashing the main firmware.

Full writeup here: https://tingouw.com/blog/embedded/esp32/run_rust_on_app_core

Would love to hear if anyone has done something similar or has thoughts on the inter-core communication side. Currently using atomics but thinking about building a proper lock-free ring buffer next.

10
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/Geom3trik on 2026-04-23 18:14:20+00:00.


I'm very pleased to announce the release of Vizia v0.4!

Vizia is a framework for creating desktop GUI applications in a declarative way in pure Rust (no DSL or macros). The API is loosely inspired by SwiftUI but leveraging signals for reactivity.

This release brings the following major changes:

  • Replaced lenses with a new reactivity system based on signals.
  • Added support for CSS variables.
  • Improved localization support, including RTL layout and fluent datetime functions.
  • Improved built-in views with better localization, accessibility, and theming.
  • General performance improvements, particularly to layout.

The GH repo is here https://github.com/vizia/vizia and the list of changes from 0.3 is here https://github.com/vizia/vizia/releases/tag/0.4.0.

There’s also a guide book at https://book.vizia.dev/ which has been updated for this new release.

11
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/mre__ on 2026-04-23 16:12:34+00:00.

12
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/MasteredConduct on 2026-04-23 13:43:10+00:00.


Just wanted to vent a bit, a year ago I made it onto a Rust only team in FAANG, great salary, great coworkers, and best of all I finally was getting to write Rust on the clock. Fast forward to today, we were told that all new code must be written by LLMs next year and we should be code reviewers only. I'm already almost there. Instead of coding I write specifications, instead of debugging the LLM debugs, instead of code reviewing the LLM does the majority of the analysis.

It feels like Rust came too late, a great language that we barely got to experience before being swallowed in the post coding age. I'm still trying to find ways to write Rust by hand here and there, but like the chainsaw to the axe, or the auto to the horse, you don't get the same sense of productivity out of doing something "the old fashioned way". I feel robbed.

13
submitted 3 months ago by [B] to c/rust@lemmit.online
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/EncodePanda on 2026-04-22 20:12:29+00:00.


Recently, there was an online meetup at Func Prog Sweden. I did a gentle introduction to Rust for developers coming from languages like Scala or Haskell.

A few weeks ago, there was a post here on this subreddit asking about the experience of transitioning from Scala to Rust. This presentation addresses that question. This is my way of giving back to the community :) Hope someone will find it useful. Enjoy!

https://www.youtube.com/watch?v=fboHzVVfknU&t=340s

14
submitted 3 months ago by [B] to c/rust@lemmit.online
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/germandiago on 2026-04-23 00:53:25+00:00.

15
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/sevenfx on 2026-04-22 23:50:55+00:00.

16
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/ts826848 on 2026-04-22 19:29:57+00:00.

17
Polonius inactive? (old.reddit.com)
submitted 3 months ago by [B] to c/rust@lemmit.online
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/cachebags on 2026-04-22 19:02:00+00:00.


I have been in a Rust rabbit hole and was reading up on this alleged theoretical replacement for the borrow-checker. The last commit to polonius was 10 months ago- is it just abandoned? Idk why I can't find anything on it, the roadmap/progress link just takes me to rust-lang docs

18
submitted 3 months ago by [B] to c/rust@lemmit.online
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/Lasuman on 2026-04-22 16:57:16+00:00.


https://preview.redd.it/r94vuojjvrwg1.jpg?width=1867&format=pjpg&auto=webp&s=ede02b77f3cf955b62f2c7b0fae4ab3134cb964e

Hi Rust reddit! A few months ago I launched https://ferris.rs/, where you can get one (or more ^^) of these awesome Ferris Plushies.

Since January over 50 people have already received theirs, so now I'm confident enough in the whole shipping / customs process to make this post.

A bit about me:

I'm Lars (https://github.com/lars-schumann) and have been in the Rust community a bit over a year and have recently started contributing to Rust itself (please join us in the holy mission to const the world). If you frequent the Community Discord server you might already know me, I'm quite active there.

I decided to make this Plushie because I felt we had a lack of options.

If you are from the US, you will notice that shipping is quite a bit more expensive than to other countries, you can probably imagine why this is the case :]

This post is self-advertising, and as such I cleared it with the mod team before posting it.

Happy to answer any questions under this post!

19
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/Resres2208 on 2026-04-22 06:21:16+00:00.


This is a micro-optimization for a hot-loop.

I'm curious of the following. Take the following code for example:

fn return_opt(arg: MyArg) -> Option<usize> {
    If runtime_check() {
        Some(runtime_var)
     } Else {
         None
     }
}

// In the calling code
match return_opt(arg) {
     Some(var) => { branch_a(var) },
     None => { branch_b() }
}

I would like to know if that code is equivalent when compiled to the following:

fn inline_branches(arg: MyArg) {
    If runtime_check() {
        branch_a(runtime_var)
     } Else {
         branch_b()
     }
}

// In the calling code
inline_branches();

Essentially, are branches inlined eliminating any performance overhead of 'match'? I suppose this would be a reasonable use case of #[inline] if there are few callers. But I'm not sure. Can anyone give some advice? I'd rather functions are reasonable separated rather than inlining branches...

20
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/allmudi on 2026-04-21 09:06:40+00:00.


I’ve been building Proxelar, a Rust CLI project, and over the last month it got a lot more attention than I expected. It also recently hit 750 stars on GitHub, which I’m really grateful for.

I also just got it published on Homebrew, which is a big milestone for me.

I’m not posting to promote it so much as to ask for advice from people here who’ve turned OSS projects into tools people actually use.

Right now I’m trying to think less about “what feature should I add next?” and more about bigger questions like:

  • what use cases are actually worth doubling down on
  • how to avoid growing the project in the wrong direction
  • what makes a CLI tool go from “interesting” to something people keep installed and actually use in production?
  • how to make the project easier for contributors to join without creating a lot of overhead

I’d also love to bring in contributors over time, but I want to do that in a way that feels genuine and sustainable.

If you’ve been at this stage with a oss project before, I’d really appreciate any advice on what matters most next.

GitHub: https://github.com/emanuele-em/proxelar

Homebrew: brew install proxelar

21
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/chokomancarr on 2026-04-22 11:28:05+00:00.


When I was reading the source code of various standard library functions, I often need to jump through more than multiple hoops to find the actual implementation. Why is this the case?

Take the function std::mem::swap. Internally it is defined as:

pub const fn swap<T>(x: &mut T, y: &mut T) {
    // SAFETY: `&mut` guarantees these are typed readable and writable
    // as well as non-overlapping.
    unsafe { intrinsics::typed_swap_nonoverlapping(x, y) }
}

... which in turn calls ...

pub const unsafe fn typed_swap_nonoverlapping<T>(x: *mut T, y: *mut T) {
    // SAFETY: The caller provided single non-overlapping items behind
    // pointers, so swapping them with `count: 1` is fine.
    unsafe { ptr::swap_nonoverlapping(x, y, 1) };
}

... which in turn calls (after much safety checks) ...

let slice = slice_from_raw_parts_mut(x, count);
// SAFETY: This is all readable from the pointer, meaning it's one
// allocation, and thus cannot be more than isize::MAX bytes.
let bytes = unsafe { mem::size_of_val_raw::<[T]>(slice) };
if let Some(bytes) = NonZero::new(bytes) {
    // SAFETY: These are the same ranges, just expressed in a different
    // type, so they're still non-overlapping.
    unsafe { swap_nonoverlapping_bytes(x.cast(), y.cast(), bytes) };
}

... and on and on, until it eventually calls this:

fn swap_chunk<const N: usize>(x: &mut MaybeUninit<[u8; N]>, y: &mut MaybeUninit<[u8; N]>) {
    let a = *x;
    let b = *y;
    *x = b;
    *y = a;
}

Why is the standard library going through all the hoops? Why not just write this (or a swap of transmuted bytes) directly in std::mem::swap? Since it already takes 2 mutable references, surely all the non-overlapping / alignment UB checks would be unnecessary?

22
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/DudolsBr on 2026-04-22 09:43:05+00:00.


When I was at the beginning of the 3rd year of uni, I think, I decided to start working hard and actually learning programming instead of just procrastinating all day, so I spent about a year with Python. Doing small projects with Pandas, scikit-learn, langchain, some Django and Flask. It was comfortable but 0 rewarding, no emotion, just following YouTube and course tutorials, like "wtf I am actually doing?"

Back at uni's 2nd year I remembered I had a tiny bit of C from the DSA class and genuinely liked it more than I expected. So when I heard about Rust I got curious. Read the first 3 chapters of the famous book, built the damn guessing game, thought "this is really cool" but then never touched it again. Python was where the AI hype was happening, and I told myself Rust was just too complex, unnecessary.

A few months later a friend suggested me to get actual coding experience through open source. He was already contributing to a project and nudged me to check it out. I found a small easy issue, literally write 1 line, so I made the change, pushed it, opened a PR, got my first ever code review and then something clicked that no tutorial ever made click. It rushed into my brain like pure dopamine. I got hooked. Started picking up more issues. Started reviewing other people's PRs. Became a contributor. Learned a lot of git, low level web stuff and of course, Rust, by doing it. If tutorials won't give you that, a real project with real people might, you know, that human will to act in group. That was what worked for me at least.

The project that pulled me in is a Rust web framework called Rapina btw, if you're curious. The issues are approachable and the team is welcoming. But honestly the framework doesn't matter, find any open source project in the language you want to learn and try one issue. Search for "good first issues" and just start.

TLDR: Spent a year doing Python tutorials going nowhere. A friend dragged me into contributing to an open source Rust project and it changed everything. Find a real project, try one issue, that's it.

23
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/milanpramod on 2026-04-21 23:05:40+00:00.

24
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/Expensive-Click-123 on 2026-04-21 19:39:04+00:00.


Hey y’all, Truce https://github.com/truce-audio/truce is an audio plugin framework for Rust that can compile to any plugin format from a single codebase. JUCE exists, but I never liked how JUCE is owned by iLok, and JUCE just felt very 2005. It’s also incredibly bloated after 20 years. With truce, you can get your own plugin up and running in a matter of minutes, with nothing you don’t need (do you really need that JavaScript interpreter in your audio plugin?)

If there are any other fellow audio/music heads out there, I’d love to get some feedback!

Here’s a free analyzer plugin I built with truce, aimed at debugging/reverse engineering plugins: https://github.com/truce-audio/truce-analyzer

25
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/reneklacan on 2026-04-21 18:01:56+00:00.


Hi r/rust,

I wanted to share Oxanus, a Redis-backed job processing library for Rust that we've been working on for almost a year now.

It has been powering the background job infrastructure behind Player.gg and Firstlook.gg, serving hundreds of studios and millions of players.

The project is opinionated in a pretty simple way - it focuses on one backend and tries to do that well instead of abstracting over multiple backends.

Some of the things it supports today:

  • Isolated queues with independent concurrency/config
  • Retries with configurable backoff
  • Scheduled jobs and cron jobs
  • Dynamic queues
  • Throttling
  • Unique jobs
  • Resumable jobs
  • Graceful shutdown
  • Prometheus metrics
  • A built-in web dashboard (pure Rust, no JS toolchain)

Repository: https://github.com/pragmaplatform/oxanus

Any feedback is appreciated!

view more: next ›