3 ms·
Yeah, I guess * :: is the same as in many other languages * & too * ! is unique, I guess * The format string stuff is based on ... C#/Python stuff? I forget
by steveklabnik 8y ago
Yeah, I guess
* :: is the same as in many other languages
* & too
* ! is unique, I guess
* The format string stuff is based on ... C#/Python stuff? I forget exactly.
* _ => () is composing three other bits of syntax that aren't unusual on their own
* <> is genrics, like in many languages
* [T] is slices, which are not entirely unique but are also similar to array stuff which uses []s
Thanks for elaborating, it's helpful to understand the perspective.
- Cyph0n 8y ago:: probably looks unfamiliar to anyone who hasn’t worked in C++, PHP, or Perl.
- ternaryoperator 8y ago:: is used in Java too, ever since Java 8.
- oblio 8y agoSo 50% of Java devs :)
- kungtotte 8y agoIt might be hard for someone who writes Rust every day to see it, but it has a lot of special characters compared to many languages. It also has less or equal amounts compared to other languages, of course, but I dislike that aspect of those languages too :) Compare these two listings: http://rosettacode.org/wiki/Stack#Simple_implementation http://rosettacode.org/wiki/Stack#Simple_implementation http://rosettacode.org/wiki/Stack#Nim http://rosettacode.org/wiki/Stack#Nim You can see directly that Rust has a lot more there. Obviously Nim skips out on braces so that's a gimme, but I don't really count block braces when I'm talking about special characters. It's more stuff like Option<&'a Frame<T>> or &'a mut T or ->
- steveklabnik 8y ago> It also has less or equal amounts compared to other languages, of course, but I dislike that aspect of those languages too :) Yeah, thanks, I think this is at the root of a lot of it. > It's more stuff like Option<&'a Frame<T>> or &'a mut T or -> Yeah; some of the stuff isn't needed anymore; you can drop the : 'a s, for example. And we have been talking about allowing some more elision, so pub struct Iter<'a, T: 'a> { next: Option<&'a Frame<T>>, } could be pub struct Iter<'_, T> { next: Option<&Frame<T>>, } when all is said and done. The '_ in the signature is important so that you know it's parameterized by a lifetime, so we don't plan on ever getting more concise than that.