r/learnrust • • 3m ago

Inside Cloud Hypervisor: From KVM to a Running VM - Philipp Schuster | EuroRust 2026

Thumbnail youtu.be
1 Upvotes

What actually happens when a virtual machine starts? 🖥️✨ In his talk at this year's EuroRust, Philipp Schuster followed the path from creating a KVM VM to booting a guest in Cloud Hypervisor, a Rust-based VMM. Check out the full talk now on YouTube! 🦀

In 2027 EuroRust is going to Prague! Learn more and get your ticket at eurorust.eu.


r/learnrust • • 1d ago

It's Advent of Code time!

8 Upvotes

For anyone who isn't familiar and wants some challenges to hack around in Rust with - advent of code is back!

www.adventofcode.com

I'm not associated with it in any way.

This year I'm doing it on an STM32F3 because never finishing previous years isn't going to stop me making it harder for myself!

The main subreddit:

r/adventofcode

A final warning - pay attention to the rules. Namely, if uploading your code anywhere, make sure you don't upload your puzzle input too

A leader board if anyone wants to join:

1020906-8fba85a3


r/learnrust • • 1d ago

I made a phone game to practise Rustlings-style exercises offline, looking for feedback

Post image
15 Upvotes

I wanted to practise Rust on the train without a laptop, so I built Rustforge: each level gives you a small broken Rust program, you fix it on your phone and run it.

Most of the 62 levels are adapted from Rustlings (MIT, credited in the app), plus a few "will it compile?" questions. Topics go from variables up to traits, lifetimes, iterators and closures.

It does not run rustc. I wrote an interpreter in TypeScript for a subset of Rust, and I test it against the real compiler: about 115 programs give the same output or the same error code (E0382, E0308, E0384...) in both. There is no full borrow checker, no async, no threads, no unsafe, so it's a companion to the Book and Rustlings, not a replacement.

It works offline, with no account, ads or tracking. World 1 is free, the other six worlds are a one-time purchase.

iOS: https://apps.apple.com/app/id6815256287

Android: https://play.google.com/store/apps/details?id=com.vleclercq.rustforge

What I'd most like to hear: places where the interpreter behaves differently from rustc, and explanations that are unclear or wrong.


r/learnrust • • 2d ago

I made an iPhone app that teaches Rust by reading code: predict the output, find the line the compiler rejects (first 3 stages free, 10 lifetime codes below)

Thumbnail ugiwise.com
0 Upvotes

Posted with the mods' permission.

I'm a solo developer. My app teaches programming by reading code instead of typing it, and last week I added a Rust course. The idea is simple: you read a short real program and answer a question about it. I built it around the part most beginners get stuck on, ownership and borrowing.

What a lesson looks like:

- A short program, then one question: what does it print, which line does the compiler reject, or which piece is missing.

- When a value moves, is borrowed or is dropped, the app draws it step by step beside the code.

- A wrong answer gets a plain-English reason, not a compiler dump.

What it covers (30 stages): first programs, variables and mutability, ownership, references and borrowing, strings and slices, structs, enums and match, Option, error handling with Result and ?, generics, modules, traits, lifetimes, closures, iterators, trait objects, Rc/RefCell/Box, files, threads, a look at macros and unsafe, and a final project split across five files.

What it is not:

- It does not replace The Book or writing your own code. There are no typing exercises in the Rust course; it is reading and reasoning only. I think of it as the thing you do on the bus between chapters.

- iPhone only for now.

- No async, no FFI, no proc macros.

Every program in the course (a bit over 3,000) was compiled and run with a pinned toolchain, edition 2024, and the outputs in the app are the real ones.

The first three stages are free. Later stages are paid (subscription or one-time).

You can try one ownership card in the browser here, no install: https://ugiwise.com/rust

App Store: https://apps.apple.com/app/ugiwise-learn-c-c-python/id6828549507

Giveaway: I have 10 lifetime codes for the full app. Leave a comment and I'll DM codes to the first ten. Codes work in most countries' App Stores.

I'd really like to hear where an explanation is wrong or misleading. If you find one, tell me the stage and I'll fix it.


r/learnrust • • 2d ago

Comparative Performance Evaluation and Architectural Analysis of Sorting Algorithms in Rust

Thumbnail zenodo.org
1 Upvotes

