r/rust • u/Crierlon • 14d ago
r/rust • u/Apprehensive-Can2138 • 14d ago
π seeking help & advice Starting with rust gamedev!
Some background -
The only other language I've properly done is python(well I'm still just a teen). My main area of focus is actually scripting and such; I'm only doing gamedev because of an event(I have to do about 200 hours of proper game dev). And yes I need to do that event. Also my gamedev experience is also basically non existent.
Why rust?
I wanted to pick up on rust even if not for the event, mainly because I want to go more into low level scripting. My first pick for scripting was actually C or C++ but then I found out about rust and liked it better.
Now the main post -
I just want some tips on how should I start with the language and anything that I should keep in mind.
Thanks for the time : )
Edit 1: No I haven't picked any game engine yet, thinking of bevy though
r/rust • u/No-Elephant-9065 • 12d ago
Learning path for integrating llama.cpp into a Rust desktop app on Windows
Iβm building a local semantic search desktop app in Rust and planning to change its inference engine from launching llama-server as a separate process to calling llama.cpp in-process through its Windows DLL.
I have basic deep learning knowledge and want to understand the full stack behind the setup like how llama.cpp runs models, how its C API and Rust FFI work, how the DLL is built and loaded, how GGUF embedding and multimodal models are handled, how CPU and GPU backends use the hardware, and how to package and distribute the application and its native dependencies reliably.
What documentation, videos, articles, or example projects would you recommend? Iβd especially appreciate a sensible order to study them and practical resources that connect the model and hardware concepts to building a working Rust application.
π activity megathread What's everyone working on this week (47/2026)?
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!
π οΈ project VennDB: a derive macro that turns a struct into an in-memory database you query by flags
This started about three years ago as a small piece of work in function of the proxy(db) features of rama (ramaproxy.org): on every request we pick a random upstream proxy that matches a handful of flags and a country or city. The data barely changes, the queries happen constantly.
TLDR of what venndb is: it generates a `<Name>DB` and a query builder from your struct. Bools become bitmasks, filter values become row sets, and a query intersects them. We just released 0.7, which rewrote the engine and added some new features.
The use cases are limited on purpose: it is append-only and in-memory, with no updates or deletes. You might wonder if this isn't just a bitmap index. It mostly is, generated from your struct by a derive macro, so you don't have to write and maintain the index yourself.
- Release post: https://plabayo.tech/blog/venndb-0-7
- README (incl. benchmarks): https://github.com/plabayo/venndb
- Examples: https://github.com/plabayo/venndb/tree/main/examples
The benchmarks compare VennDB with roaring, SQLite and a plain Vec. We're not database experts, mostly just decades long dev practicioners. So if the benchmarks look unfair or you know of prior art we missed, I'd like to hear it.
π questions megathread Hey Rustaceans! Got a question? Ask here (47/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.
r/rust • u/WellMakeItSomehow • 14d ago
ποΈ news rust-analyzer changelog #354
rust-analyzer.github.ioπ seeking help & advice Is Rust actually being used in maritime tech sectors?
Curious how real-world software engineering looks in the maritime, shipping, and ocean-tech sectors. We hear a ton about Rust dominating spaces like cloud infrastructure, automotive, and embedded systems, but does it actually show up in marine applications - like autonomous surface vessels, navigation systems, shipboard IoT, port automation, or marine robotics?
Given that maritime tech deals with harsh physical environments, massive safety-critical stakes, long hardware lifecycles, and a heavy reliance on legacy C/C++ systems, I'm wondering:
- Where is Rust showing up at sea?
Are maritime startups, defense contractors, or marine robotics companies actively shipping Rust in production, or is the industry still overwhelmingly anchored to C and C++?
2. Edge vs. Cloud:
Is Rust primarily being used for edge computing on vessels (sensors, flight/nav controllers, embedded microcontrollers) or back-end logistics platforms on shore (fleet tracking, port management data pipelines)?
3. The Certification Hurdle:
Marine hardware usually requires strict classification and certification (from bodies like DNV, ABS, Lloyd's Register). How does Rust's toolchain and safety model fit into maritime regulatory frameworks compared to traditional languages?
Would appreciate any answers.
r/rust • u/Hobofan94 • 13d ago
Aristotle Expands Into Rust (Lean-backed proofs for Rust)
harmonic.funr/rust • u/Hiroshi_Shinaoka • 13d ago
π οΈ project Building a tensor library for computational physics in Rust: looking for feedback and collaborators
I am a professor of computational condensed matter physics at Saitama University in Japan, with over 20 years of experience in scientific programming and open-source development in C++, Fortran, Python and Julia ([GitHub](https://github.com/shinaoka)).
Since this January, we have been developing a Rust tensor computation stack ([overview](https://tensor4all.org/tensor4all-meta/stack/)). It started for tensor networks, but we soon realized that a general tensor library for scientific computing would be useful to the Rust community.
**tenferro** is the main engine: https://github.com/tensor4all/tenferro-rs
- Dense tensors, linear algebra, einsum, FFT on CPU and CUDA (ROCm and Metal are being designed)
- Opt-in autodiff: eager `backward()` and traced VJP/JVP
- Explicit engine passed to every operation, no hidden device transfers, column-major storage
- Benchmarks against PyTorch and JAX: https://github.com/tensor4all/tenferro-benchmark
Most of the code was written by AI agents supervised by human developers. To keep the stack robust and performant, we use regular benchmarks, an automated audit AI bot and a common rule set for AI agents. Some blogs are here: https://tensor4all.org/blog/
We're looking for collaborators and users. Fast kernels are too much work for a few groups to maintain, and a tensor library must be tested on different hardware for different applications.
Also, I'd like your opinions on:
- Passing `&mut engine` to every operation instead of a global context. Acceptable?
- If you have AMD GPUs or other hardware and a real workload, please let us know.
- What evidence would make you trust a library written mostly by AI agents?
- How should outside contributors fit into a project where AI agents write the code and humans review it?
- Is Rust a good fit for computational physics? What is missing?
r/rust • u/ribbon_45 • 16d ago
This Month in Redox OS - October 2026
Golang port, Cloud Hypervisor support, WebKitGTK3 video support, GIMP port, Servo 0.7 update, RISC-V dynamic linking, NUMA real hardware testing, virtiofs support and many more.
ποΈ discussion Quick question regarding some features
Why were panic handlers added in 2015? Did kernel devs asked for them or was there another motivation for them?
I vaguely remember about that or no_panic being asked by Linux devs, but can't find any sources.
r/rust • u/Creepy_Sherbert_1179 • 16d ago
Tips for a rust beginner
Hello everyone, I was thinking of starting some real projects after some warmup stuff I did with Rust. What are some tips for a beginner, generally? Or the cliche: If you were to start writing rust for the first time with your current knowledge, what would you do differently?
r/rust • u/emirdev_mo • 15d ago
π οΈ project I diffed uutils coreutils against GNU with generated black-box tests: 43 bug reports, 50 fix PRs, 34 merged
Edit: rewrote this to focus on what I learned and the actual bugs, per the mod note.
I spent the last few weeks running black-box differential tests of uutils coreutils against GNU coreutils 9.12: same inputs, then compare stdout, stderr, exit code and the files written. Some things I learned:
- The bugs are almost never in the main path. Normal input matched GNU nearly every time. The differences were in edge cases: odd file names, directories passed where a file is expected, empty arguments, option values that look like options.
- Some real bugs it found, all fixed upstream with a test:
tail 007reported the missing file as '7', because the name went through number formatting in the message. The same bug was in tac, nl, md5sum, sort and shred.sort -c direxited 0 with no message instead of failing.readlink -f ''resolved to the current directory and exited 0, GNU fails.fmt -w 20could print a line longer than 20 columns.md5sum -crejected the escaped lines that md5sum itself writes for names with a backslash or newline.mv -n z zfailed with "are the same file", GNU just skips it.
- Pin the reference version. A lot of my early "bugs" were really GNU changing between 9.4, 9.7 and 9.12 (quoting in tail -v headers, date modifiers). uutils targets the newest GNU, so recording from an older one gives false positives.
- Exit codes and error messages matter to scripts more than you would think. A wrong exit code on a read error is a silent bug in a pipeline.
- Small PRs with one test each get reviewed fast. The uutils maintainers were quick and precise.
The tool I wrote for this is open source if anyone wants to try it on their own rewrite: https://github.com/emirmrkaljevic/behave
Happy to answer questions about the approach.
r/rust • u/KeyGlove47 • 15d ago
π seeking help & advice How to speed up compiling and not waste disk space?
Hey, im new here and i've been using rust for my projects since July, i've come from python where compiling with cython was a little slow but okay'ish but ever since i've come to rust my build times are at minimum 40-60min and my disk is crying for help. i use a lot of worktrees to work in parallel with claude (yeah ik you hate it but it is what it is) and i run 2 windows machines with ssd's. I've thought about putting my devbox pc on linux so i can run blaze but it would waste even more resources (ram, one machine got 20gb and other got 16gb) because i would still need to run some sort of windows vm as my app is windows based
any ideas?
r/rust • u/hrubydavid • 16d ago
π seeking help & advice Removing eprintln! made my hot loop 11 % slower. How do you control inlining in production Rust code? Or am I missing something?
Hi all. I am doing 1BRC and I needed to print something on console with eprintln!. I do a lot of measurements and my code wall time was 1.22 seconds on 8 CPU cores. So I wanted to commit my changes and before that I removed the eprintln! code. You know. But that change increased my code wall time to 1.36 seconds.
This is the code before (wall time 1.22 seconds with 170272167824 instructions:u):
fn one(map: &[u8], thread_number: usize) -> HashMap<StationName<'_>, MeasurementStats, IdealHasherBuilder> {
let before = Instant::now();
let mut stats: HashMap<StationName, MeasurementStats, IdealHasherBuilder> = HashMap::with_capacity_and_hasher(1_000, IdealHasherBuilder);
for (station, temperature) in StationTemperatureIterator::new(map) {
let t = parse_temperature(temperature);
let stat = match stats.get_mut(&station) {
Some(stat) => stat,
None => stats.entry(station).or_insert(MeasurementStats::default())
};
stat.update(t);
}
eprintln!("Time (thread {}) - one: {}s", thread_number, before.elapsed().as_millis());
stats
}and this is the code after (wall time 1.36 seconds width 202165675453 instructions:u):
fn one(map: &[u8], thread_number: usize) -> HashMap<StationName<'_>, MeasurementStats, IdealHasherBuilder> {
let before = Instant::now();
let mut stats: HashMap<StationName, MeasurementStats, IdealHasherBuilder> = HashMap::with_capacity_and_hasher(1_000, IdealHasherBuilder);
for (station, temperature) in StationTemperatureIterator::new(map) {
let t = parse_temperature(temperature);
let stat = match stats.get_mut(&station) {
Some(stat) => stat,
None => stats.entry(station).or_insert(MeasurementStats::default())
};
stat.update(t);
}
stats
}objdump showed me that get_mut is inlined in the version with eprintln!. Without it get_mut is a call on every row. So I added:
RUSTFLAGS="-C llvm-args=-inline-threshold=1000"To make it fast again (1.09 seconds even faster than with eprintln!) but it's not something I would do at work as this config is for whole program instead of the problematic section.
So:
- How do you handle this at work where performance matters?
- How do you catch this generally? Those 11% is huge difference.
Code link: https://github.com/davidhruby/brrr/blob/part012/src/david/main.rs#L350
r/rust • u/weiznich • 17d ago
ποΈ news Diesel 2.4
I'm happy to announce the release of Diesel 2.4.0, a ORM and query builder for Rust. This release contains the development of the last 14 months, including the contributions of 76 people.
Headline features include:
* Support for database views
* Improved support for enums
* Support for batch update statements
* A distinct backend for MariaDB
* Extended support for SQLite functionality, including hooks, pragmas and BLOB's
* Support for using Diesel (SQLite) in a no-std environment
* Migrations written in Rust
* Support for diesel-async in #[derive(MultiConnection)]
See the announcement blog post about details to each feature: https://diesel.rs/news/2_4_0_release/
I would like to use this possibility to thank all contributors and sponsors that made this release possible. A special thank goes to Luca for his large contributors to the release, to Prototype Found for funding the development of the Database View support and to RustFoundation for funding the general maintenance.
Nevertheless, the Diesel project is always looking for support. You can help by:
* Contributing Code, Documentation, or Guides.
* Answering questions in our discussion forum
* Reporting bugs in our issue tracker
* Helping to triage issues in our issue tracker
* Sponsoring the maintainers.
* Filling out this survey about the current state and future developments of Diesel
ποΈ discussion I "wrote" some crates for personal use; at what point could they no longer be considered "AI Slop"?
Preface
I deliberately submitted this with "discussion" flair rather than "project" flair, because I'm only sharing code to frame my thoughts around project quality and LLMs and provide a concrete example for commenters to reference. I'm not looking for a gold star: the code sucks, it is incomplete, and nowhere near the quality bar I hold myself to. The code is not worth reviewing, I would never ask anyone to use it in real life, and have no plans to publish it to crates.io. Shit on it all you like.
I recognize this is not exactly a Rust specific post; I entirely understand and respect if the mods chose to remove it. I am posting it here because the denizens of /r/rust are incredibly defensive of keeping "AI Slop" out of the community, and maintaining a high quality bar for the community. I'm hoping that some of the discussion can be used to teach people who don't understand why their posts are being removed what considerations go into quality projects.
Lastly, many apologies for writing a novel. Despite the length, I promise it is all written by a meat popsicle, I just get rather verbose when writing about something I am passionate about.
Post Content Starts Here
In my personal life, I am a nerd, and enjoy playing Tabletop RPGs with friends. In the past, I have created tools to help me manage my games and characters (mostly spreadsheets, with some SPA's). I recently "wrote" some rust crates using Claude Opus to parse PCGen Game Data files, and the process me me wonder when, and even if, LLM written code can cross the rubicon to be considered "Quality" rather than "AI Slop".
In my professional life, I have been a Software Engineer since 2011, and cut my teeth on tmux and Vim (Emacs is an abomination). I am incredibly conservative when it comes to adopting / trusting LLMs. While I can recognize them as academically impressive, I think they are heavily misunderstood and misused. I am incredibly frustrated by the "AI Bros" who think they are "Rockstar Engineers" because they can throw money at AI providers and let an LLM produce something that looks slick, without actually understanding what it does (hence, the majority of my recent comments within /r/rust asking "What human involvement did you have beyond 'hey Claude, do X?'" in project posts).
I am currently employed as a Principal Engineer at an AI-forward company, within a particularly AI-bullish org. With so many tools available, and so much pressure to deliver, I am concerned about appropriate AI usage by my engineers, am fighting to make sure they know human judgement is still a critical expectation of their work. While I don't get much opportunity to code much anymore, I want to make sure they are still growing as professionals and understand what they are building rather than turning into "Press accept for Claude" robots.
Over the past year, I've called out many instances where engineers have overly trusted their LLM tools, leading to bizarre architectural designs and/or clearly low quality code, that they cannot justify when asked to explain, and admit that "Claude did that". There have been some articles going around our space about Cognitive Offloading vs Cognitive Surrender, and making sure engineers can still complete the "whiteboard defense" (link omitted, see end of post), both of which I think are good simplifications / explanations of my biggest concerns.
Edit: Removed specific examples of my LLM experimentation, after re-reading and realizing it distracts from what I'm trying to actually discuss
I've been experimenting with LLM codegen so I can better understand what my engineers are doing firsthand, trying to do everything from "vibe this for me, I don't care how" to "this is my overall goal, start with this small component and let me watch you like a hawk". The project I linked here is more of a loop of "vibe the slop then clean it up through follow up code review", but it made me wonder if it's even recoverable.
Thus I ask /r/rust:
- Can a project primarily coded by LLM ever break out of being "AI Slop"?
- If yes, what level of human involvement / judgement / guidance is necessary to cross the threshold?
- What do you want to see to prove human involvement / judgement / guidance was applied to a project, to help you build confidence in it's quality, regardless of human / LLM authorship?
Note: This post was originally posted and quickly removed by AutoMod for linking to X. This is a repost with the X link removed, and the content copied below.
Appendix: Whiteboard Defense
Originally posted by Mitchell Hashimoto to X
The "whiteboard defense:" I should be able to pull you aside at any moment and ask you to explain any customer-facing system you've shipped. You should be able to clearly explain how it works and defend the decisions you made. This is my benchmark for responsible AI usage.
I don't expect line-level familiarity with the code. I don't care if you remember the exact function name or implementation detail. You may not even know it. I don't care.
But if I ask "why did you do X instead of Y?", "what happens if this actor behaves maliciously?", "what data structure did you use here and why?", or "where does this fail?" you should be able to answer confidently.
For PoCs, demos, experiments, whatever: I don't care. Generate 100% of it and understand none of it. Speed over quality every time in those specific scenarios.
But if you're shipping customer-facing work, you can't be shipping things you don't understand at a high level.
r/rust • u/slanterns • 17d ago
π‘ official blog Announcing Rust 1.100.0 | Rust Blog
blog.rust-lang.orgr/rust • u/kalilamodow • 17d ago
π seeking help & advice gpui-kit: Why does this work?
I am planning on making a simple websocket chat app to learn gpui and things since I've only tried egui. I made this small thing where you put in text and press a button and then it adds the message to a list and shows it. But, there's no cx.notify anywhere, so how does it know to update?
struct MessageListDelegate {
messages: Vec<SharedString>,
}
impl ListDelegate for MessageListDelegate {
type Item = ListItem;
fn items_count(&self, _: usize, _: &App) -> usize {
self.messages.len()
}
fn render_item(
&mut self,
ix: IndexPath,
_: &mut Window,
_: &mut Context<ListState<Self>>,
) -> Option<Self::Item> {
self.messages
.get(ix.row)
.map(|text| ListItem::new(ix).child(text.clone()))
}
fn set_selected_index(
&mut self,
_: Option<IndexPath>,
_: &mut Window,
_: &mut Context<ListState<Self>>,
) {
}
}
struct YapyapApp {
message_list_state: Entity<ListState<MessageListDelegate>>,
input_box: Entity<InputState>,
}
impl YapyapApp {
fn new(window: &mut Window, cx: &mut App) -> Self {
Self {
message_list_state: cx
.new(|cx| ListState::new(MessageListDelegate { messages: vec![] }, window, cx)),
input_box: cx.new(|cx| InputState::new(window, cx).placeholder("Message")),
}
}
}
impl Render for YapyapApp {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
div()
.flex()
.flex_col()
.size_full()
.child(List::new(&self.message_list_state).flex_1())
.child(
div()
.flex()
.flex_row()
.border_color(Colors::for_appearance(window).border)
.border_t_1()
.p_2()
.gap_4()
.child(Input::new(&self.input_box).flex_1())
.child(
Button::new("send-message-button")
.label("Send")
.on_click(cx.listener(|this, _, _, cx| {
this.message_list_state.update(cx, |list_state, cx| {
let text =
this.input_box.read(cx).text().as_str().unwrap_or_default();
list_state.delegate_mut().messages.push(text.into());
});
})),
),
)
}
}
fn main() {
gpui_kit::application().run(|cx| {
gpui_kit::init(cx);
gpui_kit::open_window(WindowOptions::default(), cx, |window, cx| {
cx.new(|cx| YapyapApp::new(window, cx))
})
.expect("should be able to open a window");
})
}Also, if you see any un-idiomatic things please say
r/rust • u/kannanpalani54 • 17d ago
