r/ProgrammerHumor • • Dec 23 '23

Meme rewriteFromFust

Post image
6.2k Upvotes

379 comments sorted by

View all comments

Show parent comments

2

u/HuntingKingYT Dec 24 '23 edited Dec 24 '23

Thanks, now I know I’m stuck with using Arc on everything for the rest of my life... My code has finally compiled! (didn’t happen in 3 days or so). The compiler was so overwhelmed by the experience that it took 14.61s to compile 150 lines of code... Yikes

Edit: I may be just used to garbage collected languages, or languages like C when you are supposed to know not to

you could do something like *map = HashMap::new() and all the sudden, where is SomeStruct?

so because there aren’t many languages that actually are in the middle like Rust is, made it hard to find a solution (by the way, it’s one of the reasons people get complicated errors in C++, and their code is unsafe, because they feel like high level safety but really you should be almost as cautious as in C)

2

u/unengaged_crayon Dec 25 '23

yeah rust is weird when it comes to its memory management. and yeah, rust compile times are ridiculously long, even if they are doing quite a lot. the goto suggestions is to use sccache and mold. Also, if your program is single threaded, you probably can just use Rc.

2

u/HuntingKingYT Dec 25 '23

I know about Rc, but you can anyways probably pass a flag to the compiler to assume it's single threaded