News for hackers. Stuff that matters.
Re:Notes on a Smaller Rust by pdpi on Thursday July 18, 2019 @08:02AM (#20468865)
Honestly, I don't see any intrinsic problems with Rust's syntax that makes it unusually ugly.

Rather, I think the problem is that the syntax is 100% fine in isolation, but has some issues when taken together with experience in other languages — when you skim the code, some parts of it beg to be looked at like C++, while other parts push you to read it like a functional language. Unsurprisingly, neither fully works, which makes the experience jarring. Once you accept that Rust is its own language with its own rules and stop trying to borrow (hah!) from your experience with other languages, it feels much better.

Re:Notes on a Smaller Rust by sagichmal on Thursday July 18, 2019 @09:23AM (#20469471)
> Honestly, I don't see any intrinsic problems with Rust's syntax that makes it unusually ugly.

You literally just got a user experience report claiming that it is.

Re:Notes on a Smaller Rust by munmaek on Thursday July 18, 2019 @10:05AM (#20469878)
It's coming from someone who isn't comfortable with C or Java either.

There's no winning over everyone. Of course Rust's syntax will be completely jarring if you're coming from Crystal or Ruby.

In my personal experience it's a little jarring at first and then it completely goes away.

Re:Notes on a Smaller Rust by spease on Thursday July 18, 2019 @12:44PM (#20471589)
I’m comfortable with C/++ and Java, to a greater extent than a lot of people I’ve worked with. There are still things in Rust that are papercuts:

* The need to put :: before <> in expressions for generic parameters, but not in type signatures.

* Using :: instead of just . even though most of the time the naming convention will delineate the difference anyway

* Error handling with futures

* Self-referential structs

* Passing a shared pointer through multiple move closures

IMHO the frustration involved in these things is not typically worth being more explicit. The :: thing may seem a bit pedantic, but it is simply more physical effort (Shift-colon-colon vs dot) and creates more visual noise.

If/when all of the things above are addressed, I think Rust could give Python a run for its money.

Re:Notes on a Smaller Rust by guiriduro on Thursday July 18, 2019 @08:48AM (#20469177)
Oh yeah, I totally get that with Nim's * (export symbol), just can't get past my 20 years ago c++ pointer syntax brain wiring, even though I've barely touched it since. Always needs a double-take, which spoils reading flow.
Re:Notes on a Smaller Rust by sixbrx on Thursday July 18, 2019 @11:08AM (#20470592)
Agree and also I think the main issue is that parts of the syntax are pointing to ideas that are not present in common languages, but which are essential in Rust. They aren't merely syntactical choices and can't be papered over or omitted. If you don't want to consider these concerns (like lifetimes) then it's probably not the language for you and changes in syntax won't help (much) there.
Re:Notes on a Smaller Rust by Spartan-S63 on Thursday July 18, 2019 @09:58AM (#20469804)
I had many many false starts back in 2014 when I tried learning Rust. It took me to stop comparing it or thinking about it like C++ (syntactically and semantically) in order for me to get it. Now, I’d consider myself reasonably fluent in Rust.

I don’t mind the syntax because I find it explicit enough, but terse enough in certain cases. It’s similar but different and so it rhymes with my past in C++, but it’s not the same.