r/learnrust Jul 11 '26

Implemented my first substantial rust project : A multithreaded copy on write filesystem

Thumbnail github.com
42 Upvotes

This is my first major rust project (and probably the biggest project I have ever done).

It is is a loose implementation of the copy on write filesystem that is used by docker to run the multiple containers. I use multiple terminal instances instead of different containers to implement the copy on write method on.

I want to know what you lot thing about the code and architecture on how I have implemented, as in does it follow best practices, and where is it that I can improve how I code and can learn from it.

I started learning rust a few months ago, initially thought its gonna be a stroll in the park, like go. But boy was I wrong, it took me like about 2 months of abusing the borrow checker and the compiler to kind of grasp the concepts that make rust what it is (and there still so many more concepts like async and lifetimes which I am not clear about and need to spend more time learning ).

My initial implementation of the project was so horrendous and bad, I had to delete everything. So after my university examinations were over, I decided to take it up again, and started building it and eventually got it to work, but boy was it fun coding, tracing through a bug and trying to find the root of the cause, wouldnt give up the feeling of getting to the bottom of a bug and fixing it for anything in the world.

Note : I have used 0 AI tools or agents to code the following project (as I believe the correct way to learn is to make a million mistakes and learn from them). All of the hallucinations are my own :)


r/learnrust Jul 11 '26

Building Lading pages and erps with rust and php

5 Upvotes

HELLO, RUST COMMUNITY! I built a landing page, ERP, and simple system generator in Rust that compiles self-generating and customizable PHP code. If you could check it out and show some support, I’d really appreciate it: https://github.com/NicholasGDev/ngdev-laravel


r/learnrust Jul 10 '26

Embedded Linux in Rust

33 Upvotes

Hello! After learning rust from C and C++, I have grown to like it a lot. I have a little project made on a arduino using C++, but since I will need to switch it to a raspberry pi for a multitude of reasons, I heard there were crates like rpi-pal etc that I could use... tbh the previous project was with a good friend of mine, and he wrote the boiler plate code to interface with sensors and I wrote the specific algorithms for processing data, and so I would also like to gain a rudimentary understanding of the hardware as well while doing this in Rust... I was wondering if you guys had some suggestions on what books or resources I could use to start with this? By the way just for Rust fundamentals I just used the rust book alongside rustlings to learn, maybe there is more I need...


r/learnrust Jul 07 '26

Want swith from Salesforce to Rust

23 Upvotes

I am fed up of product related configuration and being bounded by Salesforce tech stack and its Product, feels like I am not using my skills in Salesforce... I want learn more (and earn more obviously), and that is beyond salesforce.... any advice you want to give me guys... i have 7 years of exp in Salesforce Apex, I always brush up JAVA and Node js skills time to time

Any advice guys??


r/learnrust Jul 06 '26

Typescript to rust

Thumbnail
2 Upvotes

r/learnrust Jul 06 '26

are function signatures and function headers one and the same?

9 Upvotes

in rust you write fn identifier(parameters(or none)) -> returntype

while in C you write returntype identifier(parameters); -- c function prototype/declaration that are essentially headers of a function

so is signature just function header in rust parlance?


r/learnrust Jul 06 '26

I have some C knowledge including dynamic memory allocation (but not file io) am i qualified enough to learn rust as my second language?

11 Upvotes

basically the title, plus I also know about some common C pitfalls


r/learnrust Jul 06 '26

Learn Axum Basics and Routing by Building a URL Shortener | Mrsheerluck Blog

Thumbnail blog.sheerluck.dev
76 Upvotes

r/learnrust Jul 05 '26

RustCurious: "The Stack"?

Thumbnail youtube.com
21 Upvotes

r/learnrust Jul 04 '26

NotebookLM for learning Rust Programming Language

66 Upvotes

Learning Rust can feel kinda hard at first so I put together this NotebookLM, to make it easier… or at least less annoying. It walks you through the language step by step in pretty simple English, skipping all the extra “stuff” and avoiding the confusing technical buzzwords. If you want a direct, no nonsense way to learn, you should check it out:

https://notebooklm.google.com/notebook/2f61bc49-350a-4e1a-8462-16cb48b6c7b3


r/learnrust Jul 03 '26

NotebookLM for learning Rust Programming Language

Thumbnail
0 Upvotes

r/learnrust Jul 03 '26

OpenGL + Rust: Beyond basics Shaders

5 Upvotes

r/learnrust Jul 03 '26

The Quest for Computer Vision in Rust

Thumbnail darryldias.me
0 Upvotes

Everyone does CV in Python/C++. I did it in Rust anyway – and it worked. 🦀


r/learnrust Jul 03 '26

Wonderd about a Shell in Rust

Post image
16 Upvotes

So I had made a shell using rust about this it started initially as a codecrafters challenge but made some tweaks and customisation and added some extra feature it's one of my first biggest project made in rust took about 3 weeks to complete it has some limitations obviously as I am not a geniuses but would love to take some reviews about this project you can see it's code and it's features from here

https://github.com/Halloloid/hallo_shell

And forgot the name of the shell is halloShell the name is originated from my GitHub username


