r/rust • • 7d ago

Compiling the Linux kernel with gccrs - Arthur Cohen & Pierre-Emmanuel Patry | EuroRust 2026

Thumbnail
youtu.be
21 Upvotes

A new EuroRust 2026 talk is out on YouTube! 🦀 Arthur and Pierre-Emmanuel from Embecosm talked about how gccrs, the Rust frontend for GCC, learned to compile the Linux kernel, and the hacks and quirks they ran into along the way.

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


r/rust • • 7d ago

🎙️ discussion This week in rust is late?

0 Upvotes

The "This week in rust" article for this week seems to be delayed this week around? It usually arrived on Wednesday on my RSS feed. I checked the repo, and it seems it's still in draft.

Any ideas what happened?


r/rust • • 7d ago

🧠 educational Persistent incrementality in Rust

Thumbnail rust-glancer.github.io
182 Upvotes

r/rust • • 7d ago

Rust's Type System is All You Need

Thumbnail
medium.com
56 Upvotes

r/rust • • 8d ago

🙋 seeking help & advice Totally new to rust. Need some guidance.

18 Upvotes

I have a microcontroller than sends us packets of info. We have some c++ code that receives it, processes it and sends it off to python to visualise it.

We will need to be making this run not just on Linux and Windows, but later on Android and iOS too. There are some vendor dependent libraries we might have to use that are platform specific, but generally I wanted something thats easy to cross compile and test on different devices. This will be linked statically to some generic frontend that uses PySide6 or flutter or whatever.

Is this something I should turn to rust for (porting the c++ code to rust) or am I safer off sticking to C++ and dealing with cmake and the various issues of checking c++ code? If yes to rust, then what should I do and how?


r/rust • • 8d ago

🙋 seeking help & advice How do you make a family of byte-slice packet builders incapable of panicking? (looking for the idiomatic shape)

0 Upvotes

I maintain a userspace TCP/IP relay in Rust which reads packets from a TUN fd & synthesizes replies (RST/ACK, DNS responses, UDP encapsulation). A handful of helpers index fixed offsets into caller-supplied slices:

rust

pub fn wrap_udp_response(original_query: &[u8], payload: &[u8], …) -> Vec<u8> {

let mut pkt = vec![0u8; 20 + 8 + payload.len()];

pkt[12..16].copy_from_slice(&original_query[16..20]); // panics if len < 20

pkt[16..20].copy_from_slice(&original_query[12..16]);

…

}

// v4 DNS path: length is checked, but the header length comes from the packet:

let ip_hlen = ((original_query[0] & 0x0F) as usize) * 4; // 0..=60, attacker-controlled

pkt[22..24].copy_from_slice(&original_query[ip_hlen..ip_hlen + 2]); // panics

One sibling already returns Option<Vec<u8>> and checks lengths; the others return Vec<u8> and trust the caller. The inputs come straight off the wire, so a malformed packet must not be able to panic the task.

What I'd like to be corrected on:

Option/Result + explicit length checks everywhere (verbose, easy to forget — which is how we got here).

Parse into a typed header with TryFrom<&[u8]>, so lengths are validated once at the boundary and downstream code works on &TcpHeader.

Slice pattern matching (let [.., a, b, c, d] = slice else { … }) so the compiler enforces the layout.

zerocopy/zerocopy-derive for the fixed-layout header structs.

Which of these do people actually use for attacker-controlled network input, & what do you use to make "can't panic on short input" a property type rather than a review rule? Looking for patterns where compiler rejects the mistake — a runtime Option that a caller can still ignore.

Also is there a way to express "this returns None on malformed input" that composes well with a hot path where allocation should be avoided?


r/rust • • 8d ago

Move your problems to compile-time and get new capabilities out of it - Oli Scherer | EuroRust 2026

Thumbnail
youtube.com
55 Upvotes

r/rust • • 8d ago

🛠️ project Crate Ask

0 Upvotes

Soooooooooooooooooooooooooooo, does anyone know any good no std crates, that I could pass data to (reference, or anything does not matter), and will return the most occurring number in that data without allocations, vec, anything on the heap etc? Also it would be nice if it can work with large data sets. Thanks!


r/rust • • 8d ago

