r/learnrust • • 9h ago

Which GUI crate would you choose for this project?

2 Upvotes

Hi everyone! I asked this earlier in the week, but I don't think I explained my question very well (sorry for the translation; I'm a Spanish speaker).

I want to learn how to develop graphical user interfaces (GUIs).

I'm generally new to programming, but I really like Rust; I don't know any other languages—just Rust.

I want to build a project for the company I work for. We mostly use Excel for our data; our "database" (an Excel file) is 500k rows by 25 columns (though there are several files covering different areas, so the total exceeds a million data points).

I want to automate this. That million data points is spread across years; the most critical process involves each of us reviewing 100 items in 30/40 minutes—classifying, validating, sorting, etc.

I need to create something like dashboards featuring:

charts and tables that are sortable and filterable.

These two components are absolutely critical.

For the rest, I'm thinking of a data grid (something like Excel, but not a full spreadsheet—just small tables with editable cells).

We need this because our values ​​aren't always 100% accurate; there's a lot of human error involved in our work.

For example: Our system registers a client who has a discount percentage, but that wasn't included in the initial registration request. So, the discount doesn't apply the first time. Later, we receive the correction, and the discount applies to the second sale—at which point we also correct the first sale.

This happens across all areas, so I need something editable. Given our limited review time, I need the interface to be fast and intuitive.

I don't need mobile support—though it would be a nice-to-have, it's not essential. I need a recommendation focused 100% on desktop.

It also needs to properly support Windows, Mac, and Linux.

