r/learnrust • • 4h ago

Helpful website for RUST

4 Upvotes

Hey guys, currently i am learning rust, i came from cpp background and sometimes it was too difficult for me to write syntax in rust. Even though we know concepts behind rust, we(like me) dont know all the small functions that are require to do something in easy way, so yesterday i got a situation where i need to sort the string so in cpp we will do like

string s = "myself";
sort(s.begin(),s.end());

but in rust

let word = "myself";
let mut chars = word.chars().collect();
chars.sort();
let s = chars.into_iter().collect();

but i don't know all this methods are there, so i gave a prompt to claude and it created this website for me,maybe useful to you https://rustatlas.vercel.app/

Happy programming!!


r/learnrust • • 19h ago

Pub keyword in rust

3 Upvotes
mod a {
    mod b {
        pub fn hello() {
            println!("Hello ")
        }
    }
    pub fn lol() {
        println!("lol is the best thing");
        b::hello();
    }
}
fn main() {
    crate::a::lol();
}

Can anybody explain why main can direclty access a ???
I tested it with a too and a can access b too?
The point is i dont reallly understand the role of pub in case of making module names public like form the above codes i can infer that the module that creates another module can direcly go inside it but only access pub items (marked with pub keyword like hello function).
Yes, to make main access a module b i need to make module b pub
and laslty explain the implict creation of Crate root of crates
Thanks!


r/learnrust • • 13h ago

i reimpliment unix tool wc -- a period of comfortable time

Thumbnail reddit.com
0 Upvotes

r/learnrust • • 2h ago

Devlog: Optimizing f64 GEMM from 6.5 to ~40 GFLOP/s with a BLIS-style micro-kernel

4 Upvotes

https://adii.fyi/blog/optimizing-matmul-in-rust-from-naive-loops-to-blis/

I wanted to see how far I could push a single-threaded f64 matmul. Started with the usual i-k-j loop, and then spent quite a bit of time looking at asm, then experimenting with SIMD, and eventually working through BLIS-style blocking and packing.

Writing this up was a good way to document the whole process, so thought I'd share it here.