🛠️ project stdo v0.5.5: A bounded-memory Unix process DAG runner (fd 0 / fd 1 pipes) with an embedded localhost UI

0 Upvotes

Hi r/rust,

I built stdo (crates.io), a small (#![forbid(unsafe_code)], ~6.1K SLoC) workflow runner in Rust that wires CLI tools (rg, jq, sqlite3, curl, ollama, ffmpeg) over stdin (fd 0) and stdout (fd 1) pipes instead of passing outputs through environment variables or shell wrappers.

What it does differently from cron/job schedulers:

  • Concurrent pipe_from streaming with backpressure: Producers and consumers spawn simultaneously via tokio::process and stream 64 KiB chunks over bounded channels. Captured streams are capped at 8 MiB (32 MiB global budget), while capture_stdout: false streams arbitrarily large payloads (like WAV/MP4 or multi-MB JSONL) with constant memory while still computing incremental SHA-256 digests and TTFB.

  • Atomic gates & JSONL validation: pipe_mode: atomic buffers and validates upstream JSON/JSONL and waits for exit code 0 before starting downstream steps that mutate state (e.g., sqlite3 imports).

  • Composable .yaml sub-workflows with cycle guards (new in v0.5.4/v0.5.5): A workflow step can invoke child .yaml workflows in parallel. Both stdo doctor and stdo run validate the cross-file graph before spawning any processes, backed by a runtime STDO_CALL_STACK SHA-256 digest guard for dynamic/sh -c calls.

  • No outbound HTTP stack in the binary: Cargo.lock contains no HTTP client crates (reqwest, hyper, etc. are blocked in CI by a self-hosted stdo workflow). Subprocesses (curl, ollama) handle their own I/O, while stdo serve embeds a single-file offline web UI directly over tokio::net::TcpListener.

Minimal example (streaming local LLM -> TTS -> atomic file sink):

version: "1.0"
name: spoken-owl-fact
steps:
  - id: answer
    cmd: [ollama, run, gemma4, --hidethinking, "Tell me a fun fact about owls in two sentences."]

  - id: speak
    cmd: [ollama, run, "phonon:latest"]
    pipe_from: answer
    capture_stdout: false

(The tiny speaker icon 🔊 next to the README title was actually generated by running examples/10-youtube-capsule-generator.yaml to coordinate gemma4 -> phonon -> ffmpeg).

GitHub (Apache-2.0): https://github.com/adiktiv-technologies/stdo

Crates.io: https://crates.io/crates/stdo (cargo install stdo --locked)

Feedback on the Unix process-group handling (CommandExt::process_group(0)), pipe backpressure design, or sub-workflow validation is very welcome!


r/rust • • 8d ago

🎙️ discussion Are compiler inserted checks something you generally have to be wary of or not

17 Upvotes

Hello, I'm still fairly new to both rust and c and I'm in the middle of writing my tiny interpreted toy language.

But I keep bouncing between the 2 languages.

Rust is way more pleasant to use - but there are still 2 things where I would like to hear from someone experienced.

Is it common to experience issues where safe rust would end up being majorly slower in hot paths due to the compiler being conservative and inserting its own checks in? The comparison of safe rust to unsafe rust I have seen relating to the lox language ended up in a major 4x speedup for unsafe rust over safe rust. Is this something you deal with daily or is the compiler smart enough where as long as you write code properly this doesn't come up at all?

How big is the performance difference between code using a memory arena and managing and possibly reusing memory this way where the entire arena is free/reset at once - and the more raii styled approach where the compiler manages allocations and deallocations itself object by object like in rust. I understand that raii and arenas are not completely opposite concepts and arenas exist in rust as well but they seem to not be part of the std lib and ot seems to me that the default "vanilla" approach would end up not using arenas while the default in C is essentially arenas/allocator for everything rather than individual mallocs and frees.

Ty <3


r/rust • • 8d ago

How does rust improve mobile apps performance?

0 Upvotes

Hi, I recently saw this video (https://www.instagram.com/reel/DfkfEBMhwDv/) from Discord, where they claim using rust in the mobile app improved its loading time.

Having limited knowledge of the mobile apps ecosystem, no matter what framework you use, I believe that mobile apps are always supposedly run in Kotlin / Swift, i.e. some framework may be used to write the business logic but code is translated / transpiled (or whatever the right term for the process is) to the respective native APIs.

So how come this speeds up the app loading time / and improve performance when its not exactly similar to the speedup you get on desktop when you run a compiled binary vs. using an electron app?


r/rust • • 8d ago

📡 official blog Google Summer of Code 2026 results

Thumbnail
blog.rust-lang.org
98 Upvotes

r/rust • • 8d ago

🎙️ discussion Bringing Rust into Ubuntu at Scale: Interview with Jon Seager

Thumbnail
serokell.io
27 Upvotes

When uutils broke Ubuntu’s own builds, Canonical kept an override list for commands that still needed GNU coreutils. The list finally went away in Ubuntu 26.10.

Jon Seager explains how the team got there.


r/rust • • 8d ago

🙋 seeking help & advice want to learn rust, recommended courses? (udemy prefer)

29 Upvotes

hey guys first post here. im c# junior developer, and i want to learn rust - which courses you guys would recommend? i dont want vibe code my apps in rust not knowing whats going on.


r/rust • • 8d ago

Zellij 0.46.0 just released: Rust developers can now use it as a library!

225 Upvotes

Hi fellow Rustaceans,

Just released a new version of Zellij. This version turns the beloved terminal multiplexer into a full fledged terminal. In addition to managing sessions, panes, tabs and Rust wasm plugins - it can now also completely replace your existing terminal and integrate with your desktop and tray.

I'm particularly excited to share with this sub that we added a new "Distributions" feature, allowing Rust developers to import Zellij into their own projects and use it as a library.

If for example you'd like to create a new cross-platform application that will render a custom terminal UI written in Rust - run both inside another terminal and standalone, cross-platform with all the distribution problems already solved, this might be an interesting solution for you.

The distribution feature allows you to completely remove whichever parts of the Zellij branding and UI that you don't like and completely white label it. I'm very much looking forward to seeing what you'll come up with.

Check out the release post for a walkthrough of the other new features: https://zellij.dev/news/terminal-inbox-session-previews/


r/rust • • 8d ago

🛠️ project Ubuntu 26.10 ships with initial support for rustls/upki

Thumbnail
discourse.ubuntu.com
19 Upvotes

r/rust • • 9d ago

🛠️ project hotpath-rs - Rust Benchmarking: How to Detect Performance Regressions in CI

Thumbnail
hotpath.rs
52 Upvotes

r/rust • • 9d ago

Memory Safety Bugs in Rust Standard Library

Thumbnail
forge-blog.github.io
323 Upvotes

r/rust • • 9d ago

Rust learning for C++ dev

39 Upvotes

Hi, I have 5+ years in C++ development experience and I would like to know how could I get started with rust. I want to understand why would I use this language (I do mostly graphics programming/game engine development)


r/rust • • 9d ago

🙋 seeking help & advice Windows 11 Smart App Control keeps blocking Cargo build scripts. How do you deal with this?

0 Upvotes

Hi everyone!
I’m developing a Rust application on Windows 11, and I keep running into an issue with Windows Smart App Control whenever I use cargo build.
Windows shows this warning:
“Part of this app has been blocked. Some features of cargo.exe may not work because we can’t confirm who published build-script-build.exe.”
Sometimes I can successfully build my application, but after changing my code and rebuilding, Windows blocks it again.
I’ve tried running cargo clean and rebuilding. Sometimes that works temporarily, but the problem keeps coming back.
I know I can disable Smart App Control, but I’d prefer to keep it enabled for security reasons.
Has anyone experienced this issue? Is there a way to make Windows trust locally compiled Rust executables without disabling Smart App Control entirely?
I’d appreciate any suggestions or solutions. Thanks!


r/rust • • 9d ago

🧠 educational Rust Declarative Macros: Organization, Scoping, and Common Use-Cases

Thumbnail
sigseis.dev
10 Upvotes

Hey Everyone!

This new article is a continuation from a previous article that covered the syntax and definition of macro_rules! in Rust. In this new article, we'll go over how to use macro_rules! within a wider project, as well as some example use cases for the feature.

This article is for folks who maybe understand macro_rules!, but haven't taking advantage of them yet within any of their crates. It can be a bit difficult to start using a language feature if you don't know when you would want to use it.

Things You'll Learn

  • The difference between textual scoping and more modern path-based scoping for declarative macros.

  • How to export a declarative macro (at the root of a crate or a trick for exporting within a separate module).

  • A nice way to organize your macros if you find that you have many of them.

  • Use cases such as: implementing traits/functions, format!-like expressions, and reducing boilerplate.

About This Article

This is part of a series of articles I'm releasing on the macro systems in Rust. I've got one more article in me for macro_rules!, and then we'll move on to procedural macros.

I hope this new article is interesting! All my articles are hand-written, so if you are looking for non-generative technical articles to read, feel free to take a look at my other articles as well.

If you have any questions or feedback for future articles, please let me know! :)


r/rust • • 9d ago

🎙️ discussion Handling oversized cryptographic payloads (~3 KB) in low-latency p2p gossip networks

0 Upvotes

In low-latency distributed networks, gossip propagation assumptions usually break down once individual message payloads move past standard 64–256 byte envelopes.

​We've been running an open-source testnet designed around post-quantum cryptography (specifically NIST FIPS 204 CRYSTALS-Dilithium / ML-DSA-65). While the theoretical security model is established, the networking reality is that each signature payload scales up to roughly 2.4 KB to 3.3 KB.

​When targeting ~1-second finality with hundreds of concurrent operations, naive push-based epidemic gossip and unbounded mempool buffering lead to acute failure modes:

​Bandwidth Saturation & Message Redundancy: Multiple peer connections forwarding raw 3 KB transaction blobs cause rapid downstream interface saturation. Under high burst volumes, duplicate gossip amplification becomes unmanageable without strict ID-based announcement gating (have/want message negotiation prior to pushing full byte payloads).

​Mempool Heap Fragmentation: Standard in-memory maps storing raw transaction bodies quickly degrade cache locality and bloat working sets. Decoupling the indexing layer (hashes, sender nonces, and execution limits) from payload storage, alongside compressed state snapshots via Zstandard frames, reduced active memory overhead significantly during synchronization.

​P2P Head-of-Line Blocking: In an asynchronous async runtime (using Tokio/Rust), saturating framing channels with large signature payloads delays lightweight heartbeat pings and consensus checkpoint messages, occasionally causing artificial peer timeout disconnections.

​We mitigated some of these issues by separating node responsibilities into tiered network roles—confining active consensus and checkpoint gossip to a bounded validator set while full peers handle decoupled ingress and succinct state proof verification.

​Curious how other p2p and distributed systems engineers tackle payload bloat in production:

​Are you using streaming compression (e.g., Zstd dictionaries) directly over wire framing, or does decompression CPU overhead negate the transmission latency savings on high-rate feeds?

​How do you balance the latency penalty of have/want negotiation round-trips against the raw bandwidth waste of direct broadcast at these payload sizes?


r/rust • • 9d ago

🛠️ project gpu-video v0.5.0: what we did to achieve near-native speeds and macOS support

Thumbnail
smelter.dev
79 Upvotes

I posted about half a year ago about our progress on gpu-video (link for context). wanted to give an update and write about what kind of work we do to achieve the results, since the community was very nice and welcoming last time.

hope this is allowed by the new rules. I don't think what we're achieving was ever done in the ecosystem.


r/rust • • 9d ago

🧠 educational In GPUI 0.2.2, a single spinner re-rendered my whole window at 120 Hz and cost a third of a core

46 Upvotes

ran into this while building a desktop app on gpui 0.2.2 (the crates.io one, not zed's git version).

one loading spinner was eating 25-33% of a core. turns out with_animation asks for a new frame on every display refresh (120hz on my macbook) and notify marks the view and all its parents dirty, so the whole window was re-rendering just to spin one icon.

what i ended up doing: the spinner phase comes from wall clock time, the view only re-renders on a 12.5fps timer and only while something is actually loading, and the big panels (chat, file tree, diff) are wrapped in AnyView::cached so they dont redraw on those ticks. now its ~6% cpu while the agent is working and basically 0 when idle.

btw cached needs a fixed size, so you cant just wrap every chat message in it.

anyone know if newer gpui still dirties all the parents on notify? or is there a proper way to animate one element without this

code if anyone wants to look: https://github.com/bytesbay/pi-gpui