Which GUI crate would you choose? (I know it's difficult for me, but I want to learn a lot)


r/learnrust • • 10h ago

diagprint 0.8.1: Rust diagnostics that outlive the terminal (stale-safe fixes, SARIF/LSP output, forensic history)

Thumbnail
0 Upvotes

r/learnrust • • 1d ago

CARIBBEAN RUST/LINUX COMMUNITY ?

7 Upvotes

I'm looking for a Caribbean community or group around Linux and Rust.

I searched in the Caribbean sub reddit for both terms and came up empty handed.

TLDR: I'm new to programming and Linux. practically 0 experience. As such I'm looking for support from my near by community or at least get one started for persons in my same position.


r/learnrust • • 1d ago

I built Sovereign-NB: An OS-less, sub-microsecond bare-metal neural engine in pure #![no_std] Rust (boots from UEFI)

Thumbnail
0 Upvotes

r/learnrust • • 1d ago

What do I even make with rust?

Thumbnail
1 Upvotes

r/learnrust • • 1d ago

Idiomatic way to initialise struct that could fail?

6 Upvotes

I want to initialise a struct from 3 or 4 parameters. Not sure which way to go : builder pattern, or wrap the parameters in a temporary struct and impl TryFrom.

I'm currently just using fn new(a, b, c)->Result<T> in an impl block but there should be a better way.


r/learnrust • • 1d ago

The Pi agent in Rust: 10 faster startup, 7 less memory!

2 Upvotes

I've been learning about the Pi agent and decided to rewrite it in Rust. Now that I've finished a lot of the work, I'd like to show how much faster Rust (rpi) is than TypeScript (Pi). Here are the results:

Metric rpi (Rust) Pi (TypeScript) Difference
--version 17.5 ms 169.5 ms 9.7× faster
Cold start 17.7 ms 189.5 ms 10.7× faster
RSS when ready 12.0 MiB 91.5 MiB 7.6× smaller
Install size 21.8 MiB ~385 MiB ~18× smaller

Rust is really cool!


r/learnrust • • 2d ago

Making a GPUI Desktop App Interactive with Rust

Thumbnail youtu.be
20 Upvotes

r/learnrust • • 2d ago

RV Bare-metal?

5 Upvotes

I'm a beginner in OS dev and have been tinkering with creating a RISC-V operating system in Rust. There are a lot of great resources out there, but most of the posts I found are slightly outdated, so I wanted to write a bit about my own journey. My goal is to use Rust's features as much as possible!

First, we'll go over creating a bare-metal binary and finish with a small executable that immediately shuts down the machine when it runs in QEMU. Hope you find this interesting, as I did!

https://ltungv.com/note/rv-bare-metal/


r/learnrust • • 2d ago

Rust content in Spanish

Thumbnail
1 Upvotes

r/learnrust • • 3d ago

Lecteur/écrivain de bases de données MaxMind en Rust pur — je recherche des retours

Thumbnail
0 Upvotes

r/learnrust • • 3d ago

Building Kernel Modules in Rust

Thumbnail thehecknow.hashnode.dev
0 Upvotes

r/learnrust • • 4d ago

What do you think of SNAFU?

14 Upvotes

I've been working on a project for a while now and I recently got bitten hard in the ass by my own "error handling" technique, so now I need to properly use a real library error handling crate.

Out of thiserror and snafu, I went with snafu because they seem to have context attaching and some other goodies.

What I found interesting is a bit from their philosophy after realizing that the error enum I created was private by default:

Many error types

Each module should have one (or more!) error types that are scoped to that module, reducing the need to deal with unrelated errors when matching and increasing cohesiveness of a single error type.

I am not sure how I feel about this. What are the major benefits of this over a "one error enum per crate" pattern? Other than 1 lib, my other libs are internal to my workspace (i.e. not going to publish them). Of course, I know I don't have to follow their philosophy.

And while I am at it, any tips on error handling in snafu or in general?

Thanks.


r/learnrust • • 4d ago

More concise way to write `self.some_vec.iter().copied()` ?

8 Upvotes

In a &self method, when I have a Vec of Copyable data and I want to iterate over owned values, either I iterate over references and dereference inside the loop body (I don't really like this style), or I have to do this iter().copied() boilerplate. Not a big deal, but is there some syntax that I'm missing ?

Edit: toy code ``` struct Foo { some_vec: Vec<i32>, }

impl Foo { fn iterate(&self) { for v in self.some_vec.iter().copied() { do_some_stuff(v); } } }

fn do_some_stuff(v: i32) { .... } ```


r/learnrust • • 4d ago

Is there a way to translate normal Rust (axum) code to Lean 4 without strict restrictions?

Thumbnail
6 Upvotes

r/learnrust • • 4d ago

jev-curate beta v0.1.1: Rust-native SFT/pretraining dataset curation

Thumbnail github.com
2 Upvotes

r/learnrust • • 5d ago

Looking for TTS and STT libraries in Rust — any recommendations?

Thumbnail
2 Upvotes

r/learnrust • • 7d ago

(Yet another) question about lifetimes

6 Upvotes

In my program, I didn't like the cloned() call below and was wondering if I could get rid of it. Usually I don't do this because it makes me descend into lifetime hell, but I tried anyway. After some experimentation I went from this:

`` /// Returns true ifdictcontains a word starting withprefix` pub fn has_word_starting_with(dict: &[String], prefix: &str) -> bool { let i = dict.partition_point(|s| s.as_str() < prefix); i < dict.len() && dict[i].starts_with(prefix) }

/// Returns all the words in the dict which are valid sequences of length pub fn valid_seqs(length: usize, dict: &Vec<String>) -> Vec<String> { let mut result: Vec<String> = dict .iter() .filter(|&word| word.len() == length) .cloned() // we need to create owned strings from .collect(); result.sort(); result } ````

to this

``` pub fn has_word_starting_with(dict: &[&String], prefix: &str) -> bool { let i = dict.partition_point(|s| s.as_str() < prefix); i < dict.len() && dict[i].starts_with(prefix) }

pub fn valid_seqs(length: usize, dict: &[String]) -> Vec<&String> { let mut result: Vec<&String> = dict.iter().filter(|&word| word.len() == length).collect(); result.sort(); result } ```

And it worked. I still don't understand why the compiler doesn't complain. More importantly, I still don't have a intuitive feel for when this works and when it doesn't, especially with strings. I mostly try stuff with the bacon terminal open until it works. Is there any eye-opening insight about this, or is this just practice? I've the read the lifetimes chapter several times and watched multiple tutorials, I still don't see why the above works all of a sudden (unless I got better without realizing it).

Thanks for your help.


r/learnrust • • 7d ago

Building A Clycker Game with Modules in Rust + Axum & NoJS - [ 05 ]

Thumbnail youtube.com
6 Upvotes

r/learnrust • • 7d ago

I built a Rust project that turns `effects(pure)` into a real transitive compiler obligation — curious what you think

0 Upvotes

Hey r/learnrust,

I’ve been working on Nirdosha (still pre-1.0), a project that tries to give you plain Rust with compiler-checked contracts. The part I care about most isn’t the syntax itself — it’s making a claim like this actually mean something across the whole call graph:

```rust

[nirdosha_rt::contract(effects(pure))]

fn net_total(records: &[u64]) -> u64 { records.iter().sum::<u64>() + ledger_overrides() } ```

Looks pure at first glance. But the chain continues:

```rust fn ledger_overrides() -> u64 { read_ledger().len() as u64 }

fn read_ledger() -> String { std::fs::read_to_string("ledger.txt").unwrap_or_default() } ```

A local AST scan would happily accept net_total. In deep verification mode, Nirdosha drives rustc, inspects pre-optimization MIR, resolves the call graph, and rejects the build with a diagnostic like:

fn `net_total` claims effects(pure) but the effect lattice says otherwise file system access — chain: net_total → ledger_overrides → read_ledger → std::fs::read_to_string

A few design choices that felt important to me:

  • Calls are identified through resolved DefIds, not string matching.
  • Local callees are analyzed transitively.
  • Closures (including ones passed to Iterator::map) get inspected so effects can’t hide inside callbacks.
  • MIR is checked before optimization, so the compiler can’t erase a forbidden operation before verification sees it.
  • File, network, process, environment, clock, randomness, FFI, panic, unsafe, and mutable-static boundaries are all treated as effects.
  • Dynamically dispatched or unresolved calls fail closed.
  • External functions need a curated effect summary — unknowns are never silently assumed pure.
  • Recursion is handled by tracking visited functions.
  • Potential panics (bounds checks, division by zero, etc.) count as impurity/partiality.

The two-level design is deliberate. Under ordinary stable cargo the attribute macro does a shallow check and expands to normal Rust. Under cargo nirdosha build a nightly rustc-dev driver runs the full interprocedural MIR analysis. There’s also an explicit fast mode that only does the shallow check — I don’t pretend they provide the same guarantee.

I applied the same philosophy to authorization:

```rust

[nirdosha_rt::contract(requires(role = "hr_staff"))]

fn compute_payroll(records: &[PayRecord]) -> u64 { ... } ```

The macro injects &RoleProof<HrStaff> into the real signature. RoleProof has a private constructor and can only be minted after a proper authenticated session, so forgetting the check becomes a type error at the call site instead of a runtime branch someone might skip.

The enforcement ladder I’m aiming for is:

  1. Express the requirement next to ordinary Rust code.
  2. Encode whatever can be enforced directly into the type system.
  3. Catch obvious violations during macro expansion.
  4. Use resolved MIR and the transitive call graph for deeper claims.
  5. Produce a certificate describing exactly which guarantees were checked.

Effect summaries form a trusted boundary, dynamic dispatch is deliberately conservative, the deep verifier needs nightly compiler internals, and the project is openly pre-1.0. But the core idea — a contract is a checked declaration, not a comment — feels especially useful when reviewing agent-generated code. Trusting that generated code followed a prompt is a lot weaker than making the compiler reject a lie.

I’d like to hear your views:

Would you use an effect system delivered this way — as an additional compiler pass over otherwise ordinary Rust — or does the dependency on compiler internals make it a non-starter for you?

(Everything above is based on the shipped MIR traversal, macro expansion, role-proof implementation, and the focused deep-verification suite, which currently passes including the indirect purity violation case.)


r/learnrust • • 9d ago

Version 3.0.0 of free book "Rust Projects - Write a Redis Clone"

61 Upvotes

Hi all! I just published version 3.0.0 of my free book “Rust Projects – Write a Redis Clone”.

You can read the HTML version at https://rust-projects-write-a-redis-clone.github.io/ or download the PDF version at https://leanpub.com/rustprojects-redis

The book follows the Redis challenge on CodeCrafters and includes a 40% discount for any paid CodeCrafters membership.

The book covers the whole basic challenge, and three extensions: "Replication", "Transactions", and "Lists".

This edition features a full rewrite of the code with more attention to Clippy suggestions, and the new extension "Lists".

I hope this will be a useful resource to all those (like me) who want to go beyond code snippets and learn Rust implementing something real.


r/learnrust • • 8d ago

Learn Rust Concurrency by Practice

Thumbnail rustfinity.com
2 Upvotes

r/learnrust • • 8d ago

How To Keep Building Side Projects in AI era?

Thumbnail youtu.be
3 Upvotes

r/learnrust • • 8d ago

I built an AI-assisted Rust tutor as a side project and would really appreciate feedback from learners

0 Upvotes

Hi everyone,

I hope this kind of post is okay here. Mods, please feel free to remove it if it breaks the rules, and sorry in advance if so.

I've been writing Rust for a while, and I've watched quite a few people (myself included, early on) get stuck at the same places: ownership, borrowing, lifetimes, and cryptic compiler errors. So in my spare time I've been building a small tool called rustcoach (rustcoach.dev). I'd love honest feedback from people who are actually learning the language.

Here's what it does, so you know exactly what you'd be clicking on:

  • It's an AI coach (built on Claude). I want to be upfront about that, since I know opinions on AI for learning vary a lot here.
  • Lessons adapt to what you already know and re-test things you got wrong before.
  • You can interrupt at any point and ask questions like "why &str instead of String here?"
  • Every lesson ends with an assignment you write yourself in the browser. Tests decide when it's done, and hints point you toward the right API but never give you the solution.
  • After the tests pass, it reviews your code for idiomatic style: avoiding unwrap(), preferring combinators, keeping it clippy clean, and so on.
  • Compiler errors get a plain-English explanation of what went wrong, but the fix stays yours.
  • Topics you struggled with come back later as spaced-repetition review cards.

It's not free to use fully, and I don't want to hide that. The first lesson is free with no card required. After that it's a one-time purchase rather than a subscription, because running the AI model costs money. Please don't feel any pressure. Feedback from the free lesson alone would already help me a lot.

Some things I'm especially curious about:

  • Are the explanations clear, or does it over- or under-explain?
  • Does the code review feel useful?
  • Anything confusing, broken, or annoying?

And to be clear, I don't think this replaces The Book, Rustlings, or Exercism. Those are fantastic and free. This is just a different, more guided format that might suit some people. IMHO it's like a book on steroids and forces you to write code straight away after you just learned a concept. It also makes sure you really grasp the concept if not in the current lesson then in the next ones till its satisfied.

Thanks for reading, and good luck with your Rust journey, whatever resources you use.


r/learnrust • • 9d ago

Understanding Rust Ownership by Building a Zero-Copy Log Line Parser

Thumbnail youtu.be
53 Upvotes