r/rust • • 14m ago

🛠️ project Phai Studio: a drag-and-drop designer and IDE for Windows desktop apps in Rust

Post image
0 Upvotes

I've been building Phai Studio, an IDE for making Windows programs in Rust. You lay out a form by dragging controls onto it, double-click one to get its event handler, write Rust, and press F5.

Full disclosure: most of the code was written with an AI assistant. I designed it, tested it and decided what goes in. That's partly why I'm posting: I'm still learning Rust myself, and I'd love people who know it better to look at what came out.

What's in it

  • A form designer with 40+ controls: buttons, text boxes, a data grid, tree and list views, charts, a calendar, menus, toolbars and a web view. Forms are a plain TOML file (.phf), and the generated _ui.rs is ordinary Rust you can read.

  • An editor built on rust-analyzer: completion, hover docs, go to definition, rename, plus a debugger, a test runner and Git.

  • Data: MySQL/MariaDB (its own wire-protocol client), PostgreSQL and SQLite, with tables bound to the grid and saves in one transaction.

  • Publish: makes a setup.exe and a portable folder. Release builds remap local paths (project, ~/.cargo, rustup, the home folder), so the exe you hand out doesn't carry C:\Users\<you>\... in panic locations.

  • Web: the same forms can run as a web app/PWA on a phone.

  • The UI is native Win32 + GDI+, not a web view. It runs in English or Thai.

Licence: the runtime libraries that go into your programs (phai-ui, phai-data, phai-web) are MIT, and what you build is yours. The IDE itself is source-available under PolyForm Perimeter, free to use, including for programs you sell.

Windows 10/11 only for now. Feedback very welcome, especially on the generated code and the phai-ui API.


r/rust • • 54m ago

Optimizing rustc's next trail solver

Thumbnail donsz.nl
16 Upvotes

The next rust trait solver, a large subsystem of the rust compiler that we've been trying to replace, will finally land in rust 1.102.0. In the last stages, before stabilizing it, its performance was a major blocker. But what is "a trait solver"? And why is its performance a problem? My goal for this blog post is to answer those questions in a way where you don't need any prior knowledge. I think discussions of the trait solver can quickly become quite involved, and daunting. So here, we'll start from the very basics!

This is a writeup of my eurorust 2026 talk of the same name, that I gave on October 15, 2026


r/rust • • 2h ago

🛠️ project Run Hermes’s terminal and file tools on your own sandbox cloud with Flame

Post image
0 Upvotes

We’ve updated hermes-flamepy so Hermes can use remote Flame sandboxes through its standard terminal and file tools. Set terminal.backend: flamepy—there’s no separate toolset for the model to learn.

Hermes stays on your laptop or controller, while commands execute in gVisor sandboxes on Linux workers you operate. While a sandbox stays open, files, installed packages, working directories, and exported shell variables remain available across tool calls.

flame-cluster handles deployment, worker enrollment, and a console for inspecting workers, sessions, executors, and task progress.

A few reasons we built this on Flame:

  • Shared worker capacity: Run independent agent environments across a pool of machines.

  • Low execution latency: Earlier in-cluster SDK tests measured 8.56 ms median for trivial shell commands in a warm sandbox.

  • Small worker footprint: FEM, the worker manager, used about 17.3 MiB RSS on each of two idle workers.

  • Support for other agents: Flame’s APIs and language support also make it possible to build integrations beyond Hermes.

One limitation to know: suspend/resume currently preserves the session ID but starts with fresh files and shell state. Local project files also need to be transferred explicitly.

We’ve written a walkthrough with setup instructions, architecture, live console screenshots, and measurement details:

https://xflops.io/blog/build-your-own-sandbox-cloud-with-flame/

Would this fit your Hermes workflow? We’d be interested in which capabilities matter most—project sync, durable workspaces, or something else.


r/rust • • 3h ago

🗞️ news CVE-2026-124851 in the Zstandard decoder, and why mzstd is not affected

Thumbnail
m-compressors.github.io
12 Upvotes

r/rust • • 3h ago

🛠️ project A new name for ntpd-rs: Statime - Trifecta Tech Foundation

Thumbnail
trifectatech.org
12 Upvotes

Interestingly this has nothing to do with https://fr.wikipedia.org/wiki/Jason_Statham


r/rust • • 3h ago

🧠 educational Miscompilation in Rust 1.97

29 Upvotes

I reported a miscompilation in Rust 1.97 back in July. In this presentation, I went through the details of the bug and the investigation as it unfolded in the Zulip chat with the Rust team, and shared my takeaways and conclusions.

