4 ms·
>the syntax. It’s ugly. [...] I would prefer something that is less sigil-heavy. That's also one of my gripes with Rust. Very sigil heavy makes it hard to goog
by sebstefan 2y ago
>the syntax. It’s ugly. [...] I would prefer something that is less sigil-heavy.
That's also one of my gripes with Rust. Very sigil heavy makes it hard to google syntax elements. What's the name of the `|` glyph? Especially challenging if you know the name of the glyphs in your language but not in necessarily in english. Double challenging for glyphs with several accepted names
But in the end, I'm big enough to realize that this is not a very important aspect of the language
If it's ugly so be it. I'll still learn it
Also for once Bing Copilot pretty much solved this for me since unlike google search, it's semantic + it doesn't ignore special characters
- SushiHippie 2y agoFYI Wikipedia has pages for every ascii character I think, if you just search for `|` in wikipedia it would redirect you to https://en.wikipedia.org/wiki/Vertical_bar https://en.wikipedia.org/wiki/Vertical_bar Which lists all the common names used for this symbol Here is also a table with all symbols with direct links to the wikipedia pages https://en.wikipedia.org/wiki/ASCII#Character_set https://en.wikipedia.org/wiki/ASCII#Character_set
- rascul 2y agoThis might be useful https://doc.rust-lang.org/reference/tokens.html#punctuation https://doc.rust-lang.org/reference/tokens.html#punctuation
- yencabulator 2y agoThat doesn't seem to explain 'lifetimes or turbo::<Fish>, though.
- steveklabnik 2y agoThe page linked for :: explains the turbofish. That said, you're right that it could use a row for the lifetime syntax.
- yencabulator 2y agoIf you know where to look, you will find it. If you don't, you don't. For someone new to Rust, I don't see why you'd expect them to expect to see a "path separator" between the function name and it's call in x.collect::<Vec<_>>(). A more likely path to discovery is via the Generics link (discovered from "<" being so prominent there), which shows the ::<> syntax in context of const values, and that isn't actually very helpful for understanding.
- steveklabnik 2y agoSo the thing is, the link provided is not really intended to be "teach me what syntax means." It is meant to provide a reference for various tokens. And it does that, because the turbofish isn't a single thing, it's a combination of two things. If the goal of this page was "comprehensively explain Rust syntax to someone who doesn't know Rust," I would agree with you. But it's "produce a spec-like document for experts who want fine-grained details about the language."