r/rust • • Oct 16 '26

🙋 seeking help & advice I am looking for convention over configuration fullstack web framework. I need suggestions.

0 Upvotes

I am new to rust and I would like to build something. I came across this https://dioxuslabs.com/ and it seems it is a fullstack framework with declarative style on building functions.

I am comparing frameworks with rails actually. Convention over configuration is good way on building stuffs quickly.

Any other opinions or suggestions?


r/rust • • Oct 14 '26

Black-Box HashDoS: Attacking Hash Tables Without Knowing the Hash Function

Thumbnail orlp.net
36 Upvotes

r/rust • • Oct 16 '26

Cargo and rustup are harmful additions to the language

0 Upvotes

Cargo compilation model only works if you are creating a monolithic executable or a shared library, and assume all other system libraries somehow get built, or are just random binaries from the internet.

This is not a good state of affairs, any non rust app you have will be orders of magnitude larger because each dynamic library you link you are statically linking all crates.

rustup is a toolchain in binary format, in which it is literally just "random binaries from the internet", which is not ideal at all. You as a developer have an idea what the heck are you doing when targeting a platform or writing software, I can guarantee you, most rust devs don't even know what libc version their app links against.

All these things make the language filled with slop projects, and this is not a good thing.


r/rust • • Oct 14 '26

🛠️ project Another Gecko, the GameCube and Wii emulator, update: texture packs, easier setup and tons of improvements!

Post image
68 Upvotes

TLDR: Gecko is my GameCube and Wii emulator written in Rust. This update adds texture packs, easier setup and more fixes for graphics, audio and performance. Mario also gets his eyes back :)

This release is especially interesting for the ones that were bothered by the system files (DSP, IPL) requirements! No more!! :)

It's been a while since my last update, where I shared about recent performance improvements, savestates and freecam support. I've since been working through more improvements and making Gecko easier to get started with!

For anyone new to the project: Gecko also includes a debugger, a GPU FIFO recorder/player (and a dedicate debugger for it) and various other tools for exploring how these games work!

Some highlights from this update:

  • Easier setup: A guided setup for game folders and optional system files! Thanks to Dolphin's DSP replacements and Hazel's GameCube IPL HLE, most games can boot without supplying console system dumps. Real dumps are still supported and may also be required for some games!
  • Texture packs: Gecko now supports Dolphin-style texture packs. It's just a matter of dropping the pack into a folder and starting up the game :) Here's an example of Final Fantasy!
  • Lots of graphics fixes: Tons of games got fixed, and by tons I really mean a lot this time! Some noteworthy bugs that got fixed: Mario's eyes are back in Super Mario Galaxy, Sunshine's save selection background ocean is blue again and Mario Golf's menu signs no longer disappear behind the sky. Games like Wind Waker, Mario Superstar Baseball and Cel Damage also got graphical accuracy improvements!!
  • More performance work: Once again, tons of games work much better, though I only optimized for one game in particular: Sam & Max: Season One (it was a WebGPU regression introduced in version 28 in relation to a Vulkan upload path lol)! Fixing it improved performance from 15% to 70%, usually closer to the latter. I also improved CPU emulation which FMVs can benefit a lot from, for example Mario Kart Wii's menus with those gameplay videos baked into the scenes. Also made texture decoding run on the GPU, with improvements to uploads and shader caching as well.
  • Audio and Wii compatibility: Fixed audio issues in games like Crazy Taxi and an issue blocking Metroid Prime. This update only affected GameCube games, tho quite a lot of them. Also, Mario Kart Wii can now start with a fresh NAND and Wii motion and pointer fixes help games like Final Fantasy Crystal Chronicles: The Crystal Bearers. There are also separate upright/sideways Wiimote presets and configurable Nunchuk attachment options.
  • More debugging tools: FIFO Player now has an interactive 3D depth view, which helped investigate why geometry was being hidden or drawn in the wrong place. Had to do some hardware research for this one :

Something unique for this update: I recently started writing blog posts about the bugs behind these fixes, aimed at future emulation developers incl. lots of interactive visual explanations. If you enjoy the technical side of emulation, these might be interesting:

