Hacker News new | ask | show | jobs
by thaunatos 3380 days ago
> * Futures is a crate that provides a common abstraction for delimited continuations

I'm familiar with Java Futures, but can't tell if it's the same concept as what you're talking about. What exactly is a "delimited continuation"?

3 comments

The best analogy I can give is to JavaScript promises, where you can do something once the future is resolved. In Java, this would be like the CompletableFuture class's thenApply function -- where you can write code that picks up once the future has been resolved.

A "delimited continuation" is that basic idea of having your code pick up once a future finishes executing.

They are roughly comparable, yes. Here's the explanation of futures specifically https://tokio.rs/docs/getting-started/futures/
Something like a -> (b -> r) -> r/the Cont monad?

E: I meant to reply to a a sibling.