Callback evaluation for asynchronous I/O through a bespoke I/O runtime. Think something like Socket<Delegate> where Delegate is your callback-handling trait, in places where you have a HttpProtocol that specializes on Socket and needs to self register as the Delegate. Impossible without HKT, but GATs enable this with a little trait tomfoolery.
The funny thing is at last job I needed GATs to do something tricky. Now for the life of me I can’t remember the details, but it’s a pretty big deal to have associated types that are easily generic. Just the lending iterator alone can allow things that are rather simple in scripting languages but restricted in earlier versions of rust.
GATs are pretty huge right? I feel like I’ve seen “we could do X if we had GATs” all over the place.
It will allow us to specialize our callbacks with their owning type and therefore rely on static dispatch instead of dynamic dispatch.
That’s pretty sick, in what context if you can share?
Callback evaluation for asynchronous I/O through a bespoke I/O runtime. Think something like
Socket<Delegate>
whereDelegate
is your callback-handling trait, in places where you have aHttpProtocol
that specializes onSocket
and needs to self register as theDelegate
. Impossible without HKT, but GATs enable this with a little trait tomfoolery.The funny thing is at last job I needed GATs to do something tricky. Now for the life of me I can’t remember the details, but it’s a pretty big deal to have associated types that are easily generic. Just the lending iterator alone can allow things that are rather simple in scripting languages but restricted in earlier versions of rust.
I need GATs so the Presto client library can go stable instead of nightly only.
This is the client I’m talking about: https://github.com/nooberfsh/prusto