MichaelRaskin has quit [Ping timeout: 256 seconds]
orivej has joined #nixos-borg
jtojnar has quit [Read error: Connection reset by peer]
jtojnar has joined #nixos-borg
MichaelRaskin has joined #nixos-borg
jtojnar has quit [Read error: Connection reset by peer]
jtojnar has joined #nixos-borg
orivej has quit [Ping timeout: 256 seconds]
jtojnar has quit [Remote host closed the connection]
jtojnar has joined #nixos-borg
<gchristensen>
why are Futures so painful
<LnL>
hmm?
<gchristensen>
I find Rust's adoption of Future to be so painful
<gchristensen>
and almost never what I want
<MichaelRaskin>
Rest assured, the inherent behaviour of underlying reality is also never guaranteed to be what you want (and Rust tries to force you to do contigency planning, I guess…)
<gchristensen>
Result<itwentfine,itdidnt> is sufficient for me, and I don't really want to manually embed an event loop in to every function where I interact with a Future library
<LnL>
that's not a future
<gchristensen>
LnL: Result?
<LnL>
yeah, there's no itwentfine because it might not have happened yet
<gchristensen>
right
<gchristensen>
I don't want a Future
<LnL>
sure, you only want to use them in parts that do control flow not implementations
<gchristensen>
LnL: hmm are you saying it is an architectural problem of my own creation?
<LnL>
heh, kind of I guess :p
<LnL>
same goes for a vs Result<a,e>
<gchristensen>
what should I be reading to stop hating Future?
orivej has joined #nixos-borg
<ekleog>
gchristensen: if you hate future, you can just .wait() on each of them, and recover a Result :)
<gchristensen>
definitely the thing I want to pepper my code with
<andi->
Did you look into the upcoming changes to futures yet? (I didn't but being told they are nice)
<ekleog>
well, that's a .wait() per operation where the only API you're given is async and you want it sync, that seems to make sense to me :°
<ekleog>
andi-: I guess you're talking of async/await? they look really nice, but only if you want to actually do an async function, and it's not close to be implemented afaiu (and the syntactic overhead is likely more important than the .wait() for making futures sync, as it'd require at least an await!() call from what I remember of the current discussion about the syntax)