https://youtu.be/-dNsUB7QRk4

Edit: link to the Zulip chat #t-compiler > Miscompilation in 1.97.0 with new Option::None discrimi... @ 💬


r/rust • • 6h ago

🙋 seeking help & advice Anything I should know before I start learning Rust?

0 Upvotes

I've know moderate amount of javascript for a while and have been thinking about learning another language. I have decided upon rust for a variety of reasons (mainly so I can say I rewrote it in rust.)

What things should I know before I start? And, are there any features of this language I might want to know about?


r/rust • • 7h ago

🛠️ project Shipping a ~30k-line Rust/wgpu drawing engine inside an Expo (React Native) app: write-up

0 Upvotes

I wrote up how we run a Rust/wgpu engine (about 30k lines) inside an Expo / React Native app. The app is Doodraw, a drawing app where every stroke wiggles live as you draw it (the hand-drawn "boiling line" look, no timeline or keyframes):

https://expo.dev/blog/doodraw-rust-gpu-engine-expo-config-plugin-100k-installs

Some Rust-side context, since the post is written for an Expo audience:

  • The engine owns the canvas as a native view. React Native only drives tools, layers and UI, and talks to the engine through thin Swift and Kotlin native modules (including MP4 export). The crate builds to an XCFramework for iOS and native libs for Android.

  • The wiggle happens inside the brush at render time, so strokes stay alive while you keep drawing instead of being baked into frames.

  • The same core compiles to WebAssembly and draws through WebGPU for the Windows build (a Tauri 2 shell), so wgpu gives us one renderer across iOS, Android and desktop.

  • The ios/ and android/ folders aren't in git. An Expo config plugin copies the prebuilt engine and bridge files at prebuild and fails fast if a binary is missing, instead of letting Xcode fail half an hour later.

What was hard: keeping rendering consistent across Android GPU drivers (still the part that bites us most), and keeping the native boundary small enough that upgrading Expo / React Native stays a version bump plus a prebuild.

Happy to answer questions about the FFI boundary or the wgpu setup.


r/rust • • 15h ago

Rust game site | WASM | Game engine

0 Upvotes

Hi everyone,

I've spent a while building a web based Rust game engine. Here is the link https://rust-game-app-b5nt8.ondigitalocean.app/

I use a ECS-like implementation for the engine and I use github actions to compile each of the games to WASM.

Let me know if you guys have feedback and if I get some love I'll make a tutorial / breakdown.


r/rust • • 16h ago

How we got GPUI into the browser

Thumbnail
youtu.be
10 Upvotes

Anyone watched this yet?


r/rust • • 18h ago

📸 media How I made my app 100x faster with Rust (and dropped bundle size from 180MB to 2.8MB)

Post image
0 Upvotes

Hey everyone,

I wanted to share a post-mortem and benchmark breakdown of rewriting my Windows camera studio application (LumaShot Pro) from Electron to pure Rust.

The Problem with the Electron Version

The app does live camera framing, zoom, color grading, HDR bracketing, and video capture. In Electron:

  • The packaged .msix was ~180MB because it carried full Chromium and Node.js binaries.

  • Launching the app consumed 400MB–500MB of memory before the user even snapped a photo.

  • On battery, running a 4K feed through Electron caused laptops to spin their fans almost immediately.

The New Architecture: Pure Rust (wry + tao)

