Roc version 0.1.0, eight years in the making

(rtfeldman.com)

133 points | by DrDeadCrash 2 hours ago

13 comments

  • oDot 1 hour ago
    I'm the developer behind the screenwriting software mentioned in the post.

    Roc has been so pleasant to use considered it's still so early.

    I've read elsewhere a comment by Richard where he said that naive programming in Roc should result in fast code. That is very true. I basically enforce software design and architecture that allow for speed, and I don't have to worry about finagling the language into running fast.

    It's very well thought out.

    As a result Bliss Writer is correct and stable software, even in beta. I have a large suite of E2E tests that spin up a real TUI and they almost never fail.

    Who knew you could have the correctness of FP and speed.

  • tarr11 15 minutes ago
    The timing of this is interesting to me. I have always been a fan of Elm.

    I have been building an app platform on top of Rust for a few months, and have run into a series of problems and I sometimes wish I could use something more purely functional such as this. It offers a lot of guarantees that I want such as memory safety and side-effect-free code, and have had to try and build myself (probably poorly) in my own thing.

    I am also glad to see to see that this language has addressed native code in a more robust way than Elm https://www.roc-lang.org/docs/main/langref/platforms/

    Looking forward to trying this out and congrats to Evan and team on the release

  • gdotdesign 1 hour ago
    Roc seems to have a pretty good version of error handling I've seen so far: https://roc-lang.org/docs/main/langref/errors/

    Basically you can handle the errors you want to handle and propagate everything else upstream because the error value is a union of all propagated errors. In other (typed) languages you either need to handle all errors or map the different types into a single one.

    • stefanka 22 minutes ago
      Have a look at the eros crate for rust. It implements a convenient error set mechanism mostly without macros
  • stingraycharles 18 minutes ago
    Reminds me a lot of Elixir actually, which I really enjoyed but was, in the end, not fast enough.

    The syntax looks friendly.

    Does it have multiple dispatch for functions based on arguments? I always loved how easy that was to do in Haskell and Erlang/Elixir, and missed it in languages like Clojure.

    • masijo 13 minutes ago
      >missed it in languages like Clojure

      I'm not sure about Haskell and Erlang/Elixir since I haven't used them much, but aren't multimethods the Clojure solution for this?

  • roblh 45 minutes ago
    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.
    • rtfeldman 30 minutes ago
      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!

      • vipshek 9 minutes ago
        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.

  • sondr3 35 minutes ago
    Maybe I should check this out for Advent of Code this year, would be fun to compare against Haskell which I usually use.
  • dtdeb2 1 hour ago
    Congratulations. Lots in there for a 0.1! I hope Roc gathers serious momentum.
  • ahf8Aithaex7Nai 2 minutes ago
    I'm still pretty upset about Elm, and I'm not sure if that speaks for or against Roc.
  • mcc1ane 1 hour ago
    Unrelated to Rocq (https://rocq-prover.org/), formerly named Coq.
    • ModernMech 51 minutes ago
      This is kind of unfortunate for Roc because they were using the name first. But Rocq is a much bigger project so the mindshare is with them.
  • hobo_mark 31 minutes ago
    Briefly hoped this was https://roc-streaming.org/
  • cptmurphy 34 minutes ago
    Why there are no managed typed effects? Only naming functions by convention
  • brainzap 34 minutes ago
    create a new language but keeping the pipe characters, is a mystery to me