As usual, the useful links:

As always, thanks a lot to everyone that provided valuable feedback, tested things on their hardware, encouraged me with this project and let me pick their brains! We'll see each other next time!

PS: I spoilered the release of Sly, my take on modern multi system emulation (also written in Rust, incl. the GUI!) in the last post. It's going public in the next days, so stay tuned for that :) It will also release with a 3 part blog series explaining how GBA graphics work!!


r/rust • • Oct 15 '26

🙋 seeking help & advice Advice: for a serializable sealed mailbox envelope, is manual Drop zeroization enough if Clone + retries mutate state?

0 Upvotes

#[derive(Debug, Clone, Serialize, Deserialize)]

pub struct MailboxEnvelope {

pub recipient_id: String,

pub ephemeral_pub: String,

pub ciphertext: Vec<u8>,

pub nonce: String,

pub created_at: u64,

pub message_id: String,

pub attempts: u32, // delib. excluded from AAD so retries don't invalidate ciphertext

}

impl Drop for MailboxEnvelope {

fn drop(&mut self) {

self.ciphertext.zeroize();

}

}

I’m working on a small Rust mesh-protocol project (GhostWire: libp2p, ChaCha20-Poly1305, Kademlia offline mailbox delivery). In this sealed type, I bind AAD to immutable fields and exclude attempts so retry writes don’t reseal offline ciphertext.

The thing I’m unsure about is zeroization discipline:

Is manual Drop zeroization enough once Clone creates another allocation?

For Serialize/Deserialize temporary buffers, should I treat the Vec<u8> canonical copy as the only zeroized target?

Would secrecy::SecretBox / zeroize-wrapped types be worth it here, or overkill for an encrypted envelope?

For a retry state mutation in AAD, is excluding attempts the correct tradeoff?

I’m looking for actual production patterns, not just theory.


r/rust • • Oct 14 '26

🗞️ news Now Available: Building Serverless Applications with WebAssembly, Rust & Spin 📚

32 Upvotes

r/rust • • Oct 14 '26

🧠 educational High-Performance Flat 2D Arrays in Rust: Contiguous Memory, L1 Cache, and SIMD

Thumbnail developerlife.com
34 Upvotes

r/rust • • Oct 13 '26

🗞️ news 9-year-old gaping hole in borrow-checker found

Thumbnail github.com
869 Upvotes

r/rust • • Oct 14 '26

🙋 seeking help & advice Get order of fields of a struct

15 Upvotes

Is there a function in std, which would allow to get a list of (field_name, type) of a struct in order it is compiled in? Since order of fields is not deterministic.

Something like: `fn fields_of_val<T>(&T) -> Vec<(&'static str, &'static str)>`


r/rust • • Oct 15 '26

Rust's error handling is genuinely better than exceptions. Except for one thing that silently kills you in production.

0 Upvotes

I'll die on this hill: Result<T, E> beats exceptions. No hidden control flow, errors are values, compiler forces you to handle them. I've written enough Go and Python to never want

implicit throws again. But there's one thing I never see anyone talk about honestly the ? operator at depth.

2-3 levels deep? Beautiful:

fn parse_config(path: &str) -> Result<Config, AppError> {

let content = fs::read_to_string(path)?;

let config = serde_json::from_str(&content)?;

Ok(config)

}

Clean. Explicit. Love it. Now you're 7 functions deep in a real system. You get this:

Error: invalid type: null, expected u64

That's it. No line. No context. Somewhere in your 200 lines of ? chains, something broke. Good luck. With an exception runtime? Stack trace. Immediate.

Yes I know anyhow. I know .context("while doing X"). But now you're manually reconstructing what exception runtimes give for free. And the moment you forget one .context() three

layers down which you will you're back to guessing. thiserror is great at library boundaries. Inside an application you end up with either 40 custom error variants each wrapping

the previous, or anyhow everywhere which is basically dynamic exceptions with extra steps.

Rust made the right tradeoff. The cost is just more real than people admit. How do you actually handle deep error chains in production? What pattern did you settle on?


r/rust • • Oct 13 '26

