Earlier quoted context omitted.
> It was a good signal to me that you are overthinking into the architecture if that is really required. Sure, maybe I don't need to statically guarantee the correct execution of code that could easily just throw at runtime instead, but it sure is a fun hobby.
Lifetime subtyping is normally not much necessary to ensure the correctness, provided that you are working at the sufficiently high level (so, say, std is available) and do have some freedom in the design. It often indicates that you are excessively avoiding heap allocations.
Rust's Ugly Syntax (2023)
161–170 of 171 posts
Re: Rust's Ugly Syntax (2023)
#162People that complain about Rust's syntax never have never seen C++ at its worst
Re: Rust's Ugly Syntax (2023)
#163Earlier quoted context omitted.
The only calls to change the lifetime syntax have been coming from "outside the house". Rust developers are fine using the ' as the lifetime sigil and there are no calls from within the Rust community to change it. Adding a keyword would increase the verbosity substantially.
When is someone a Rust developer and why do you assume that I am not one? edit: -4 points on my parent comment for a totally valid opinion, not violating any commenting guide line (please enlighten me). However, for the down voters: "Please don't use Hacker News for political or ideological battle. That tramples curiosity."
Turning `'` into `lifetime` would make Rust code that needs explicit lifetimes extremely verbose. That would make code harder to keep on the same line, for no added benefit in expressiveness.
Allowing both `'` and `lifetime` in the syntax would make the language more confusing to anyone who is learning it, and it opens up unproductive debates about syntax in code bases if two authors have conflicting preferences.
Re: Rust's Ugly Syntax (2023)
#164Earlier quoted context omitted.
The use of ' as a symbol that has any meaning on it's own has got to be one of the most stupid choices I've seen in a language. It's made worse by the fact that you can still use '...' as s character literal. Not only is is incredibly ugly it's also rather confusing, but it fits well into how I view Rust, complicated for the sake of making the developers look smart. It wouldn't fit the syntax of the language obviousl…
Lisp variants have used the ' prefix as shorthand for the quote operator (interpret whatever comes next as a literal, instead of evaluating it) since about the time C became popular...
Re: Rust's Ugly Syntax (2023)
#165Earlier quoted context omitted.
When is someone a Rust developer and why do you assume that I am not one? edit: -4 points on my parent comment for a totally valid opinion, not violating any commenting guide line (please enlighten me). However, for the down voters: "Please don't use Hacker News for political or ideological battle. That tramples curiosity."
I don't think that you violated any guidelines. I think that the downvotes for your parent comment are only an expression of disagreement with what you propose. If I can suggest, don't take it personally. Turning `'` into `lifetime` would make Rust code that needs explicit lifetimes extremely verbose. That would make code harder to keep on the same line, for no added benefit in expressiveness. Allowing both `'` and `…
Of course, mixing keywords single quotes is confusing, but currently the single quote is also confusing.
Just to illustrate: The keyword could just be called lif, which has the same length as dyn.
Re: Rust's Ugly Syntax (2023)
#166Earlier quoted context omitted.
Now there are too many colons.
Original code contains more. (::). Personally I don't understand why there are `::` and `.` to access deeper namespace levels. It's a static language, compiler should know how to resolve attributes and `.` should be enough for all cases.
Re: Rust's Ugly Syntax (2023)
#167Earlier quoted context omitted.
Original code contains more. (::). Personally I don't understand why there are `::` and `.` to access deeper namespace levels. It's a static language, compiler should know how to resolve attributes and `.` should be enough for all cases.
It's because then you could have name collisions between variables and modules. E.g. it's ambigious whether io.Error is in a module called io, or a field of a variable called io. Which means you can no longer use fully qualified names regardless of context.
How about don't shadow module names with variables if you want to use it? It works amazingly well for a bunch of other languages.
Re: Rust's Ugly Syntax (2023)
#168Re: Rust's Ugly Syntax (2023)
#169People that complain about Rust's syntax never have never seen C++ at its worst
C++ is relatively easy to read. The only troubles I had is reading STL's sources because of all _ and __ prefixes, and understanding template errors from compiler, but that will soon be fixed with concepts.
Only if you suffer from a very high level of stockholm syndrome, that is. Rust's syntax is vastly clearer than C++ in basically all circumstances.
Re: Rust's Ugly Syntax (2023)
#170Earlier quoted context omitted.
I'm a big Rust fan, but async Rust is an abomination.
I love async Rust. Its implementation is marvelous. Sueper plasant to write now that * async closures * async trait fns, * `impl Trait` everywhere are in place.