News for hackers. Stuff that matters.
Re:Ask HN: Why aren't modern programming languages, like Rus... by jstx1 on Sunday July 02, 2023 @03:59AM (#36559334)
It's not modern languages, it's Rust specifically - they didn't optimize for readability and ended up with a language that's hard to read.
Re:Ask HN: Why aren't modern programming languages, like Rus... by ilyt on Sunday July 02, 2023 @05:44AM (#36559907)
Not really.

Rust is plain hard and complex. There is only so much you can simplify that.

Like, you can make jet fighter easier by adding ways to automatically make some things so pilot doesn't have to do all the steps (like say Rust does with some of the memory management), but it will never be as easy to fly as it is to drive a bicycle, still need to learn how everything works and what does what

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.

Re:Ask HN: Why aren't modern programming languages, like Rus... by jstx1 on Sunday July 02, 2023 @05:55AM (#36559959)
Programming simple things in Rust is less readable than programming the same things in other languages - and you can directly point at the language design as the root cause for this.

I'm here doing things like creating an object, iterating over some structure, building a simple function, reading or saving some data, making a small REST API - and while I'm doing these things I have to work with complex syntax and language semantics because the same language also caters to use cases that have nothing to do with the thing I'm working on.