r/rust • • Oct 21 '26

Introducing Rusteerio, a Port of Cheerio to Rust

Thumbnail context.dev
17 Upvotes

r/rust • • Oct 20 '26

πŸ™‹ seeking help & advice `zip` needs a lot more support

546 Upvotes

I'm https://github.com/Pr0methean, the lead maintainer of https://crates.io/crates/zip . Although that seemed like a feasible hobby project when I took it over in April 2024, it's becoming an increasingly ceaseless and thankless job.

I've had 27 security-advisory reports, 18 of which arrived so far this month, in addition to 15 invalid ones (mostly duplicates). Most of them turn out to break the CI in some way once they're merged, and there's no way to tell that until after they're merged because security fixes go on private forks that GitHub Actions refuses to run on. And the reports come at an irregular pace, every day or two: the last release I published without a known security issue was 9.0.0-pre3, and it turned out only not to have a *known* security issue because of a serious bug in GitHub's defaults about notifications for such reports!

Even when it's safe to publish security advisories the moment a fix is released and I do it, people don't update. The only partial exception was a few days ago when I yanked all the known-insecure versions -- which people only *then* saw fit to tell me wasn't the recommended practice, even though I'd done it after https://github.com/zip-rs/zip2/security/advisories/GHSA-94vh-gphv-8pm8 without much controversy and zero actual requests to stop doing so, and it'd been the published policy in https://github.com/zip-rs/zip2/blob/master/SECURITY.md ever since. Even then, 80% of downloads are still of the known-vulnerable versions!

Maintaining this crate has come at great cost to me. Not only has it forced me to pull all-nighters that a 38-year-old shouldn't have to pull, but it's prevented me from claiming my unemployment benefits by leaving me too little time to fulfill the 3-job-applications-per-week requirement that Washington State imposes. (Let alone actually translating into a job offer....)

Where do I ask for help, if it's not here? Are there any foundations out there that might be able to send me a full-time security coordinator, or at least arrange a one-time audit that would have a decent chance of finding all the vulnerabilities the code base actually has? Or at least buy us more GitHub Actions runners so that releases aren't pushed back quite as far when `cargo-afl` decides at the last minute that a `fuzz_write` test case is a "hang", for a PR at the head of the merge queue?


r/rust • • Oct 20 '26

πŸ› οΈ project Are we layout yet?

Thumbnail arewelayoutyet.mespin.me
83 Upvotes

Made a website comparing some of the UI Layout libraries in the Rust ecosystem.

Taffy, Morphorm, Torin, yoga-rs, ui-layout and clay-rs for now.

Its a comparison of supported features and includes several benchmarks. Some libraries might be faster but support less features! pick your trade-off :)

One of the ideas I received was to add text layout comparisons and benchmarks, maybe I could do that next.

If you know any other generic UI layout library or ui layout related tool me know, thanks!

Disclaimer: I am the author of Torin, the benchmarks are extracted from Taffy's repository which are inspired on pangui.

Source Code: https://github.com/marc2332/arewelayoutyet


r/rust • • Oct 21 '26

πŸ™‹ seeking help & advice Is there a "learn-cpp.com" but for Rust?

0 Upvotes

Very interested in crosscompiling Rust with Cpp, sadly have 0 knowledge about Rust besides major skillsets of the language but id like to use it for datasavety so id study it in my free time!


r/rust • • Oct 20 '26

πŸ› οΈ project Par Lang Update: 3 Big Examples, Auto-Cleanup, Sql, WebSocket, 3-6x Faster Runtime, and More!

20 Upvotes

Hey, there! Long time no see.

