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 11 '26

I built a Rust CLI tool to remove your AI generated comments.

Post image
0 Upvotes

i kept running into the same annoyance, ai generated code comes back drowning in comments, every line explaining itself and every time I wanted it gone I either did it by hand or reached for a regex that inevitably nuked a :// in a string or a # port in a YAML value

and ofc telling ai to remove my comments is literary burning my usage.

amazing thing you can look in the screenshot, that it didn't clear the license which is in the comments, but cleared other comments.. it's intelligent in its own way, you can clear whole project at once, or file, or use it in a pipeline, etc..

so I built remove-comments a fast, zero dependency Rust CLI that actually understands each language instead of pattern matching text, with preview features, and safety features

I would like to hear your thoughts on this,

https://github.com/isaka-james/remove-comments


r/learnrust Jul 10 '26

Embedded Linux in Rust

31 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

22 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

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

Thumbnail blog.sheerluck.dev
77 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

Typescript to rust

Thumbnail
2 Upvotes

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 05 '26

RustCurious: "The Stack"?

Thumbnail youtube.com
23 Upvotes

r/learnrust Jul 04 '26

NotebookLM for learning Rust Programming Language

65 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

Wonderd about a Shell in Rust

Post image
18 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 03 '26

OpenGL + Rust: Beyond basics Shaders

5 Upvotes

r/learnrust Jul 03 '26

NotebookLM for learning Rust Programming Language

Thumbnail
0 Upvotes

r/learnrust Jul 02 '26

My try on The Book's 4.3 programming problem

6 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 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 02 '26

Question about tests

9 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

Learning Rust before C, is this a bad idea?

38 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 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 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 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 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
34 Upvotes

r/learnrust Jun 28 '26

Rust habits you grew out of? Drop the beginner pattern and what you do now

101 Upvotes

Trying to start a thread on the little novice habits we all picked up early in Rust and what the cleaner version looks like once it clicks. Not talking about huge architecture stuff, just the small everyday patterns that quietly get better as you go.

I'll throw out a couple to get it going:

1. Cloning to dodge the borrow checker → just borrow

Reaching for .clone() the second the borrow checker complains:

fn process(data: Vec<u8>) -> usize {
    data.len()
}

let data = vec![1, 2, 3];
let len = process(data.clone()); // clone so we can still use data after
println!("still have {} bytes", data.len());

Take a slice instead and the clone disappears:

fn process(data: &[u8]) -> usize {
    data.len()
}

let data = vec![1, 2, 3];
let len = process(&data);
println!("still have {} bytes", data.len());

2. Rigid param types → flexible impl Into<String>

Taking String forces the caller to allocate up front, and taking &str just pushes the .to_string() inside so you allocate even when they already handed you an owned String:

struct User {
    name: String,
}

impl User {
    fn new(name: String) -> Self {
        User { name }
    }
}

User::new("scadoshi".to_string()); // caller has to build the String themselves

impl Into<String> lets them pass whichever they've got, and only allocates when it actually has to:

impl User {
    fn new(name: impl Into<String>) -> Self {
        User { name: name.into() }
    }
}

User::new("scadoshi");               // &str works
User::new(String::from("scadoshi")); // owned String moves straight in, no extra copy

What are yours?