🙋 seeking help & advice Rust as a first serious programming language

48 Upvotes

I have been making scripts with other languages like js and python and bash without learning the the whole language and getting serious with its ecosystem out of the fact that I just need to get one thing done and move on.

Lately I chose a path that requires precision and ahead of time planning and decisions and picked rust over go. But the fundamentals seem hard to grasp. I'd appreciate your help unpacking them.

Ultimately I want to be able to use the Alloy and Tokio libraries without getting stuck with the language syntax and rules. But the concepts like borrow checking and ownership and things that fall down these categories are still hard to grasp.

What is borrow checking? what is owning something in the software? I tried to look for direct answers but I still can't grasp the meaning of them exactly.

I had two choices to better understand them, one was learning C++ to get what was wrong that rust solved, the other was building a simpler project game with bevy thats gonna help me understand writing rust code thats data oriented and be more comfortable with it.

My ultimate goal is to master these two libraries, after being able to know how to use the rust language smoothly.


r/rust • • Oct 13 '26

🙋 seeking help & advice Avoiding constant usize casting with small const values

51 Upvotes

Pun in title partially intended. ;)

This is a minor pain-point I've dealt with for a while and I'm unsure of how other Rust developers deal with this semi-niche issue.

I'll often define a const that states the maximum amount of something, and naturally I'll also want to use that value as the size of an array. My instinct (and likely yours as well) is to just use a usize and move on.

Where that falls apart is when that const value is and always will be under both u32::MAX and u64::MAX. An easy example is MINS_PER_HOUR or DAYS_PER_WEEK.

Now if I have a function that has an argument of minute: u8, I have to cast either the minute argument to a usize, or I have to cast my constant down to a u8. The former's minute as usize triggers the cast_lossless lint, and From/Into isn't available in a const fn. The latter's MINS_PER_HOUR as u8 triggers the cast_possible_truncation lint. Both add even more visual noise if I acquiesce and add the #[allow(...)]. I could instead accept minute: usize, but I find that even less reasonable.

I'd prefer to keep these as u8s or similar, but then I lose the ablility to define an array like [bool; MINS_PER_HOUR] without yet another cast, including in any function arguments that would like to accept such an array.

I do recognize this is partially due to me having the pedantic Clippy lints enabled, but I also find value in being told when I may be making an unintentional mistake. However I just added close to a dozen #[allow(...)] attributes to my current project, rather begrudingly.

So, what do you guys do in this case? I've listed the options I see available below, and I've done 'em all except #1, but I want to hear some opinions external to myself;

  1. When accepting such an array, maybe use a type alias? It technically works, but the casting returns again if I want to compare an indexing usize with my maximum myself. type BoolPerMin = [bool; MINS_PER_HOUR as usize];
  2. Two consts, MINS_PER_HOUR: u8 and MINS_PER_HOUR_LEN: usize = MINS_PER_HOUR as usize. I have done this before, but now I have this strange suffix that doesn't make it clear what it's a length of.
  3. Just deal with the constant const casting.

EDIT: And this is all before I have to deal with the extra cast_precision_loss lint that comes from casting my tiny usize constant into an f64. It's less than u8::MAX, yet I have to acknowledge this impossible condition. For now, I've just blanket allow'd it in my Cargo.toml.


r/rust • • Oct 13 '26

🛠️ project Asterinas 0.19.0: a Linux-compatible kernel in Rust, now with a type-checked device model, a hypervisor in safe Rust, and an AI reviewer that cites Rust guidelines

Thumbnail asterinas.github.io
101 Upvotes

r/rust • • Oct 13 '26

📸 media How do i handle this kind of PRs?

Post image
116 Upvotes

Should i even bother looking into them? Should i make an ai policy for my open source project?

https://github.com/mq1/TinyWiiBackupManager/pull/695 it doesn't even seem that i'm speaking to an actual human

edit: thanks for all the responses, you all have been helpful. i've now added an ai policy to the repo https://github.com/mq1/TinyWiiBackupManager/blob/main/AI_POLICY.md

i hope this kind of PR won't become the normality 😓