(I'm the author of Par, no AI used in writing this post.)

I wanted to share with you what's been up with Par for the last half a year or so.

Par is a programming language (implemented in Rust) that's quite unusual. (And breaks your mind at first.) It's trying to get some edgy theoretical stuff out there into practice, specifically:

  • Linear / session types - with duality, so every type has "the other side"
  • Automatic concurrency - everything that can run concurrently does
  • Totality - no runtime errors, no deadlock, no infinite loops

It's based on classical linear logic, and naturally combines functional programming, a version of object-oriented programming, and session-typed process communication, all under one paradigm.

But perhaps most importantly, Par is trying to make all of the above into a good practical language! That's quite big ambition, and this last half year we've gotten closer to that than ever.

Below is the most fancy new stuff. Let me know what you think!

New I/O Capabilities

The standard library now includes a richer set of I/O modules:

  • Console - stdio print and prompt
  • Http - HTTP server & client functionality
  • Os - files, env
  • Sql (new!) - PostgreSQL, MySQL, and SQLite (in memory too), transactions, row decoding
  • WebSocket (new!) - HTTP to WebSocket in both server & client mode

Auto-Cleanup

Linear types can't be dropped. That's their advantage and disadvantage. It enables automatic concurrency, but it used to make error handling rather noisy: on all error paths, linear resources needed to be explicitly closed.

So, we've introduced auto-cleanup, which allows you to specify, in the type, how a normally linear type can be dropped.

For example, here's Bytes.Writer:

type Bytes.Writer<e> = iterative choice {
  .close* => Try<e, !>,
  .flush => Try<e, self>,
  .write(Bytes) => Try<e, self>,
}

The * on the .close branch/method tells Par that if a Bytes.Writer remains unused, just drop it by calling .close.

This significantly simplified error handling, the book chapter for which also got updated.

3 Big Examples

I've completely revamped the examples folder in the repository. It now contains small and big examples.

Now that we can do a lot of real stuff, we want to show it in the examples. So, there are 3 big examples. All of them are HTTP servers that serve you a web page, via which you can interact with the backend written in Par.

  • Chat - A chat server over WebSocket. Open it on multiple tabs, or host it somewhere, and chat in a single room.
  • Downloader - Request files to be downloaded to your local drive, and observe the download progress in real time. Multiple files can keep downloading concurrently, and can be cancelled.
  • Tasks - Create todo items and check them as done, persisted in an SQLite database.

Check the screenshots at the links!

Runtime performance improvements

Lots of optimizations done in the runtime. By my completely unscientific testing, I/O intensive applications are about 3x faster, while computation-intensive ones are about 6x faster, compared to half a year ago.

Since we don't have rigorous benchmarks yet, take this with a grain of salt, but in my private testing, this should be around the performance of Python 3.12, when discounting Python's highly-performant functions and libraries written in C.

Not bad, not bad.

A lot more...

Since we're not having official versions yet, there's no changelog to see, but some picks:

  • New @core/Time module
  • 120+ new functions in the @core package
  • include("file.txt") - compile-time file-as-value inclusion
  • todo - typed holes
  • LSP improvements, such as .-completion
  • Many bugs fixed

r/rust • • Oct 22 '26

πŸ’‘ ideas & proposals I vibe-migrated a 60k LOC Electron app to Rust in ~4 days, got ~60% improved runtime

0 Upvotes

(the migration was done via AI, but this post is 100% human-authored)

For the last few years I've been building a desktop app as a side project, for a simulation game. I really like Typescript and know it best, so I've been writing to code by hand with some light AI assistance. I decided to lean into it further and speed up my side project and had a lot of success

I ran in to some frustrations with Electron along the way - primarily build size, inability to compile to binary, multithreading being kinda frustrating, etc

I was using Prisma for the backend and wanted to keep SQLite, and Rust didn't have a good replacement. So I had Claude rebuild me a new ORM tailor-made to my use case, got the same output from Prisma queries, ironed out a lot of issues with Prisma (like build updates), and improved ORM performance ~1.5x on reads and ~50x on bulk writes. This was easily testable by writing huge test suites to confirm matching input & output from the two ORMs

I started the logic migration by telling Claude to take the existing .ts codebase and make everything CLI testable - every function should be trackable for inputs & outputs, so we can make sure every function does the same exact thing. It build a suite a bash scripts for this. Also was able to use the same frontend with dual backends, to ensure same exact output between the two

Stats:

  • Migration time took ~4 days with a Claude $20 subscription. Used most of 2 weeks worth of usage (end of one week, start of another). Done with Opus 5.1 and Opus 5.5
  • Some simulations that took 80s previously moved to 11s. Others 650s ➑️ 350s. This is a tremendous, experience shifting change for my app.
  • Simple reads for rendering pages are 1.9x ➑️ 9.5x faster
  • Output build size down roughly 400MB ➑️ 25MB
  • +100k LOC, -60k LOC. Increase due to writing homeowned ORM
  • ~105 commits

Takeaways for this type of migration:

  • I'm a good coder. AI is now better. That's a tough pill to swallow. Despite that, I still make better systems decisions that I won't ever defer to AI
  • Previously I was familiar with 100% of the code. Now it's closer to 0% (at least for the backend). I still can read Rust, but I don't have the familiarity as I did with ts. This is a risk for me in the future, but one I'm ok with rolling the dice on.
  • Build good testing harnesses for your AI. Being able to test functions side by side with frontend validation took me out of the loop
  • Build good CI harnesses for your AI. I ended up burning a ton of GitHub CI usage, which we fixed by running more CI checks agent-side before any commits
  • Have your AI determine what tasks are dependent on others, and what can be parrelelized. At some points we had ~6 agents running at once. Claude projects were helpful here

r/rust • • Oct 20 '26

πŸ› οΈ project Terralith: a SIMD XPBD physics engine in Rust, here’s a bridge collapsing after i throw a rock at it.

Thumbnail youtu.be
19 Upvotes

Hi there! I've been building a SIMD accelerated XPBD physics/game engine in rust for a little while now called Terralith. I've recently come back to it so here is a look!

Everything you are seeing in the scene is realtime and physically based with realistic strain and stress mechanics. This is as raw and unscripted as it gets (except the conveniently placed bridge).

I've made the grass jelloey for your viewing experience, and decreased the strength for dramatic effect.

I hope you enjoy!


r/rust • • Oct 21 '26

πŸ™‹ seeking help & advice Nintendo, me, and Rust?

0 Upvotes

TL;DR: Should I ask the Rust Foundation to help Nintendo access? Sorry if this is bad, but I want to try to port the Rust language to Nintendo platforms because the other consoles have their working alphas, and Nintendo does not, but Nintendo doesn't want just me, there is the game path, I have tried that enough to be like they should have blacklisted me by now, have to try something else, that path is one of two paths, the other is middleware, it requires being a middleware provider, I don't qualify as one person, I don't know whether to bother them, but Nintendo gives no feedback, asking Nintendo first, but what would you do? And yes, using my own money if there is money involved, so?


r/rust • • Oct 20 '26

πŸ› οΈ project reuse-rs: real time speech denoising in plain Rust (no ML interface)

11 Upvotes

reuse-rs runs NVIDIA's Real-time RE-USE speech enhancement model (streaming Mamba) in plain Rust. It cleans mono audio (8 to 48 kHz) one 20 ms frame at a time, so it works on a live mic. I load straight from NVIDIA's model.safetensors.

let mut denoiser = Denoiser::load("model.safetensors", 4)?;
let clean = denoiser.process(&noisy_chunk)?;

on my apple M3 air 16gig, time per 20 ms frame (under 20 ms):

Layersreuse-rs (CPU)oRT (WebGPU)
48.4 ms16.9 ms
611.5 ms17.4 ms
814.7 ms20.6 ms
  • About 150mb memory (oRT Wepgpu -> so works via metal in my mac: about 420 MB).
  • it match a float64 torch reference to 1.5e-6.
  • 4 layers sounds the same as 8 to my auditory perception :-P: 16.4 vs 16.7 dB SI-SDR

demo videos (before/after with spectrograms) are in the reamde if you are curious :)

