News for hackers. Stuff that matters.
Re:Unsoundness in Pin by kibwen on Friday November 29, 2019 @11:09AM (#21665136)
Agreed that `Pin` is imposing by dint of trying to provide "more fundamental" guarantees than Rust was originally designed for (see my sibling comment on this topic). Though ideally in the long run I'd hope that no regular user would ever have to encounter it (right now I think it may show up in some contexts related to futures, but as Rust's async story matures I would hope to see that need diminish).
Re:Unsoundness in Pin by jeltz on Friday November 29, 2019 @11:13AM (#21665155)
Ideally the basic building blocks of Rust should be so easy to understand that any experienced Rust developer could use them too and not just the core team.

The cases where I personally wanted Pin were cases that I think will be solved in the future as async improves, but there are probably other more fringe cases which wont.

Re:Unsoundness in Pin by kibwen on Friday November 29, 2019 @11:30AM (#21665248)
Absolutely, I don't think there should be arbitrary barriers to entry for people who wish to dive into the deepest parts of Rust's type system. Finding a suitable replacement for `Pin` would be such a big task that I'd say it's not worth considering for anything short of a hypothetical "Rust 2", but hopefully in the meantime we'll soldier on and get a better idea of the problem space in the meantime.
Re:Unsoundness in Pin by fluffything on Friday November 29, 2019 @12:11PM (#21665504)
Pretty much anybody writing `async` code, using `Futures`, etc. needs to deeply understand `Pin`, pinning, etc.

Otherwise it is impossible to become productive with that part of the language.

Re:Unsoundness in Pin by staticassertion on Friday November 29, 2019 @12:51PM (#21665764)
I write async code and I have never, ever used Pin.
Re:Unsoundness in Pin by steveklabnik on Friday November 29, 2019 @12:17PM (#21665551)
End users will almost never need to deal with pinning whatsoever; they'll be writing code with async/await.
Re:Unsoundness in Pin by the_mitsuhiko on Friday November 29, 2019 @02:27PM (#21666248)
Even with async await it’s not hard to run into it. The moment you end up wanting to box a future you run into pin.
Re:Unsoundness in Pin by Matthias247 on Friday November 29, 2019 @01:35PM (#21665986)
I think it depends on what the users are doing:

If they use async code as just a more office synchronous/threaded code, with purely linear control flow, then no knowledge of Pin is required. The users just sprinkle awaits and are good with it.

If users also explore the areas of which are more unique to async code (e.g. real concurrency, select!, custom combinators, cancellation mechanisms, etc) than they will indeed run fairly early into Pin.

I guess the majority of users who anticipated async/await fall into the first category. Most projects and requests around async code seem to be "just" webservers which handle some APIs. That will likely be the domain where one can live fairly well without Pin - at least if you do not implement the underlying webserver.

Re:Unsoundness in Pin by withoutboats on Friday November 29, 2019 @01:08PM (#21665862)
This was certainly not our intention, or what I've heard from users.
Re:Unsoundness in Pin by fluffything on Tuesday December 03, 2019 @04:51AM (#21691139)
How on earth do you write your own `Future` type without understanding pinning ? Or your own combinator? Or executor ? Or how do you understand the error messages when trying to Box or Rc a future? Or write an `async` abstraction over some C FFI component that you need to use? Or...

If the goal was for users to just use high-level web frameworks, and when there is something that the framework cannot do (which is currently a lot), the expectation is that users should just shrug their shoulders and tell their bosses "Sorry boss, Rust can't do that", then sure, there is no need to understand pinning. But such users do not need to use Rust either, an pretty much any other programming language like Go or Python would have been a much better fit for them.

Re:Unsoundness in Pin by withoutboats on Tuesday December 03, 2019 @08:16AM (#21691984)
There is a huge gradient of use cases between "high level web frameworks" and "writing everything from scratch" and we've thought about the impact on users at every step of that gradient. But I'm not about to explain it to you, because you are being disingenuous and aggressive.
Re:Unsoundness in Pin by fluffything on Wednesday December 04, 2019 @05:32PM (#21707953)
And even for the user that only uses high level web frameworks, the moment that user needs to debug its program (which might have a bug in its executor), it needs to understand pinning.

I don't see any use case in which understanding pinning is not necessary.

Re:Unsoundness in Pin by withoutboats on Tuesday December 10, 2019 @02:24PM (#21755905)
There's miles between understanding pinning well enough to call `Box::pin` (a safe API) and understanding pinning well enough to call `Pin::get_mut_unchecked` (an unsafe API). When we talk about understanding pinning, we mean the latter.