Possible alternative to tilde/`?` using bound-like syntax
## Opinion I stumbled upon this repo as a complete outsider, and one of the things that stood out to me was the syntax. Taking an example from the book: ```rust ~async fn async_find<I>( iter: impl ~async Iterator<Item = I>, closure: impl ~async FnMut(&I) -> bool, ) -> Option<I> ``` Or (I think) its equivilant `where` ```rust ~async fn try async_find<It, Cl, I>(iter: It, closure: It) -> Option<I> where: It: ~async Iterator<Item = I>, Cl: ~async FnMut(&I) -> bool ``` I find it a bit difficult to read: - To somebody new to the syntax, there's nothing that really indicates the "asyncness" of the function is related to the asyncness of the iterator and closure. - `~` is a destructor in c++, bitwise NOT in C and some others, and used to be a heap operator in former Rust. Its usage for "if and only if" relationships is foreign to me and not super intuitive (maybe some other languages use something similar, I'm not aware) - `~` on its own is kind of a weird character, it's the same width as a letter but sort of visually floats. So it means that if some functions on a page are `~async` and some aren't, the `fn` keywords misalign just enough to be mildly annoying: ```rust async fn foo(F: impl async Iterator) ... ~async fn bar(F: impl ~async Iterator) ... async fn some_other_foo(F: impl async Iterator) ... ``` The last thing is a very subjective visual nitpicks, but I think in general this syntax has a potential to get a bit messy (are combinations like `~cons
Posted by tgross35 on Feb 1, 2023, 10:19 PM
Tags
Related issues
- To be fair, Inform7 can't succeed, generally, because there is no market for the kind of games that you create with Inform7.
- > The notion that somehow LR reliability is misunderstood by Consumer Reports, JD Power, Car & Driver, Automobile etc.
- Custom trigger IDs are not displayed in the new 2026.10 trigger selector
- I hate that too, but I think it’s more the ux than the concept of a default.
- > The biggest problem with UX developers is they know better than you AND force you into their paradigm.
- "Focus follows mouse" is what I use to keep the file manager from popping up when click-dragging files.
Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments
ux (Other)
To be fair, Inform7 can't succeed, generally, because there is no market for the kind of games that you create with Inform7.
New> The notion that somehow LR reliability is misunderstood by Consumer Reports, JD Power, Car & Driver, Automobile etc.
Custom trigger IDs are not displayed in the new 2026.10 trigger selector
I hate that too, but I think it’s more the ux than the concept of a default.
> The biggest problem with UX developers is they know better than you AND force you into their paradigm.
"Focus follows mouse" is what I use to keep the file manager from popping up when click-dragging files.
The biggest problem with this is if the target URL doesn't load but also doesn't quickly error out, like e.g.
Google wants to build up a private web here.
Possible alternative to tilde/`?` using bound-like syntax
## Opinion I stumbled upon this repo as a complete outsider, and one of the things that stood out to me was the syntax. Taking an example from the book: ```rust ~async fn async_find<I>( iter: impl ~async Iterator<Item = I>, closure: impl ~async FnMut(&I) -> bool, ) -> Option<I> ``` Or (I think) its equivilant `where` ```rust ~async fn try async_find<It, Cl, I>(iter: It, closure: It) -> Option<I> where: It: ~async Iterator<Item = I>, Cl: ~async FnMut(&I) -> bool ``` I find it a bit difficult to read: - To somebody new to the syntax, there's nothing that really indicates the "asyncness" of the function is related to the asyncness of the iterator and closure. - `~` is a destructor in c++, bitwise NOT in C and some others, and used to be a heap operator in former Rust. Its usage for "if and only if" relationships is foreign to me and not super intuitive (maybe some other languages use something similar, I'm not aware) - `~` on its own is kind of a weird character, it's the same width as a letter but sort of visually floats. So it means that if some functions on a page are `~async` and some aren't, the `fn` keywords misalign just enough to be mildly annoying: ```rust async fn foo(F: impl async Iterator) ... ~async fn bar(F: impl ~async Iterator) ... async fn some_other_foo(F: impl async Iterator) ... ``` The last thing is a very subjective visual nitpicks, but I think in general this syntax has a potential to get a bit messy (are combinations like `~cons
Comments (0)
No comments yet. Start the discussion.