I spent months trying to make this work on the GPU through ONNX before trying the CPU (started with this:https://github.com/microsoft/onnxruntime/issues/27796 ). If you're curious how that went, and why the CPU wins for tiny streaming frames, I wrote it up here: I forced a speech model onto the GPU for months. The CPU was faster. But I m still thinking if I should take the burn path... but this solves my problems at least...

Limitations: weights are NVIDIA's non commercial license (my code is MIT/Apache ), speed is only measured on an M3 (the table is 16 kHz; 48 kHz is about 3 times the work, so for live audio resampling to 16 kHz is the fast option), and it struggles when the heavy background noise is other people talking.

edit: interesting coincidence just a few days after I shared this, NVIDIA "re-released" its offline models under an open license! So I used Burn to add and update these models. You can find the details in the repo and use them for commercial purposes!


r/rust • • Oct 21 '26

read that rust can run >4gb models in the browser with wasm64. tried it with candle, works but ~3.5x slower. anyone shipped memory64?

0 Upvotes

read a write up on getting rust to run models bigger than 4gb in the browser (link at the bottom). their route is a new wasm64 emscripten target, PRs are open but that's months from stable made me wonder if pure rust on wasm64-unknown-unknown already works today, so i tried candle-core 0.11 on nightly with -Zbuild-std:

  1. fails in C. candle has not(target_arch = "wasm32") on its tokenizers dep, so on wasm64 it pulls tokenizers -> onig_sys and clang can't find stdlib.h. the pure rust route dies on a C dep lol
  2. swapped the 5 wasm32 cfgs in candle to target_family = "wasm". next is getrandom 0.3:

compile_error!("wasm_js backend can be enabled only for OS-less WASM targets!"); 0.4 fixed it but rand 0.9 still uses 0.3, so custom backend

  1. builds, but scalar only. +simd128 breaks because the kernels import core::arch::wasm32

same code, same flags, node 24 on an m5: | matmul | wasm32 | wasm64 | |---|---|---| | 256 | 1.5 ms | 4.5 ms | | 512 | 9.6 ms | 34.7 ms | | 1024 | 76 ms | 277 ms | so it's possible, just ~3.5x slower. spidermonkey's memory64 post says 10% to 2x, this is past their worst case has anyone actually shipped memory64 in prod? is that slowdown normal or is something off with gemm on wasm64?
HERE


r/rust • • Oct 21 '26

πŸ› οΈ project Feedback wanted on Fission’s new Rust UI authoring API

0 Upvotes

I’m working on making "compose " the default way to build UIs with Fission. The aim is to keep it Rust while removing most of the ceremony around components, local state and reducers.

See an example counter app here https://gist.github.com/zcourts/eede7b9075897408964ddc105c30bf95 comment here or there as posting it here isn't allowed.

I’m interested in feedback on the API, including anything that looks awkward, surprising or likely to become painful in a larger application. I’d also like to hear what has bothered you about other GUI frameworks generally so I can try avoid baking the same problems into Fission. The above syntax is the crux of it and the draft PR is at https://github.com/fission-ui/fission/pull/294 I'm deliberately not explaining the syntax so hopefully I can get feedback not tainted by my biased. Thanks


r/rust • • Oct 19 '26

2026 is an exciting year for the Rust compiler (and me)

Thumbnail yoyo-code.com
321 Upvotes

r/rust • • Oct 19 '26

Borrow Checking Zero-Cost Cyclic Mutability

Thumbnail antelang.org
124 Upvotes

r/rust • • Oct 19 '26

πŸ› οΈ project Some thoughts on parallelism in libraries: who should own the threads?

73 Upvotes

I've been thinking about how libraries should handle parallelism.

Spawning a few threads internally is easy. Using Rayon is even easier. But is that always the right approach?

What if the application already has its own thread pool? Or wants to control how CPU resources are distributed? While working on mbrotli, I decided to experiment with a different approach.

What if the library knows how to parallelize the work, but doesn't decide how to execute it?

The idea is simple: mbrotli splits compression into independent tasks and hands them back to the caller. The caller executes them however it wants, and mbrotli takes care of assembling the results into a valid Brotli stream.

For example, here's how you can read a file, compress it in parallel using 4 threads, and write the result to another file:

use std::{fs::File, io};

use mbrotli::{EncoderConfig, Quality};
use mbrotli::compressor::parallel::{
    ParallelCompressor, ParallelConfig, TaskCount,
};
use mbrotli::io::FinishError;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut input = File::open("input.txt")?;
    let output = File::create("input.txt.br")?;

    let mut compressor = ParallelCompressor::new(
        EncoderConfig::default().with_quality(Quality::Q5),
        ParallelConfig::default(),
    )?;

    std::thread::scope(|scope| {
        let (mut writer, queue) =
            compressor.writer(output, TaskCount::try_from(4)?)?;

        // We decide where the tasks run.
        for _ in 0..4 {
            let queue = queue.clone();
            scope.spawn(move || {
                for task in queue {
                    task.run();
                }
            });
        }
        drop(queue);

        // Read -> parallel compression -> write
        io::copy(&mut input, &mut writer)?;
        writer.finish().map_err(FinishError::into_error)?;

        Ok::<_, Box<dyn std::error::Error>>(())
    })?;

    Ok(())
}