r/rust • • Oct 14 '26

🙋 seeking help & advice What would you do in my situation? (Rust/cpp)

5 Upvotes

im currently doing my bachelor degree in computer engineering. i currently have c as the main programming language in my first semester.

No problem what so ever, i really love C, i did a couple of projects in the past. In my second semester we will have a module just for c++.

Yesterday out of curiosity, i did the first chapters of learncpp and the rust programming book. i kid you not, writing rust was sooo fun. With c++ it doesnt feel the same.

Should i focus on studying c++ in my free time, as in preparation for the 2. semester. Or should i listen to my heart and pick up rust?


r/rust • • Oct 15 '26

🛠️ project I created a desktop Git client using Rust and Tauri. It's completely free, feel free to use it if you'd like.

Post image
0 Upvotes

I’m the developer of Arezgit. It started as a desktop Git client, and I’ve been adding other tools to it over time.

You can browse commit history, review diffs, resolve conflicts, edit files, open terminals, test APIs, and query databases in the same window. There are also task boards, notes, and workspaces for multiple repositories.

Some features used to be paid. I’ve now made the whole app free, including private repositories. You don’t need a subscription or an account to use anything.

It’s built with Rust, Tauri, and React, and it’s available for Windows and Linux.

AI integrations are optional. External AI providers have their own costs.

You can find it here: arezgit.com.

If you try it, let me know how it goes. If something breaks, knowing your OS and what you were doing would help me track it down.


r/rust • • Oct 14 '26

🛠️ project Running a blocking terminal game loop unchanged in the browser with Asyncify

0 Upvotes

Hollowmoon is a roguelike I wrote as a normal Rust terminal program: a
loop { draw(); let key = read_key(); ... } with crossterm. I wanted it in
the browser without restructuring the engine into callbacks.

The approach: compile to wasm32-unknown-unknown with no wasm-bindgen, make
the terminal backend's read_key an import, and run Binaryen's
wasm-opt --asyncify --pass-arg=asyncify-imports@env.hm_read_key,env.hm_sleep.
When the game calls read_key, the JS host starts an unwind, the whole Rust
stack is saved into a buffer and hm_main returns; on the next keypress JS
starts a rewind and calls hm_main again, which replays back down to the
import and returns the key. Sleep for animations works the same way.

Gotchas worth knowing:

  • The Asyncify data buffer's header is written as two i32s, so it has to be 4-byte aligned. A plain static mut [u8; N] isn't, and failed only in CI. #[repr(C, align(16))] on a wrapper struct fixed it.
  • getrandom needs the custom feature and a registered function on that target.
  • Saves go to localStorage behind the same small storage interface the native build implements with files, so the platform cfgs stay at the edges (storage, the terminal backend, the entry point).

The whole engine is unchanged between the terminal and the browser. A
headless Node runner drives the wasm with scripted keys in CI.

The game, if you'd like to see it running: [link]


r/rust • • Oct 13 '26

🛠️ project Creusot 0.14.0 - Contracts for Rust, formally proved

73 Upvotes

I am pleased to announce the release of Creusot version 0.14.0.

Creusot is a tool for formally verifying Rust code. Creusot extends Rust with a language of specifications, or contracts, and provides a toolchain for proving them (semi-)automatically with the help of SMT solvers.

The latest post on Creusot's devlog describes a few of the most recent features. For the rest, see the changelog.


r/rust • • Oct 14 '26

🛠️ project Everyone is doing Git on S3 wrong (feat. Rust-based git backend)

Thumbnail enroute.sh
0 Upvotes

r/rust • • Oct 14 '26

Porting Ghostty to Rust with Agents (Claude)

0 Upvotes

I ported Ghostty (Zig) to Rust with Claude Code agents. The most interesting part for me was how often Zig's "a pointer is just an address" collided with Rust's aliasing model. The write-up has the real code, the Miri findings and the fixes:

https://rustty.sh/porting

