logoalt Hacker News

rtfeldman • yesterday at 2:14 PM • 2 replies • view on HN

The short answer is that it's like Go - Roc's effectful functions can be "silently nonblocking," so they can have the runtime characteristics of async without having to label functions as async (or call them with await).

That's why both Go and Roc are able to be competitive with languages that have async/await on webserver throughput benchmarks!


Replies

vipshek • yesterday at 2:35 PM

Very interesting. In practice, I wonder if most platforms will end up implementing some kind of async data structure to represent a deferred result? How have platforms generally approached this so far?

I think this question about how async/deferred results are handled will be a common one, and it was surprisingly hard to find any info about it in the docs. Maybe worth adding in a more obvious place?

The Platform concept feels incredibly powerful, but it feels like the Roc API each platform creates will be core to the ergonomics of using the language. Might be helpful to include docs from some of the most common platforms you expect folks to use to understand the end-to-end picture. The Stdout examples were helpful but I'd be curious to see others with more complexity.

theflyinghorse • yesterday at 6:04 PM

Where do you read the async specifications? I can't find much on the language site other than mentioning that "Roc application is built on exactly one platform, and that platform (not Roc's standard library) provides all of the application's I/O primitives" which is very confusing.