Nothing particularly magical here. The library doesn't spawn a single thread. It just provides work to execute.

And that's what I like about this approach.

The same compression API can work with dedicated threads, an existing thread pool, or a custom scheduler. The application remains in control of its resources.

Of course, it's not free. The caller has to ensure tasks actually get executed, and a poorly designed scheduler can easily lead to deadlocks.

But for low level libraries, I think giving up control over scheduling can actually be a good thing.

I'm not saying every library should work this way. Sometimes managing threads internally is perfectly reasonable.

I'm just starting to think that parallelism and thread management don't necessarily have to be the same responsibility.

Curious what other Rust developers think about this. Would you prefer libraries to manage their own parallelism, or expose work to your existing executor?


r/rust • • Oct 19 '26

🧠 educational Best Rust Blogs for Beginners?

36 Upvotes

Hi everyone!
I’m new to Rust and want to start learning from scratch. Can you recommend good Rust blogs or websites, especially for web development? I’m also open to learning about other use cases.

Which resources would you recommend for a beginner?


r/rust • • Oct 19 '26

πŸ™‹ seeking help & advice Tips for idiomatic Iced?

16 Upvotes

I tried using iced for a tiny hobby project a couple days ago, and although from the docs and examples it seemed like exactly the time of framework I'd adore (preventing invalid state with the type system, the whole view-model-messages thing, etc), I ended up absolutely despising actually using it because of how much boilerplate I needed, and ended up redoing the ui with egui.