Evaluated Algorithms

  • Custom Implementations: Bubble Sort (early-exit flag), Selection Sort, Insertion Sort, Shell Sort (extended Ciura sequence), Merge Sort (preallocated scratch reuse), Quick Sort (median-of-3, Hoare partitioning, tail-call bounding), Heap Sort (Floyd binary max-heap), Tree Sort (explicit BST with duplicate counts), Introsort (Musser hybrid), Timsort (Peters natural-run detection & stack invariants), Counting Sort (bounded histogram frequency counting), Radix Sort (8-pass LSD ping-pong with sign-bit XOR inversion), and Bucket Sort (128-bit safe range distribution).
  • Standard Library Baselines: Rust slice::sort (Driftsort) and slice::sort_unstable (IPNSort).

Key Empirical Findings

  • Instruction-Parallel Sorting Networks: Rust's standard library sort_unstable() (IPNSort) achieves peak comparison-based throughput on uniform random data (12.64 ms at N = 1,000,000), driven by branchless instruction-parallel sorting networks yielding an IPC of 3.49 and a negligible 0.54% cache miss rate.
  • Branch-Free Linear Scalability: 8-pass LSD Radix Sort demonstrates strict linear scaling (19.74 ms at N = 1,000,000) and an ideal 0.00% branch misprediction rate across signed 64-bit integers (i64), outperforming classical Merge Sort by 3.4×.
  • Adaptive Run Detection: On presorted arrays, slice::sort (0.23 ms) and Timsort (0.36 ms at N = 1,000,000) achieve up to 80× speedups by collapsing monotonic runs in linear time.
  • Cache Thrashing in Heap Sort: Non-contiguous parent-child pointer strides (2i+1, 2i+2) cause Heap Sort to incur a massive 31.65% cache miss rate on hardware counters.

Repo - github repo


r/learnrust • • 2d ago

I want to learn Rust to make OS and Kernels

Thumbnail reddit.com
1 Upvotes

r/learnrust • • 3d ago

I'm building roadmaps to learn new topics in Rust

Thumbnail reddit.com
1 Upvotes

r/learnrust • • 2d ago

Learning Rust easily

Post image
0 Upvotes

Hey Everyone I'm working on this app and I wanted to ask if you would be open to test it

It's an app that teaches you about programming in Rust ,one of the most common programming languages in the world and we give out certificates for completion of different quizzes in the app

Your effort is greatly appreciated

Please submit your details in the form or reach out to me directly 🙏

https://forms.gle/j3GisUckTo6ubATBA


r/learnrust • • 3d ago

Is it just me or does the syntax seem wayy too complicated for even someone coming from C++?

Thumbnail reddit.com
0 Upvotes

r/learnrust • • 4d ago

Started a Rust blog

Thumbnail asaft.dev
3 Upvotes

I have started a blog with the purpose of writing Rust oriented content.

I have been mostly using Rust for the last 2 years and
I think I can share some insights with other members of the community.

How do you guys feel about the overall look, any suggestions or reprimands?

I was thinking of writing an allocator in the near future and documenting the implementation (seems like a fun experiment with the stabilization of the Allocator trait as well).


r/learnrust • • 4d ago

Rust

0 Upvotes

Serious question...

Is it just me or has Rust become the default programming language of AI's? I know its lightweight and extremely fast in terms of run/consume, but whatever project i see, be it for a game server or anything else, always Rust. It wasnt like this before. Been in the run for a long time (10+ years) and i can confidently say that people DID NOT like Rust at that time because it was so hard to understand and it felt like a joke language to them (They were also saying that about PHP, lol)

Give me your opinion. Am i hallucinating?


r/learnrust • • 6d ago

Suggestions for Rust Course

29 Upvotes

I am currently learning Rust programming language and want to enroll into a course for better guidance and projects . Someone help me choose the best available course on Udemy.


r/learnrust • • 5d ago

How can you write vendor-independent gpu code ?

2 Upvotes

Hello !
I have a small question, i have a project where i need to write GPU code and I would like to support both AMD and NVIDIA cards. When browsing the web I found that rocm seems to have HIP which seems to fulfill this role but I cannot find any crate providing bindings for it, could you give me some pointers ?
have a nice day !


r/learnrust • • 5d ago

Uniffi - proc-macros vs UDL

2 Upvotes

For those of you using UniFFI, which approach do you prefer: proc-macros or UDL?

I've been reading the documentation, and I understand that UDL is useful when you want to separate the interface definition from the Rust implementation.

But I'm not quite sure what the actual benefit is in practice.

Is it mainly about keeping the FFI interface separate from the Rust code, or is there another advantage?

