Live data from Hacker News

Was Rust Worth It?

jsoverson.medium.com

251–260 of 736 posts

Re: Was Rust Worth It?

#251

> It also looks like (soon) you’ll finally be able to configure global lints for a project. Until now, you had to hack your solution to keep lints consistent for projects. > I questioned my sanity every time I circled back around to the Clippy issue above. Surely, I was wrong. There must be a configuration I missed. I couldn’t believe it. I still can’t. Surely there must be a way to configure lints globally. I quadru…

We just have a script that adds the lints to any lib.rs or main.rs files that runs on commit. ezpz

Re: Was Rust Worth It?

#252

A key factor in selecting language is ChatGPT. I need to use ChatGPT as a programming sidekick/pair programmer/mentor. Yes, I am not afraid to admit - I need an AI assistant and won't program without it - AI is far too valuable. If ChatGPT struggles with a programming language that is a big problem. I have had a great experience with ChatGPT with TypeScript, SQL, Python, golang, C++. I tried ChatGPT with Rust and it…

I tried for a long time for chatgpt to help me write a simple function that generated a random array and then summed along the columns. Could not do it. Pasting in an error message, made chatgpt spit out another version of the code with some other error.

Go to ChatGPT and type "write a simple function that generated a random array and then summed along the columns".

Run it. If there is an error, either debug it or ask ChatGPT to take a different approach.

There's something wrong if you can't get it to do this.

Re: Was Rust Worth It?

#253

Programming in Rust is really not like being in an abusive relationship. The compiler is trying to help out as much as possible, especially since rustc has the best error messages in the world.

> The compiler is trying to help out as much as possible, especially since rustc has the best error messages in the world. Generally good, but man do I hate how any error in my async function causes every recursive call site to generate an error about how the Future is no longer Send and Sync. Literally an entire console scrollback of errors with the actual syntax error buried somewhere in the middle.

I believe this is in our radar and waiting on the new trait solver, but just in case if you have a repro I would appreciate a ticket to improve the diagnostic.

Re: Was Rust Worth It?

#254
post #95

I'm learning Rust because it seems clear that it's going to be important professionally. I wish I loved it, I really do. I see the benefits. But, at least so far, it's one of the most unpleasant languages I've used. I keep hoping that as I gain proficiency, I'll stop disliking it, but as I climb higher on the learning curve, I'm not really warming to it. It's fine. It won't be the only language I'll be proficient in…

The lack of default/named function arguments is what still gets me. It's such an absolute basic programmer ergonomics feature shared by most popular languages; even C++ has had defaults since forever.

Re: Was Rust Worth It?

#256
post #239

Earlier quoted context omitted.

> A good C compiler does this when you turn on all the flags. I like languages/compilers that let you selectively disable the screaming and let you write bad code on purpose. Bad code that works but can be written fast is often better than perfect code that takes forever to write. Once you have a bad but working POC, you can make it less bad. Rust supports that. Just mark everything unsafe.

"Just mark everything unsafe" seems to be the motto of many (most?) crate developers. There's so much "unsafe" in dependencies used by so many Rust programs. It's a timebomb waiting to go off.

80% of crates have no unsafe code in them.

Re: Was Rust Worth It?

#257
post #6

Earlier quoted context omitted.

Agreed. The other thing I don’t really like is that you can’t split up things in the rust namespace hierarchy between crates (something that’s natural with jars in JVM). I would have liked to have defined things so that I could have the unicode handlers for finl live in finl::unicode, the parser in finl::parser, etc. but because they’re in separate crates rust gets upset about finl being defined twice and there’s no…

Would re-exporting partially solve your problem?

As I recall, I could do something where I could have a common root crate that would import and re-export the other crates with the namespaces modified on the exports and then control which crates are exported through feature gates, but it just seemed more hassle than it was worth.

Re: Was Rust Worth It?

#258
post #95

I'm learning Rust because it seems clear that it's going to be important professionally. I wish I loved it, I really do. I see the benefits. But, at least so far, it's one of the most unpleasant languages I've used. I keep hoping that as I gain proficiency, I'll stop disliking it, but as I climb higher on the learning curve, I'm not really warming to it. It's fine. It won't be the only language I'll be proficient in…

As a counter example, I love programming in Rust. Fighting the borrow checker ended a long time ago. Even the errors are rare these days, except in cases I trigger them in order to examine the types. Rust compiler also seems to have improved in accepting broader cases that are valid.

For me, the key to understanding the borrow checker was understanding the underlying memory model. Rust memory model is the same as that of C, with some extensions for abstractions like generics. The borrow checker rules seem arbitrary at first. But it's deeply correlated to this memory model. The real value of the borrow checker is when I trigger it unintentionally. Those are bugs that I made due to lapse in attention. What scares me is that another language like C or C++ might simply accept it and proceed.

Yet another pleasant side effect of Rust's strict type system and borrow checker is that they gently nudge you to properly structure your code. I can say for certain that Rust has improved my code design in all the languages that I use.

Re: Was Rust Worth It?

#259
post #157

I feel like Rust finally broke the idea that programmers should be in complete control and completely conscious of everything the compiler is doing. It hasn't been that way in decades, compilers are freaking magic. But Rust undid a lot of that with borrowing. People became comfortable with the compiler knowing better than them. I just wish we could relax further: We should never be explicitly iterating forward over a…

> Give me rusty bash. Bash with types (especially floats), fewer edge cases, functions with explicit parameters, simple command line flags...

Sounds like nushell: https://www.jntrnr.com/case-for-nushell/

Re: Was Rust Worth It?

#260

Earlier quoted context omitted.

Yes, and all of those have had major security issues caused by their lack of foresight. "We're pretending security is not an issue." has been the feedback every time this is raised with the Cargo team. To be honest, it's turned me off Rust a little bit. The attitude of "Rust is memory-safe, so we don't need any other form of security." is not a good one.

> "We're pretending security is not an issue." has been the feedback every time this is raised with the Cargo team. Literally nobody has said this. > The attitude of "Rust is memory-safe, so we don't need any other form of security." is not a good one. Fortunately it's an attitude that nobody in the Rust project has!

> Literally nobody has said this.

I know of a few people, personally, who have said this.

Post reply on HN