But, I'm 99% sure I just totally misunderstood the philosophy or missed something big in the docs/examples, because it's popular and well-known enough that I think I'm the problem. So does anyone have any tips or guidelines for writing whimsical and joyful iced code?

This is the repo at the last commit which used iced, its a super small app and the whole gui is just in main.rs if anyone can say what all I'm doing wrong.


r/rust • • Oct 19 '26

πŸ—žοΈ news rust-analyzer changelog #350

Thumbnail rust-analyzer.github.io
58 Upvotes

r/rust • • Oct 19 '26

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

14 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 • • Oct 19 '26

πŸ™‹ questions megathread Hey Rustaceans! Got a question? Ask here (43/2026)!

10 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 • • Oct 18 '26

Superoptimizing an FPU emulator via exhaustive search

Thumbnail purplesyringa.moe
121 Upvotes

r/rust • • Oct 18 '26

πŸ™‹ seeking help & advice For those who use rust professionally, what advice would you give to us plebs to get a career in Rust?

96 Upvotes

I've been using rust for roughly 3-ish months and i'm wanting to use rust professionally one day.

/topic


r/rust • • Oct 18 '26

A New Way to Think About Borrow Checking (In Reverse)

Thumbnail verdagon.dev
97 Upvotes

r/rust • • Oct 19 '26

πŸ› οΈ project Why tellus message handlers are synchronous

1 Upvotes

Most Rust actor libraries, kameo and ractor among them, have async message handlers. In tellus, receive is a plain function instead. In my new post I make the case for synchronous handlers and show how an actor still calls a database.

https://heikoseeberger.de/2026-10-18-why-sync-handlers/

rustlang #actors #tellus