News for hackers. Stuff that matters.
Re:Ask HN: Why aren't modern programming languages, like Rus... by adastra22 on Sunday July 02, 2023 @06:04AM (#36560003)
Gonna have to hard disagree here. Rust developers straight up opted for obscure, weird, idiosyncratic, non-self-explanitory syntax.

'?' doesn't mean anything like what it means in every other programming language, and it's everywhere. It is so frequently used that you get used to it pretty quick, but it is very not obvious to a beginner.

Obscure #[blah(blah)] attributes attached to nearly every line of code in some places. Do those have meaning? Are they just hints to the compiler? You'd better hit the docs to find out.

Do I need a &mut Option<Thing>, or an Option<&mut Thing>? And how do I get that out, as a `opt.as_ref().mut()`, `opt.as_ref_mut()`, or &mut *opt`? Are these valid? What's the difference? Idk, it's inscrutable.

Rust syntax really, really sucks my friend.

Re:Ask HN: Why aren't modern programming languages, like Rus... by jstx1 on Sunday July 02, 2023 @06:14AM (#36560060)
> Do I need a &mut Option<Thing>, or an Option<&mut Thing>?

Follow up to this example: let's say that I don't know the answer, what do I search for if I want to find out?

Re:Ask HN: Why aren't modern programming languages, like Rus... by adastra22 on Sunday July 02, 2023 @06:22AM (#36560096)
Man, I don’t even know. It’s ungoogleable.

The only thing that keeps this from being as big an issue as it ought to be is that rustc’s error output is really, really good. Usually it tells you how to fix it.

Re:Ask HN: Why aren't modern programming languages, like Rus... by orwin on Sunday July 02, 2023 @10:13AM (#36561665)
It's more of an issue with rust concepts, not syntax. I had the same issue when I wrote lisp the first time (and it ended up being a pretty complex finite state machine).

The second part of your question is bad syntax however, I agree (but still, 90% of the unscrutability of rust is caused by its concepts imho).

Re:Ask HN: Why aren't modern programming languages, like Rus... by zelphirkalt on Monday July 03, 2023 @04:08AM (#36570153)
> Do I need a &mut Option<Thing>, or an Option<&mut Thing>?

That depends on what you want. Do you want the address to a mutable Option of a Thing, or do you want an Option of an address of a mutable Thing? The mental model you have of your code should make this rather clear.

Re:Ask HN: Why aren't modern programming languages, like Rus... by InsanityBlossom on Wednesday July 05, 2023 @03:01AM (#36596562)
I think you just don't need Rust. Your comment suggests that you didn't even try to learn the language or maybe hoped that you'll master it just by looking at it?

It's a complex language with unique properties, and it's syntax was carefully crafted towards it's goals - high performance, close to hardware, no runtime, memory safety etc.