r/rust
Why does Rust require many dependency packages unlike Go when building a project?
I am wondering if Rust follows NPM ecosystem crisis in the future. In Go ecosystem promotes use std as far as possible but only minimum external dependencies when building a project. But Rust ecosystem promote lightweight std but too much external insecure dependencies.
What makes you try out a new crate?
I've mostly "cargo add" crates that solved a specific problem for me. I wanted to try out different crates more proactively. It got me asking, what makes me reach for one vs. scroll past. Good rustdoc/doc is the obvious one to me. But not sure, what I should actually check beyond that..
What makes you try out a new crate? And do you know a few underrated ones you think more people should know about?
Announcing the Scientific Computing in Rust virtual workshop 2026
scientificcomputing.rsGoofy, cartoonish, open-source multiplayer shooter written in Rust with Bevy 👻
This is not a serious project; I just wanted to experiment with Bevy. 😄 It's the first game I've ever created, so I'm interested in learning about the aspects I could improve.
https://github.com/NiiightmareXD/golab
Are these books worth it?
I don't know any of these books, so I am not sure if getting the bundle is worth it.
NOTE: Not affiliated with any of the authors/publishers etc.
Charton: A columnar-native plotting library for Rust (Polars-friendly)
Charton is a columnar-native plotting library designed to keep memory layouts as close to Apache Arrow as possible, allowing for near-zero-copy integration.
Here’s the core of how it handles data:
pub enum ColumnVector {
Boolean { data: Vec<bool>, validity: Option<Vec<u8>> },
Int8 { data: Vec<i8>, validity: Option<Vec<u8>> },
// ... handles all int/float types
String { data: Vec<String>, validity: Option<Vec<u8>> },
Categorical { keys: Vec<u32>, values: Vec<String>, validity: Option<Vec<u8>> },
Datetime { data: Vec<i64>, validity: Option<Vec<u8>>, timezone: Option<String> },
}
// ... other types
And the Dataset structure ensures alignment:
pub struct Dataset {
schema: AHashMap<String, usize>,
columns: Vec<Arc<ColumnVector>>,
row_count: usize,
}
The load_polars_df! macro is ready to use, and the Altair-style declarative API makes building layered charts intuitively.
The roadmap is to go full native Arrow and eventually integrate DataFusion for a "SQL-to-chart" workflow. It’s still early days, so if you’re doing data analysis in Rust, I’d love to get your thoughts or feedback on the API.
psleep - a drop-in replacement for sleep with a progress bar with OSC 9;4 on supported terminals
Tired of running `sleep 30` and staring at a blank terminal? here is psleep, it works exactly like sleep but shows you how much time is left.
https://i.redd.it/axeicrslrf2h1.gif
- Drop-in compatible:
psleep 30,psleep 1m30s,psleep 2h5m - Multiple styles (bar, blocks, dots, emoji, spinner)
- Native terminal progress (OSC 9;4) for supported terminals, progress shows in your tab bar
​
# Homebrew (macOS)
brew install Yesh-02/tap/psleep
# From crates.io
cargo install psleep
GitHub: https://github.com/Yesh-02/psleep
Note: This software's code is partially AI-generated.
How does Rust abort in no_std ?
Hi,
in no_std Rust, how does Rust enforce it's safety exactly ?
Because in traditional Rust, after a runtime safety violation is detected say like an out of bounds, panic! is called.
But in no std there's no panic!.
so how does the process actually guarantee it would exit and therefore enforce the safety rules set by the language? is no_std actually less secure than std ?
I thought from my understanding, that Rust calls a function which in turns runs an invalid CPU instruction which is supposed to crash the program (almost) always. Which is not a guaranteed neither, and the link even agrees:
"The precise behavior is not guaranteed and not stable."
So sometime, when that behavior is not guaranteed, some critical Rust features would not take effect!?
https://doc.rust-lang.org/core/intrinsics/fn.abort.html
But, again, from that link, I see it's a nightly-only feature, so how does current Rust compiler actually enforce the safety?
Thanks.
RMUX: native terminal multiplexer in Rust (Linux/macOS/Windows) with a programmable SDK
I've spent the last few months building RMUX, a terminal multiplexer written from scratch in Rust.
What it is
A tmux-compatible multiplexer with about 90 command snapshots covered in the docs, plus a second surface: a typed async Rust SDK talking to the same local daemon. Many tmux-style workflows, keybindings, and scripts should feel familiar, but RMUX also exposes structured automation primitives instead of only terminal text scraping.
Architecture
- One local daemon and one wire protocol behind the public surfaces: a tmux-style CLI, a typed SDK, and a ratatui integration crate.
- Native PTY/runtime handling per platform: Unix PTYs + Unix domain sockets on Linux/macOS, real ConPTY + Named Pipes on Windows. No WSL required. Getting ConPTY to behave was one of the hardest parts. And Tokio for async ofc
- The SDK exposes typed handles for `Session` / `Window` / `Pane`, with stable pane IDs, structured snapshots, output streams, and locator-style waits.
Example:
pane.get_by_text("Ready").wait_for().await?;
pane.keyboard().type_text("hello").await?;
pane.wait_for_load_state(TerminalLoadState::Quiet).await?;
pane.expect_visible_text().to_contain("hello").await?;
The public SDK/protocol/render crates use `#![forbid(unsafe_code)]`; unsafe code is isolated in the low-level platform crates that need OS/PTY/IPC FFI.
Why I built it
I've been using tmux for a long time and grew tired of having to do grep every now and since. I then thought that adding playwright capabilities and rewriting everything in Rust would be a game changer. I hope you will like it :) You can do so much: ci, agents orchestration, testing TUIs, building custom dashboards... and it includes natively ratatui.
Repo: https://github.com/Helvesec/rmux
Docs + demos: https://rmux.io
Install: cargo install rmux --locked
It's a v0.2 preview. Very open to feedback on the architecture, the async API design, or how I'm handling ConPTY. Happy to answer anything.
Caramelo, an ergonomic unit testing framework
Yesterday I released the first beta version of caramelo, a unit testing framework.
Pretty much inspired on Hamcrest, but it also has some fun assertion traits included.
On upcoming versions we will have included many more matchers, traits and macros to make unit testing fun like ever before.
Repo link: https://github.com/ararog/caramelo
Note: Named after the most famous and popular brazilian dog.
Not an AI slope.
How to benchmark Rust instruction counts with Gungraun
Learn how to benchmark instruction counts using Gungraun (formerly Iai-Callgrind). In noisy CI environments, instruction counts can be a useful companion to wall-clock time benchmarks. Bencher also supports on-demand bare metal runners, so you can see if a change in instruction counts also meant a change in actual performance.
lazydiff — a terminal-native diff reviewer with semantic diffs, persistent notes, and 60fps rendering
When I need to review a lot of ai generated code or code in general, I either open a browser tab and lose my context, or pipe it through git diff and scroll through a wall of red and green that forgets everything the moment I close it. No way to leave notes, no way to jump between files, no way to come back later and pick up where I left off.
So I built lazydiff. The core idea was simple, a diff reviewer that lives in the terminal, remembers state, and actually understands code structure.
The first decision was rendering. I went with ratatui and virtualized scrolling, only the visible rows get drawn each frame. This matters because agent-generated diffs can be massive. The benchmark fixture I test against is an 11k-line Node.js PR diff, and it renders at 60fps with sub-2ms frame times. I didn't want to build something that felt sluggish on real-world diffs.
For syntax highlighting I use tree-sitter(a thing I have been loving for so long now), but the tricky part with diffs is that deleted code needs to be highlighted in its original language context, not just painted red. So lazydiff reconstructs both sides of the file independently and maps highlights back through the diff. Inline diffs tokenize each changed line pair and run LCS to show exactly which words changed, you immediately see the meaningful difference without scanning the whole line.
The part I'm most excited about is semantic diffs. lazydiff uses https://github.com/Ataraxy-Labs/sem, which I open-sourced separately and got a lot of love from the Rust community. Instead of just showing line by line level diffs, it parses changes into semantically meaningful entity graphs for functions added, methods modified, classes moved. You see the structure of your changes and how they connect to each other. This is the same engine behind https://github.com/Ataraxy-Labs/weave, the semantic merge driver I built
The agent workflow is what motivated the whole project. You can leave threaded comments anchored to exact lines questions, instructions, notes and review quite fast, which was the utmost desire of the community. Agents also read them via lazydiff agent list and reply via CLI. The whole review session persists to SQLite locally, so you can close the terminal, come back the next day, and everything is exactly where you left it.
License:MIT Licensed
Open Source Repo: https://github.com/Ataraxy-Labs/lazydiff
New crate announcement: agp (actual good printing), because default map debug formatting shouldn't be a nightmare to work with
ever struggled with the pain of {:?} on hashmaps? sure, i guess {:#?} is a bit better, but all it does is just not make it a one-line blob.
agp (actual good printing) has come to save you!
agp is a lightweight, zero-dependency crate designed to make quick terminal debugging of collections readable without the intense vertical bloat of {:#?} or the unreadable wall-of-text of {:?}.
examples
use std::collections::HashMap;
use agp::ActualGoodPrinting;
fn main() {
let mut map = HashMap::new();
map.insert("status", "ok");
map.insert("code", "200");
map.agp();
// output (order may vary):
// status: ok
// code: 200
}
to return it, do the same but swap .agp() for .return_agp():
use std::collections::HashMap;
use agp::ActualGoodPrinting;
fn main() {
let mut map = HashMap::new();
map.insert("status", "ok");
map.insert("code", "200");
let good_map = map.return_agp();
println!("{good_map}");
}
how to implement your own agp
use agp::ActualGoodPrinting;
use std::collections::BTreeMap;
use std::fmt::Display;
use std::fmt::Write;
impl<K, V> ActualGoodPrinting for BTreeMap<K, V> // replace this with your own
where:
K: Display + Ord,
V: Display,
{
fn agp(&self) {
for (k, v) in self {
println!("{k}: {v}");
}
}
fn return_agp(&self) -> String {
let mut result = String::with_capacity(self.len() * 32);
for (k, v) in self {
writeln!(result, "{k}: {v}").unwrap();
}
result
}
}
pls do not impl for HashMap or Vec tho, as we already have that ([T] for vec and standard arrays)
Show : harumi — pure Rust PDF library with automatic CJK font subsetting, zero C dependencies
The Rust PDF ecosystem has a gap: lopdf is low-level with no font subsetting, printpdf only creates new PDFs, and anything with real CJK support tends to pull in C/C++ bindings that break WASM and Lambda deployments.
I built harumi to fill that gap.
What it does:
- Edits existing PDFs (append-only; original structure is preserved)
- Embeds CJK fonts with automatic subsetting — you call one function, it handles the full pipeline at
save()time: glyph collection, TTF subsetting, GID remapping, ToUnicode CMap generation, CIDFont object graph - Invisible text layers for searchable/OCR PDFs (Tesseract/hOCR coordinate converters included)
- Merge, split, rotate, reorder pages
- JPEG/PNG embedding (PNG transparency via SMask)
- In-memory output via
save_to_bytes() - WASM compatible — pure Rust, zero C deps
Quick example:
let mut doc = Document::from_file("scanned.pdf")?;
let font = doc.embed_font(include_bytes!("NotoSansCJK-Regular.ttf"))?;
doc.page(1)?.add_invisible_text(
"This text will be searchable",
font,
[72.0, 700.0],
12.0,
)?;
doc.save("searchable.pdf")?;
Dependencies: lopdf (PDF object graph), allsorts (TTF subsetting), ttf-parser (font metadata). No C, no bindgen.
Verified with Noto Sans CJK for Japanese, Simplified Chinese, Traditional Chinese, and Korean.
GitHub: https://github.com/kent-tokyo/harumi crates.io: https://crates.io/crates/harumi
Happy to answer questions about the font pipeline or the CJK subsetting approach specifically.
Interactive Matrix Visualiser, written in Rust
This is a project to visualise and evaluate matrix transformations / expressions involving 2x2 matrices, 2D vectors, and floats, such as multiplication, inversing, scaling, addition, determinant, dot product and more.
I've had intuition for this kind of thing for a long time, but never really got the chance to share it with people, so I thought as one of my first bigger rust projects, why not give it a go? And then I realised I could put it on a website and share it with everyone else without them having to download an executable, so I compiled it for WASM.
I'd love to see what others think of this and what they might want to add, so contributions, issues and any feedback is completely welcome!
Phonto - GPU-accelerated live wallpapers for Wayland and macOS, written in Rust
I've been using mpv-paper on Hyprland for a couple months but ran into really high CPU usage, so I decided to write my own solution.
Phonto uses GStreamer and EGL to keep the entire decoding and rendering pipeline on the GPU, making much better use of resources compared to CPU-based approaches.
A friend also jumped in and added MacOS support, including playing live wallpapers on the lock screen which was a nice bonus.
Still missing a few things like multi-monitor support but that's coming soon. Other feature requests and contributions are welcome!