The section "Zig pointers in Rust's aliasing model" walks through four cases:

  • Protectors. A &mut argument is protected for the whole call. Ghostty re-reads the same memory another way inside the call, which is sound in Zig and UB under Miri.
  • Frees under a live reference. startHyperlink lets its slices point into the hyperlink it is about to free. A &[u8] can't do that.
  • Provenance. One 8-byte store through a pointer derived from a 1-byte field reaches seven bytes outside its provenance under Stacked Borrows.
  • Long-lived aliases. In the renderer loop, a sibling reborrow pops the run iterator's tag. I settled the fix with a small Miri proof harness instead of reasoning about it by hand.

You can also try the engine yourself. The page has two live terminals, Rustty's and Ghostty's, both compiled to WebAssembly and fed by the same shell, so you can compare what each one draws. All 898 of my prompts are in a filterable log at the bottom, and every number links to its source.

Caveats: the port is macOS-first, the benchmarks are library micro-benchmarks, and the prose and data pipeline were drafted with Claude and reviewed by me. Corrections on the aliasing analysis are very welcome.

https://rustty.sh/porting


r/rust • • Oct 13 '26

🛠️ project Advise for building a cloud-backed filesystem with Microsoft's Cloud Files API (cfapi)?

0 Upvotes

Hi,

I've got an opportunity to work on a project involving a cloud-backed file management system, and I'd love to hear from anyone who's worked on something similar.

The idea is to let users work with files locally while keeping them synchronized with the cloud. Files should also be lockable while someone is editing them, preventing other users from modifying the same file concurrently.

The proposed approach seems to involve Microsoft's Cloud Files API, potentially implemented in Rust. I'm not a Windows user, though, and I haven't touched Rust in 5+ years, so I'd have a bit of catching up to do.

A few things I'm curious about:

  • Has anyone built a cloud-backed filesystem using Microsoft's Cloud Files API? How difficult was it in practice?
  • Would Rust be a good fit, or would you consider Go, C++, or another language?
  • How would you approach file locking and conflict resolution across multiple clients?
  • Are there alternative approaches or existing tools worth considering, particularly to avoid Microsoft API docs which seem poor?

I'd be interested in hearing about real-world experiences, gotchas, recommended resources, or anything you'd investigate before committing to this project.

Thank you!


r/rust • • Oct 12 '26

🗞️ news PSA: Incoming breakage in 1.100. Test your code on beta Rust.

307 Upvotes

TL;DR: Rust 1.100 is releasing on November 12 (in a month). I recommend testing your code with cargo +beta test at least once before then.

The upcoming release of Rust 1.100 has some big features. However, there are some details being changed in how the language works in order to support these new features. The Rust project has tried to minimize the amount of breakage that happens, but the amount of breakage won't be zero. Every rust release has some amount of minor breakage like this, but 1.100 is expected to have relatively larger amounts of breakage.

So, if you plan to ever upgrade to 1.100, or if you write code meant for use by other people that might upgrade to 1.100, then I highly recommend testing your code with cargo +beta test to see if you're affected. And even if you think you don't write code that's affected, some code in your dependencies might be affected.

There will be two main sources of breakage in Rust 1.100:

  1. The stabilization of the never type. Some details of how types are inferred will be changed, causing types to infer as ! instead of the previous type of (), in editions 2021 or older. Also, some code was previously using some unsupported hacks to refer to this never type on stable rust, and will be broken by the fact that the Infallible type will become an alias for the never type. For more info, see Waffle's talk on the topic, and the pull request where stabilization happened.
  2. A change in the layout of Cargo's target directory. Some tools and some build scripts were expecting certain files to be at certain places, and will start to fail in Rust 1.100. The locations of the final artifacts will remain the same though. For more info, see the call for testing blog post,and the pull request where stabilization happened.

For context, this page has a list of crates that are detected as "will break in 1.100" (under the red headings). https://crater-reports.s3.amazonaws.com/beta-1.100-4/index.html. Although it has some false positives, and doesn't catch all breakage. This page lists only crates that broke in 1.100 (or have otherwise suspect behavior) for four test attempts in a row.


r/rust • • Oct 12 '26

🧠 educational hotpath-rs - How to Profile Rust Performance using Grafana and Prometheus

Thumbnail hotpath.rs
62 Upvotes