Instead of bundling another copy of Chromium, Windows 10/11 already ships with an evergreen Edge WebView2 runtime. We rebuilt the app from scratch in Rust:

  • tao: Cross-platform window creation and event loop handling.

  • wry: Native WebView2 host bindings with full permission handling (PermissionKind::Camera, PermissionKind::Microphone).

  • Zero-copy Custom Protocol (snapcam://localhost/): Static assets (HTML, CSS, JS, Super HD JPEG backdrops) are embedded into the compiled binary via include_bytes! at compile time and served through memory with zero disk I/O.

  • Compiler Optimization: Built with lto = true, opt-level = 3, codegen-units = 1, and strip = true.

The Numbers (Before vs After)

MetricElectron (Old)Pure Rust (New)Delta
Binary / Package Size182 MB2.84 MB-98.4%
Idle Memory (RAM)~460 MB~32 MB14x less RAM
Cold Start Time~3.8 seconds~110 msNear instant
Video Recording CPU28% – 34%6% – 9%4x cooler

New Features Added During the Rewrite

  • Real-Time Super HD AI Virtual Backgrounds: Photorealistic 1080p virtual studio environments (Studio Office, Neon Cyberpunk, Library, Bokeh blur) composited in real-time.

  • Studio Audio Sync: Unified MediaStream merging canvas video tracks with active microphone audio (hardware echo cancellation & AGC).

  • 120 FPS Export Engine: GPU compositor animations (will-change: transform, box-shadow) with instant HUD toast feedback.

Microsoft Store Link

It just went live as an official update on the Windows Store: 🔗 Store Link: https://apps.microsoft.com/detail/9NDCJLBR4VV0?hl=en-us&gl=IN&ocid=pdpshare

Happy to answer any questions about the WebView2 integration, MSIX packaging with makeappx, or packaging Rust apps for the Microsoft Store!


r/rust • • 22h ago

How do you cope with ecosystem immaturity?

0 Upvotes

I'm loving the lang so far, but most crates are early 0.x versions. Do they lack functionality, have bugs? I am talking about even basic things like HTTP client.

Is Rust community driven, do some big names do drive its growth? Does ecosystem immaturity limit you?


r/rust • • 1d ago

🧠 educational Axum with David Pedersen (Netstack.FM S02E2)

27 Upvotes

Hi all, we just released a new episode of our podcast Netstack.FM with David Pedersen (u/davidpdrsn), creator of Axum.

Some of the topics:

  • How Axum started at Embark Studios, and why it was built Tower-first

  • How Bevy's system parameters inspired Axum's extractors

  • Why Axum avoids macros so other frameworks can build on top of it

  • How #[debug_handler] produces clearer type errors at zero runtime cost

  • Tower 1.0, poll_ready, and why boxed futures make single-threaded Axum hard today

  • Keeping Axum's API small, and splitting crates like axum-core

Listen here: https://netstack.fm/episodes/axum-with-david-pedersen

It's also on the usual podcast platforms, and the website has a manually edited transcript. Feedback is welcome.


For those who do not know Netstack.FM yet: it's a podcast about networking, Rust, and everything in between. With the main objective to teach and demystify Network Programming and Protocols, usually within the Rust ecosystem but not always.


r/rust • • 1d ago

🛠️ project GlueSQL v0.21 - Now supports SlateDB and SQLite as storage backends

Thumbnail
github.com
7 Upvotes

r/rust • • 1d ago

Where have you found the Rust type-state pattern actually pays off versus turning into annoying boilerplate?

33 Upvotes

We recently built an internal order-processing pipeline in Rust, and early on I got excited about encoding every step of a job's lifecycle as separate structs using the type-state pattern so invalid transitions would fail at compile time.

In practice it caught two genuine bugs during the first week, then turned into a lot of friction whenever business requirements shifted slightly. Adding one optional verification step meant updating generic trait bounds across half the module, and writing wrapper boiler plate just to store mixed states inside a single queue felt clunky compared to a straightforward enum with an explicit transition function.

For folks maintaining medium or large production codebases, where do you draw the line between encoding state transitions in the type system versus keeping them as regular runtime enums?


r/rust • • 1d ago

How to Stop Generic Type Explosion in Rust

Thumbnail
edvong.com
0 Upvotes

r/rust • • 1d ago

🛠️ project Rust Glancer 0.5.0: Matching rust-analyzer performance

Thumbnail rust-glancer.github.io
155 Upvotes

r/rust • • 1d ago

Optimizing rustc's Next Trait Solver - Jana Dönszelmann | EuroRust 2026

Thumbnail
youtube.com
46 Upvotes

A new video is out on YouTube! At this year's EuroRust, Jana from the Rust Compiler Team gave a talk on optimizing rustc’s next trait solver, which is being stabilized this year. Spoiler alert: the real gains weren’t in micro-optimizations, but at the algorithmic level! 🦀

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


r/rust • • 1d ago

Project Skymetal: Incrementally porting Bazel from Java to Rust

Thumbnail
reddit.com
10 Upvotes

While Cargo is the traditional build system in Rust, we've had a good time switching to Bazel at my work. It does caching better: it can limit the cache size in terms of age and total size and it can even use a remote cache across all developers in the company.

I also enjoy knowing that my Rust crates that use a C compiler use the same version across all machines.

Now there is a project called Skymetal to port the Bazel build system itself from Java to Rust. I don't know anything about the state, but I wish them luck!


r/rust • • 1d ago

The State of Allocators in 2026 - Finally Stabilised!

Thumbnail cetra3.github.io
194 Upvotes

r/rust • • 1d ago

RUST ABI

23 Upvotes

What is current state of stable Rust ABI? Or progress? As I want to load generate library crate (rlib) in offline library and I do not need load crateio library.


r/rust • • 1d ago

🛠️ project Handling timeout cancellation in a Rust client for the iPhone display service

0 Upvotes

My iPhone input tool (iph) opens an audio stream through com.apple.coredevice.displayservice so the phone will accept taps. When I added screen recording, the input session and the recorder started sharing that service. The idevice crate only had one way to stop streaming: stopAll, which ends every session's streams on the phone at once.

The phone also accepts a list of individual streams to stop (stopAll: false, with each stream's RemoteSSRC in identifiers). On iOS 27.2, stopping the recorder's video by its RemoteSSRC left the input audio running, and taps still worked. Sending those XPC requests directly over RemoteXpcClient brought up a separate issue: what happens to the connection when a call times out mid-reply.

Both callers wrap MediaControl calls in tokio::time::timeout:

  • If no video datagram arrives for more than 2.5 seconds (a still screen can stay silent that long), the recorder checks whether the phone still lists its stream, with a 2-second timeout on status().

  • Shutting a session down wraps stop_session() in a 5-second timeout.

MediaControl sends one request at a time and reads the next message on the reply channel. If a call times out after its request has been queued, the phone can still reply. Keeping link: Link directly in MediaControl and reusing the connection would let the next call take that reply as its own.

Instead, MediaControl holds link: Option<Link> and moves it out of self before touching the wire:

pub struct MediaControl {
    adapter: AdapterHandle,
    rsd: RsdHandshake,
    link: Option<Link>,
}

impl MediaControl {
    async fn invoke(
        &mut self,
        feature: &str,
        input: Dictionary,
        action: Option<&str>,
    ) -> Result<plist::Value> {
        let mut link = match self.link.take() {
            Some(link) => link,
            None => self.open_link().await?,
        };
        link.0
            .send_object(request(feature, input, action), true)
            .await
            .map_err(|e| anyhow!("{e:?}"))?;
        let res = link.0.recv().await.map_err(|e| anyhow!("{e:?}"))?;
        self.link = Some(link);
        output(res)
    }
}

Holding link inside the future makes drop-on-cancel do the cleanup automatically:

  • If a timeout cancels invoke after self.link.take() and before the link is put back, self.link stays None, and any link the future owns drops with it. The same happens on any Err from send_object or recv (including framing or decode errors). There is no separate poisoned: bool flag to forget to check.

  • self.link = Some(link) runs before output(res). Once recv returns a decoded plist, a CoreDevice.error inside it still means the wire framing stayed in sync, so the connection is put back and reused.

In the recorder's liveness check (VideoStream::gone), letting invoke reconnect lazily inside the 2-second status() timeout could let a slow reconnect burn the whole status budget. Calling relink() first (a no-op while self.link is Some) gives the RSD connect and XPC handshake their own 5-second timeout:

let running = async {
    bounded("display service", 5, self.media.relink()).await?;
    let status = bounded("status", 2, self.media.status()).await?;
    Ok(!media::streams_of(&status, &self.session_id.to_string()).is_empty())
};

Here bounded wraps tokio::time::timeout. The first check that finds no matching stream ends the recording. If reconnecting or fetching status fails, it takes three failed checks in a row.

On the phone side, if stop_own times out or the daemon is hit with kill -9, an unstopped stream keeps encoding until its RTCP timeout (an hour in a kill -9 test). While the phone lists streams, stop_session checks whether ours have disappeared, and if they persist it can return an error. It tries stopAll only if no other streams are listed. A missing sessions array also triggers stopAll, and if the next status reply still omits the list, that counts as success. Until stop_own returns Ok, a small marker file on disk keeps each client session UUID so later runs can retry stopping leftovers.

The full MediaControl implementation and tests are in src/device/media.rs.


r/rust • • 1d ago

🗞️ news GPUI is getting its own repo!

Thumbnail
github.com
419 Upvotes

r/rust • • 1d ago

I need a file picker for Desktop UI app

1 Upvotes

I was wondering someone knows if any of the various Desktop UI Frameworks for Rust have a build in (or add on) file / directory picker? I'm mostly interested in Iced at the moment, but I would go with any framework that has a file picker. It's the only complicated component that I need (beyond text and buttons), and building it would be much more work than all of the rest of my very simple app.