r_rustπŸ¦€
63 subscribers
744 photos
65 videos
37.8K links
Posts top submissions from the rust subreddit every hour.

Powered by: @reddit2telegram
Chat: @r_channels
Download Telegram
Drawing UI in rust is interesting

MacOS


Here is my simple landing page that using Rust \+ Wgpu and using WebGPU for rendering. first loading it would take some times.

https://aimer.cottonsofficial.com

https://redd.it/1uob6ap
@r_rust
insta snapshot testing and yaml failure

I'm working on a vb6 parsing library and I've just now started using some 'edge' tests, ie, source files which are just odd and weird and out of line. For example, I've got one module file that's almost 50k lines by itself. Now, the parser works great...chews through the file in less than 4ms. Wonderful! Except the insta snapshot crate takes literally *minutes* to produce a yaml file.

I need a real actual tree output so the `assert_debug_snapshot`, `assert_snapshot`, and `assert_compact_debug_snapshot` don't really work.

So, 'assert_yaml_snapshot` has been my only real option, but it's *slooooow* just, staggeringly slow and this added up, but with this new strange giant file it's just beyond too much.

Any suggestions?

https://redd.it/1uol9jr
@r_rust
Frame - Aesthetic FFmpeg GUI
https://redd.it/1uoqvof
@r_rust
maplike: Traits for abstract containers and operations on them

Hello!

I would like to share my crate, maplike. Maplike provides traits for common operations, .get(), .set(), .insert(), .remove(), .push(), .pop(), .into_iter() etc., over container data structures, such as std's Vec, BTreeMap, BTreeSet, HashMap, HashSet and for multiple third-party types, e.g. stable_vec::StableVec, thunderdome::Arena, tinyvec::ArrayVec, tinyvec::TinyVec.

Link: https://github.com/mikwielgus/maplike

I developed this library for myself to make it possible to write code that is generic over different collection-like data types. These types all have considerable similarities between their interfaces, but I couldn't find a suitable library with traits to abstract the shared behavior that I needed, so I rolled my own.

Basically, this is Python's collections.abc, but in Rust, and with traits not only for different kinds of containers, but also for each operation.

I maintain this library and dogfood it in my other two crates:

undoredo \- Undo/Redo and non-linear history tree using sparse deltas (diffs), snapshots, or commands on arbitrary data structures.

dcel \- half-edge data structure that is generic over its containers.

Feedback is welcome!

Below are two code examples taken from the readme:

First example. Function that gets the second element of a collection that is generic over `Vec`, array, `BTreeMap`:

use std::collections::BTreeMap;

use maplike::Get;

// Generic over any collection implementing the Get trait.
fn getsecondelement<C: Get<usize>>(collection: &C) -> Option<&C::Value> {
collection.get(&1)
}

// get_second_element() works for Vecs, arrays, and maps with the very
// same code.
asserteq!(getsecondelement(&vec![10, 20, 30]), Some(&20));
assert
eq!(getsecondelement(&10, 20, 30), Some(&20));
asserteq!(getsecondelement(&BTreeMap::from([(0, 10), (1, 20)])), Some(&20));use std::collections::BTreeMap;

