‘~’ is being removed from Rust
github.com
‘~’ is being removed from Rust
1–10 of 117 posts
Re: ‘~’ is being removed from Rust
#2Re: ‘~’ is being removed from Rust
#3That said, I don't think it will be. It's only really useful in function signatures, since types are inferred everywhere else, and `~` is harder to search for, as well as not on all keyboards. Plus, in Rust, you should always use stack allocation unless you absolutely have to, and so making heap allocation a little more weighty syntax-wise fits with the goals of the language. `~` -> `box` isn't that much heavier, either.
1: One way it's a superset: previously, only `~` supported 'placement new', and now, all pointers can with `box`. `box` also allows you to specify which allocator you'd like to use.
Re: ‘~’ is being removed from Rust
#4That was one of my most used features. This stinks!
Re: ‘~’ is being removed from Rust
#5Here's a quick summary: Rust is adding a new capability, `box`, which is a superset of the existing pointer functionality.[1] Therefore, this special case is being removed, and, if it turns out that `~` is missed, sugar can be re-introduced to bring it back. That said, I don't think it will be. It's only really useful in function signatures, since types are inferred everywhere else, and `~` is harder to search for, a…
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?
Re: ‘~’ is being removed from Rust
#6Here's a quick summary: Rust is adding a new capability, `box`, which is a superset of the existing pointer functionality.[1] Therefore, this special case is being removed, and, if it turns out that `~` is missed, sugar can be re-introduced to bring it back. That said, I don't think it will be. It's only really useful in function signatures, since types are inferred everywhere else, and `~` is harder to search for, a…
> `~` 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?
Re: ‘~’ is being removed from Rust
#7Here's a quick summary: Rust is adding a new capability, `box`, which is a superset of the existing pointer functionality.[1] Therefore, this special case is being removed, and, if it turns out that `~` is missed, sugar can be re-introduced to bring it back. That said, I don't think it will be. It's only really useful in function signatures, since types are inferred everywhere else, and `~` is harder to search for, a…
> `~` 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?
It's not difficult to type (Alt+¨ followed by a space), but you can't find it by looking at the keyboard.
Re: ‘~’ is being removed from Rust
#8Here's a quick summary: Rust is adding a new capability, `box`, which is a superset of the existing pointer functionality.[1] Therefore, this special case is being removed, and, if it turns out that `~` is missed, sugar can be re-introduced to bring it back. That said, I don't think it will be. It's only really useful in function signatures, since types are inferred everywhere else, and `~` is harder to search for, a…
> `~` 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?
Re: ‘~’ is being removed from Rust
#9Here's a quick summary: Rust is adding a new capability, `box`, which is a superset of the existing pointer functionality.[1] Therefore, this special case is being removed, and, if it turns out that `~` is missed, sugar can be re-introduced to bring it back. That said, I don't think it will be. It's only really useful in function signatures, since types are inferred everywhere else, and `~` is harder to search for, a…
> `~` 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?
Most euro keyboards need at least AltGr + key, possibly 2 keys (because ~ is a dead key, so a space is needed to insert the character itself)
> How do those people type a path relative to their home directory? Use $HOME/foo/bar all the time?
It's common to `cd; cd foo/bar`
Re: ‘~’ is being removed from Rust
#10A lot of people respond as if he made the following two claims:
1) Recursive data structures are rare
2) Singly linked lists are useless
When in fact he made these two claims:
1) definitions of recursive data structures are not prevalent in code
2) unshared singly-linked lists are not useful
#1 is true since you define a recursive data structure only once, no matter how often you use it.
#2 is slightly less obvious. One of the big advantages of a singly linked-list over other structures is that you can share tails with multiple lists. With unique ownership that advantage goes away. (There is still the use-case of loaning out tails, but that is a fairly weak argument).
Another advantage of a singly-linked list is ease of implementation; that is negated when your standard library provides dynamic arrays and stacks already baked in.