For example, with proc-macros, we use #[uniffi::export] to expose functions. With UDL, we define the interface separately and don't need those annotations for the exported functions.

Am I understanding this correctly?

I'd love to hear why you chose one approach over the other and what you recommend!


r/learnrust • • 6d ago

Did an idiomatic solution come to me naturally for the first time?

7 Upvotes

New rust learner/hobbyist, trying my hand in embedded software. Started with the discovery book, and in it, chapter 7 is a challenge to make an led roulette. Earlier me would have (and have) written a garbled mess of if/else statements, but this time I thought of doing it with a match statement and I'm kinda proud of that... hopefully this is me starting to think idiomatically :-)

The interesting part of the solution: (I know its a simple problem, and the solution isn't that complicated, but a win is a win...) (All feedback is appreciated, on the code, and on rust journey in general)

struct CurrentFrame {
    matrix: [[u8; 5]; 5],
    pos: (usize, usize),
}


impl CurrentFrame {
    fn next_frame(&mut self) {
        self.matrix[self.pos.0][self.pos.1] = 0;
        match self.pos {
            (_,0) => {
                if self.pos.0>0 {self.pos.0 -= 1}
                else {self.pos.1 += 1} 
            },
            (4,_) => self.pos.1 -= 1,
            (_,4) => self.pos.0 += 1,
            (0,_) => self.pos.1 += 1,
            _ => (),
        }
        self.matrix[self.pos.0][self.pos.1] = 1;
    }
}

r/learnrust • • 6d ago

Suggestions for Rust Course

Thumbnail reddit.com
0 Upvotes

r/learnrust • • 8d ago

Axum un ergonomic?

2 Upvotes

Imagine a route like "/{country}/{city}/{state}" , then you would write the handler like "Path((country,city,state)): Path<String,String,String>" .

The problem (atleast that i cant find first party solution to) is the route and handler will be specified in two different places in your code. But the path type and each elements position depends on the route. This seems very error prone to me.


r/learnrust • • 8d ago

How to manage application state and cross-state operations in Rust?

6 Upvotes

I'm building an app that loads and stores a bunch of structs in memory throughout its execution: plugins, commands, shortcuts etc. I'm trying to figure out how to properly manage application state.

For example, whenever I remove a plugin, I want to ensure that all its child commands are dropped as well. One obvious solution is to define a single struct that holds all the state and methods like add_command, remove_plugin etc. But this collocates unrelated methods and lacks proper namespacing.

If I move these methods to their corresponding structs instead, how should I handle cross-state operations such as removing a plugin and all its associated commands?

What would be the most idiomatic approach in Rust? I've been digging through the net for days, and people often mention ECS as a solution, but isn't that mostly a game dev thing?

Would love to hear your thoughts!


r/learnrust • • 8d ago

Started Rust Journey Today

Thumbnail reddit.com
2 Upvotes

r/learnrust • • 9d ago

Confused about returning a reference in Rust

17 Upvotes

I'm learning Rust, currently studying ownership and borrowing, and I'm confused about what happens when returning a reference from a function.

Here's my code:

fn main() {
    let s1 = String::from("Hello world");
    let word = practice(&s1);
}

fn practice(s: &String) -> &String {
    return &s;
}

My understanding:

  • s in practice is already a reference to a String (&String).
  • When I write &s, am I creating a reference to that reference (&&String)?
  • If so, why does Rust allow this when the function's return type is &String?
  • Does Rust automatically dereference or coerce &&String into &String?
  • Ai said that it does &&String to &String and i know if i am getting a parameter of reference why create another just return the one inputted in function.

I'd appreciate an explanation of what's happening here, especially regarding references, dereferencing, and return types.


r/learnrust • • 10d ago

Borrow Checker

8 Upvotes

So , i read the original book ownership chapter it made sense but then i went to brown unverisity and boy i cant wrap my head around the same concept
see this what i know are:
1.when we create a mutable or immutable refernce to the original owner or its value with *
it removes corresponding permissions
2. When we create a reference pointing to another refernce this part i dont understnd like see above ss it says that after we assign z a mutable reference to *y , y and *y both lose write permission if they both lose write permission then how can i be able to reassign y in next step???

This is my own understanding but if u create a immutable refernce to a *y it only removes write from *y and not Y and if u make a immutbale reference to y itself it removes write from both

plus the rest of book has permisson system too so should i forget what i learned al together and focus on main book or is there a way to learn this permisson thing