Second example. Code that is generic over \`Vec\`, \`tinyvec::ArrayVec\`, \`tinyvec::TinyVec\`:

use maplike::{Clear, Push, Veclike};
use tinyvec::{ArrayVec, TinyVec};

// This function is generic over any `Veclike` collection. The `Veclike` bound
// provides `.clear()`, `.push()` and many other methods at once.
fn replace
all<C: Veclike<usize, Value = i32>>(collection: &mut C, values: &i32) {
collection.clear();
for &value in values {
collection.push(value);
}
}

// replace_all() now works for any Veclike collection.

// Works on Vec,
let mut vec = Vec::new();
replaceall(&mut vec, &[1, 2, 3]);
assert
eq!(vec, 1, 2, 3);
replaceall(&mut vec, &[4, 5, 6]);
assert
eq!(vec, 4, 5, 6);

// Works on tinyvec::ArrayVec.
let mut arrayvec: ArrayVec<[i32; 8]> = ArrayVec::new();
replace
all(&mut arrayvec, &[7, 8, 9]);
assert
eq!(arrayvec.asslice(), 7, 8, 9);

// Works on tinyvec::TinyVec.
let mut tinyvec: TinyVec<[i32; 8]> = TinyVec::new();
replace
all(&mut tinyvec, &[10, 11, 12]);
assert
eq!(tinyvec.asslice(), 10, 11, 12);use maplike::{Clear, Push, Veclike};

https://redd.it/1uoqccw
@r_rust
Is rust a complete web dev language?

Recently found out that rust can be used to write frontend as well as the backend. How is the state of the frontend in rust compared to JavaScript frameworks like react or vue? Is it practical to use for production apps? Is there big community supporting rust frontend?

https://redd.it/1uottji
@r_rust
Hey Rustaceans! Got a question? Ask here (28/2026)!

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.

https://redd.it/1uox0x9
@r_rust
What's everyone working on this week (28/2026)?

New week, new Rust! What are you folks up to? Answer here or over at rust-users!

https://redd.it/1uox270
@r_rust
Compiling Rust to JVM is now ~36x faster after a rewrite of stack map generation and more refactors to rustc_codegen_jvm! (context, repo links and script to reproduce in comments!)
https://redd.it/1uowc3f
@r_rust
Typescript to rust

Hey everyone!

I’d like to learn Rust properly and become comfortable writing it, rather than just vibe coding my way through projects. I’m looking for resources that help you actually understand the language and build things with it.
Since I come from a TypeScript background, I was wondering if there are any courses, books, or learning resources that explain Rust concepts in a way that’s easier for TypeScript developers to relate to, or point out the key differences and similarities.

Any recommendations would be greatly appreciated. Thanks in advance!

https://redd.it/1up21ob
@r_rust
Nevi v0.2.0 is out: a terminal editor in Rust built around Vim muscle memory

A few weeks ago, I shared Nevi here for the first time. It’s a terminal editor I’m building in Rust for people who want Vim/Neovim muscle memory, but with modern editor features like LSP, tree-sitter highlighting, fuzzy finding, themes, and project search built in by default.

I just released v0.2.0, which is the first version I feel more comfortable pointing people to.

What’s new since the first post:

\- Rendering is noticeably snappier. Nevi now repaints only the parts of the screen that changed in many common editing paths, with better handling for long lines and large files.

\- Go and Ruby language support.
\- More Vim/Neovim keybind parity, including ZZ, visual block insert/append, window movement/resizing, and normal-mode Enter behavior.
\- Labeled jump navigation with :Jump / <Space>j, similar in spirit to leap/flash-style movement.
\- Project-wide find and replace with a preview before applying changes.
\- nevi view, nevi diff, and nevi pick CLI modes.
\- Better :checkhealth reporting for config, keymaps, LSP/tool setup, and performance diagnostics.
\- A Vim oracle test harness and render regression tests to catch regressions earlier.
\- macOS/Linux CI and Homebrew install/update docs.

Install on macOS with Homebrew:

`brew install anthonyamaro15/nevi/nevi`

Repo: https://github.com/anthonyamaro15/nevi

Old post for more context: https://www.reddit.com/r/rust/comments/1u7qwbm/im\_building\_nevi\_a\_terminal\_editor\_in\_rust\_for/

It’s still early, but it’s getting closer to the editor I wanted: Vim-like editing without spending a bunch of time maintaining editor config.

If you try it, I’d especially love feedback on which Vim/Neovim keybinds or editing behaviors your hands expect that still don’t work yet.

https://redd.it/1uph0l2
@r_rust
Need help with AI anxiety

I know here ai posts are disliked but i really need help and just thoughts from more experienced people. I'm still a student with 2 years before graduation with great passion for systems programming especially operating systems and been learning them for a while now and of course, rust has been a joy to learn and use, but recently I just found myself unmotivated, I feel like, what if AI get much better than what it is now, with fable and that shit. and what if they focus more on optimizing that it start costing way cheaper, i feel lost, unmotivated, asking myself what's the point if all my skills and study time became worthless.. especially that i have adhd and i really love and hyperfocus on things that i love, and thinking about switching career feels like torture to me, not that i financially can but even if i could it would be miserable.. I just wish llms never existed.

https://redd.it/1upkllr
@r_rust
maudio - all you need audio in one (miniaudio)

For a while now I've been working on maudio and it's very close to a complete interface to miniaudio.

maudio

Miniaudio is a very large audio C library, mainly aimed at game engines, but has pretty much everything you would need for audio. I think discord also uses(used?) it.

Initially, I wanted wanted to only grow it enough so I can make my own audio app with it, but lost interest in that as this was pretty fun. Even found a null ptr dereference bug in miniaudio along the way.

Maudio is technically just ffi library, but it's offers a completely safe interface to the audio tools that miniaudio has, including custom nodes, custom data sources and data source chaining. I want to eventually also offer a safe(ish?) interface for custom backends as well. It's rather large now, but I did my best to document it and write examples, more to be added.

There is both a low and high level API. The high level API mostly centers around an Engine, which contains a node graph with nodes of various function, a low level device and a resource manager that can reference count loaded audio. This is the 'just play this sound' route.

The low level API uses the low level device directly which supports playback, capture, duplex and loopback.

There's also an encoder, decoder, mixing, many dsp primitives, pcm audio buffer / thread safe ring-buffer, noise, pulse and wave generators, device enumeration, backend selection, raw audio callbacks and some things that I forgot about.

Next on my todo list is to allow using a pre-compiled miniaudio binary, and maybe ship some optional pre-compiled binaries myself.

I also started drafting a version built on top where all types are Send + Sync and Clone (control thread + queue model), but that will likely be a separate crate as things got a bit out of control (see rustjerk)

I'd love to hear some thoughts if anyone has interest in audio.

https://redd.it/1uppdmg
@r_rust
OUROBOROS-UI: The shadcn/ui design language rebuilt natively for egui! With governance tests that fail the build if a raw value bypasses the tokens

Hi r/rust! I've been building an MMO authoring IDE in egui and needed a real design system for it β€” so I built one, and today I'm open-sourcing it.



What it is: the shadcn/ui design language (semantic tokens, zinc aesthetic, 4px scale) reimplemented natively for egui.

Not a web port 60+ components (atoms β†’ cells β†’ molecules β†’ organisms, plus a node-editor graph layer), all token-first.



The part I care most about: two governance tests run with cargo test and in CI:

- no_raw_values β€” a literal color, font size or spacing anywhere above the token layer fails the build

- no_painter_in_molecules β€” atoms are the only layer allowed to touch the painter



My take after years doing design systems at Dell/IBM: a design system only holds if the build enforces it. Conventions drift; compilers don't.

\- Live storybook (wasm): https://ouroboros-ui.typezerolabs.com/storybook/

\- Docs: https://ouroboros-ui.typezerolabs.com

\- Repo (MIT): https://github.com/Type-zero-labs/ouroboros-ui



API is pre-1.0 and evolving with the IDE. Feedback very welcome, especially from anyone who's fought egui theming at scale.

https://redd.it/1uptp3q
@r_rust