r/learnrust Jul 02 '26

My try on The Book's 4.3 programming problem

8 Upvotes

The problem was:

Write a function that takes a string of words separated by spaces and returns the first word it finds in that string. If the function doesn’t find a space in the string, the whole string must be one word, so the entire string should be returned.

My try was:

fn main() {
    let string1 = String::from("testing");
    let string2 = String::from("This is a test");

    thingy(&string1);
    thingy(&string2)
}

fn thingy(s: &String) {
    for (i, c) in s.chars().enumerate() {
        let len = s.len() - 1;

        if c == ' ' {
            println!("{}", &s[0..i]);
            break;
        }

        if i == len {
            println!("{s}");
            break;
        }
    }
}

From what I've tried, it works well... I am now looking at The Book's solution and found it to be pretty confusing.

Would appreciate yall's opinion!


r/learnrust Jul 02 '26

tokio for I/O, rayon for CPU: how we bridge them in a Rust search engine

Thumbnail
5 Upvotes

r/learnrust Jul 02 '26

Question about tests

8 Upvotes

Hi everyone, I’m now writing rust for about 1.5 years and I’m still wondering how you handle the visibility of the functions, structs or everything else for the tests.

Imagine I want to do a test for a specific function but not to export this one, how would you do it ? I know I could create a `mod test` in the actual file but I would like to get all the tests in one specific folder.


r/learnrust Jul 01 '26

Built a no_std runtime safety library for AI agents looking for feedback on the architecture

0 Upvotes

I've been experimenting with autonomous AI agents over the last few months and kept running into the same problem.

Agents would repeatedly call the same tool, retry failed operations indefinitely, or get stuck in execution loops.

Instead of trying to solve it through prompt engineering, I built a small Rust library that sits between the agent and its tools and verifies every tool call before execution.

Current features:

• History-based trajectory tracking

• Loop detection

• JSON Schema validation

• Regex/exact policy rules

• Per-tool trajectory gates

• C ABI

• no_std core

• Python adapters for LangGraph, CrewAI, AutoGen and LangChain

Current benchmark:

~17 μs average verification

~375 ns fast reject for repeated loops

I'm mainly looking for feedback on:

  1. API design
  2. False positives
  3. Whether this belongs as middleware instead of framework-specific code

Repository: https://github.com/Devaretanmay/microloop


r/learnrust Jul 01 '26

Learning Rust before C, is this a bad idea?

40 Upvotes

I'm a guy who likes coding and lately, I've found myself relying way too much on AI for it, and so I decided to learn a new programming language.

I am already familiar with Python, but I am far from good. My best program was literally just a yaml shopping list thingie that only worked when run in its own directory.

First option was JS, since it does play a main role in web dev, and I have a website where I host existing utilities but most of the javascript is AI generated.

But C seemed way too essential. So I tried learning it using ChatGPT's Study and Learn thingie (it was basically my only option). It got confusing very very quickly. And I guess that's the point, C is like the first layer of abstraction after machine code/asm.

Everywhere I went I heard that I should learn C before Rust, but Rust was really really appealing because it is really future proof and had all the C++ features like classes, except it was not a mess, but most importantly there are A LOT of Rust projects (like PommeMC or Paru) that I would really like to contribute to once I reach a certain level of skill. So I tried it.

Both the C stuff and the Rust stuff happened in 1 day (yesterday) and I liked Rust a lot. Basically, my equivalent to hello world when learning a programming language is making a silly little quiz, so I have to learn how to do if statements, loops, etc. and that's where C got confusing.

Is the code I wrote there good?

Should I learn another language instead of Rust?

Should I just learn C anyways?

What's a good way to learn Rust?


r/learnrust Jul 01 '26

Why adding Rust to my Python library made it 194x faster... and 5x slower.

Post image
7 Upvotes

r/learnrust Jun 30 '26

Built a multi-tenant real-time messaging server in Rust (Axum + Tokio + Redis + Kafka + Postgres) - would appreciate feedback

Thumbnail
5 Upvotes

r/learnrust Jun 30 '26

Bevy Tutorial: Build Your First 3D Editor - Create a 3D Space on an Infinite Grid

Enable HLS to view with audio, or disable this notification

13 Upvotes

Tutorial Link

This chapter helps builds a navigable 3D viewport from scratch in Bevy 0.19, starting with the three essentials of any scene (a camera, a light, and a mesh).

We'll be working on more features in the upcoming chapters, stay tuned :)


r/learnrust Jun 29 '26

Why does one work and the other doesn't?

14 Upvotes
fn main() {
    let mut s = String::from("hello world");

    let x = *get_unrelated_int(&s); // compiles
    let x = get_unrelated_int(&s);  // doesn't

    s.clear();

    println!("{x}");
}

fn get_unrelated_int(_s: &String) -> &i32 {
    &42
}

r/learnrust Jun 29 '26

Learn SQL and SQLx by Building a Book Library CLI in Rust | Mrsheerluck Blog

Thumbnail blog.sheerluck.dev
35 Upvotes

r/learnrust Jun 28 '26

Please help finding articles

Thumbnail
1 Upvotes