Unofficial Hacker News companion — get notified on comment replies, and more.

Roc version 0.1.0, eight years in the making (opens external site)

485 points by DrDeadCrash 3 days ago | rtfeldman.com | 134 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (4)

  1. Looks neat, it checks basically every box for desirable features from modern languages all in one. What about the age old question of function colouring? Whats the async story here, and between that and effectful functions, are you not setting yourself up for potentially 4 different colours? It seems like the effect functions would be likely to infect everything all the way up in a lot of different types of programs. But maybe there’s a more structural solution to that that I’m not aware of after just a glance.
    Replies (1)
    1. 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 (2)
      1. 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.

      2. 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.