Live data from Hacker News

‘~’ is being removed from Rust

github.com

31–40 of 117 posts

Re: ‘~’ is being removed from Rust

#31
post #7
post #5

Earlier quoted context omitted.

> `~` is harder to search for, as well as not on all keyboards. Which keyboards do not have a '~' key? How do those people type a path relative to their home directory? Use $HOME/foo/bar all the time?

Many international keyboards don't have a tilde key. For example it's not shown on the Finnish/Swedish MacBook Pro keyboard at all. It's not difficult to type (Alt+¨ followed by a space), but you can't find it by looking at the keyboard.

That's a specious argument IMO. The same case can be made for the pipe/vertical bar character. So I guess they have to remove that from the language too so Mac users won't be mildly inconvenienced.

Re: ‘~’ is being removed from Rust

#33
post #14

Is this a good time to point out that the language is stabilizing?

It seems to me that the current focus on "do all the breaking changes we want to do so that we can get to 1.0" naturally leads to a prevalence of breaking changes. So in a strange way, yes, this sort of breaking change is evidence of the language stabilizing.

Re: ‘~’ is being removed from Rust

#34
I'll be honest: Rust is kind of losing me with these changes. I started following/tracking the language about a year ago, and I thought the syntax looked really succinct and easily readable back then, but with changes like this, [T] => Vec, the region/lifetime syntax, together with the propensity to abbreviate almost everything, code is quickly starting to look kind of soupy to me.

I get the arguments, and they're logically sound, but in the end it's beginnning to read like C++03.

On the one hand, the Rust community's generalising a lot of stuff, which sounds great, but then adding a bunch of macros (I know, this ain't yo daddy's C macros) to replace first-class citizens ([1, 2, 3] => vec!(1, 2, 3) for example), and I worry how IDEs will be able to handle macros from an autocomplete/intellisense standpoint, not just checking/displaying type information when using them, but also writing new ones.

I guess it's a language primarily by and for text editor users, and I'm beyond that point these days.

As I said, I started following the language daily a year ago, and a couple of months ago I was thinking of jumping in around this point in time, but right now I feel like I want to wait another year to see if the syntax has become more readily intelligible.

I still think it's a fantastic effort, and kudos for all the hard work.

Re: ‘~’ is being removed from Rust

#35
post #19

~ for allocation was weird, but I will miss lack of ~ as analogy to * . Will they change * to `RawPointer ` too? ;) I'm not happy about change of [T] to Vec either. I hope all these changes will make a full circle and get a first-class syntax back.

>first-class syntax Perl-y symbol nonsense is not a first-class syntax

I agree. Syntax should be descriptive first and concise second.

Re: ‘~’ is being removed from Rust

#38
post #31
post #7

Earlier quoted context omitted.

Many international keyboards don't have a tilde key. For example it's not shown on the Finnish/Swedish MacBook Pro keyboard at all. It's not difficult to type (Alt+¨ followed by a space), but you can't find it by looking at the keyboard.

That's a specious argument IMO. The same case can be made for the pipe/vertical bar character. So I guess they have to remove that from the language too so Mac users won't be mildly inconvenienced.

You do not have to type a space though to get a pipe character. Tilde and backtick are the two characters which are hardest to write on a Swedish keyboard.

Re: ‘~’ is being removed from Rust

#39
post #23

Earlier quoted context omitted.

Thanks for the explanation! This change makes the code more clear to me. When I first read some rust code, those ~ and @ are annoying because I don't know their meaning and hard to search them for a explanation. The box keyword is a much better way for developers.

Thank you. That's exactly our thought process too, though there is some reasonable disagreement about it.

I've been reading a bunch of tutorials and such, including the official one, about Rust recently and you'd get the impression that using unique pointers were the norm. This discussion seems to suggest they should be generally avoided. Now I'm not sure if I've just been massively misreading everything (I come from a background in GC languages) or whether the messaging about usage is way off.

Re: ‘~’ is being removed from Rust

#40
post #23

Earlier quoted context omitted.

Thanks for the explanation! This change makes the code more clear to me. When I first read some rust code, those ~ and @ are annoying because I don't know their meaning and hard to search them for a explanation. The box keyword is a much better way for developers.

Thank you. That's exactly our thought process too, though there is some reasonable disagreement about it.

I've been reading a bunch of tutorials and such, including the official one, about Rust recently and you'd get the impression that using unique pointers were the norm. This discussion seems to suggest they should be generally avoided. Now I'm not sure if I've just been massively misreading everything (I come from a background in GC languages) or whether the messaging about usage is way off.
Post reply on HN