News for hackers. Stuff that matters.
Re:Was Rust Worth It? by PartiallyTyped on Thursday October 26, 2023 @02:32AM (#38022397)
Surprisingly, I am faster in Rust than any other language. Something about my prior experiences just made it click just the right way. I don't want to program in anything else anymore. I don't want to deal with obscure C++ error messages, C footguns and lack of ergonomics, I don't want to deal with abstraction hell of Java, or the poor person's typing that python has.

I have been programming in Python for the past 6 years, I know all sorts of obscure details, and with rust, I just don't need to think about all of those issues.

Re:Was Rust Worth It? by goku12 on Thursday October 26, 2023 @04:15AM (#38023065)
> Surprisingly, I am faster in Rust than any other language.

Not really surprising, given that you have C and C++ background. That's what I was trying to highlight. Rust isn't a confusing or unproductive language as many project it to be - if you have the conceptual understanding of what happens on the hardware. Especially about stack frames and RAII. If you know those, the borrow checker complaints will immediately make sense and you will know how to resolve them.

Add rust-analyzer (Rust's language server) to it, you get real-time type annotations and a way to match types correctly in the first attempt. In my experience Rust also helps structure your program correctly and saves a ton of time in debugging. All in all, Rust is a fast way to write correct programs.

Re:Was Rust Worth It? by PartiallyTyped on Thursday October 26, 2023 @04:30AM (#38023157)
I'd add that if you have some understanding of how memory ownership should be such that you don't end up with memory leaks, you are fine. The borrow checker just verifies that your mental model is correct, and removes some of the cognitive load from you.
Re:Was Rust Worth It? by ayewo on Thursday October 26, 2023 @09:10AM (#38025031)
> if you have some understanding of how memory ownership

What reading materials will help me level up my understanding of this?

Re:Was Rust Worth It? by caskstrength on Thursday October 26, 2023 @06:30AM (#38023817)
> Rust isn't a confusing or unproductive language as many project it to be - if you have the conceptual understanding of what happens on the hardware. Especially about stack frames and RAII. If you know those, the borrow checker complaints will immediately make sense and you will know how to resolve them.

I have reasonable understanding of "what happens on the hardware" (been writing kernel code for years), know modern C++ (with RAII and stuff) and Rust is confusing and unproductive language for me.

Re:Was Rust Worth It? by mst on Thursday October 26, 2023 @10:02AM (#38025704)
I get the feeling that learning rust can be a "bang your head against it until you get an 'aha' moment" sort of affair, much like learning git.

Some people pick up rust quickly because it clicks into their brain early, some take longer or end up bouncing off.

Re:Was Rust Worth It? by goku12 on Thursday October 26, 2023 @11:00AM (#38026472)
I had university courses on computer architecture and assembly, even before I took up Python as a hobby. I did have a little C experience before that. My entire perspective on Rust type system from day 1 (back in 2013, before Rust 1.0) was based on the hardware (primarily stack frames) and problems I had with assembly and C. There was never a point where the borrow checker didn't make sense. This is why I insist that Rust isn't hard to understand if you learn the hardware on which it runs.

Back then, people were debating the design decisions that led to the borrow checker, in public for everyone to see (on Reddit and IRC). They were trying to avoid memory safety issues in Firefox and Servo. They were even a bit surprised to discover that the borrow checker solved many concurrency bugs as well.

Re:Was Rust Worth It? by PartiallyTyped on Thursday October 26, 2023 @11:34AM (#38026961)
I took a different route to Goku (other commenter), I used to write a lot of C and C++ in university, did everything there, up until 2018-ish, I got a bit into rust and things just clicked, my understanding of memory was just not that good enough, and then my C skills skyrocketed as a consequence of learning proper memory management.

Then I got into Haskell, and functional programming, that made thinking about traits, immutability, and all functional aspects a breeze.

Then finally, I got into rust again, use it at work and personal projects. Somehow I managed to rewrite a project that took me 4 months in Python in about 4 days. It was faster, more robust, cleaner, and I could sleep at night.

Re:Was Rust Worth It? by mcronce on Monday October 30, 2023 @09:47AM (#38069419)
My background is PHP, Python, and Go, and I have the same experience as GP