1. 39
  1. 22

    I wish ‘newly born language’ posts would include:

    • What makes it special? Why is this language not like all other languages?
    • What makes it hard? What new concepts do you need to wrap your brain around?
    • What would it be great at writing? What classes of applications, e.g., hard real-time, built for the cloud, etc., does it address well?
    1. 10

      My understanding from previous materials:

      • It’s a pure functional programming language. They are also using the Perceus algorithm to for reference counting so that they can perform opportunistic mutation of immutable data structures. With some thought it can be as fast at imperative algorithms as fast imperative languages (e.g., Go, Java).
      • There are performant, general purpose pure functional languages, but they tend to be difficult to learn. Elm is an easier to learn pure functional language, but it’s built for front ends. This language is going to try to bridge the gap.
      • CLI and web services, I believe

      That said, this is all kind of new. If I’m wrong about any of this, I’d love to know.

      1. 3

        OK, that description is solid gold 🏅. That’s what should be at the top of the README. Thanks!

      2. 6

        It makes delightful software.

        Roc is a new purely functional programming language built for speed and ergonomics.

        The readme doesn’t explain anything. It is a work in progress (what isn’t?).

        https://github.com/roc-lang/roc/blob/main/examples/algorithms/quicksort.roc

        https://github.com/roc-lang/roc/blob/main/examples/benchmarks/NQueens.roc

        It looks like ML with a Haskell like syntax.

        1. 5

          IMHO: If your project is visible to other people, its README should explain what it is. If you are too busy coding to write a basic informative README, your project is not ready to make public yet.

          In this case the inventor has clearly put a lot of work into giving presentations, so it’s odd that there’s no text info.

          In particular, most of the excitement around Roc seems to be because it’s a successor to Ellm, with the same designer(?), but I had no idea of that until some comments were added here alluding to it.

          1. 3

            In particular, most of the excitement around Roc seems to be because it’s a successor to Ellm, with the same designer(?), but I had no idea of that until some comments were added here alluding to it.

            The main designer of Elm is Evan Czaplicki.

            Richard Feldman is the main designer of Roc, and while he is also a known figure of the Elm ecosystem, he did not design it. It looks like Elm influenced Roc’s design a lot, but the languages also seem to have very different goals, so I’m not sure how much of a successor it’ll be.

            I’m glad that we have both options to explore. :)

          2. 3

            The readme doesn’t explain anything. It is a work in progress (what isn’t?).

            (This readme.) If it doesn’t explain anything, it’s not a work in progress yet.

            I clicked the link in the submission and the readme didn’t tell me anything at all. Not a single slight hint of why software written in this language is delightful. That is subjective, but I was curious about the claim anyway.

            1. 1

              The guide and FAQ offer a lot of information.

            2. 1

              Why does it look like an ML?

              1. 1

                It’s heavily inspired by Elm. It’s Elm, but not for front end websites, and all that entails.

                1. 2

                  I don’t understand what that has to do with ML. As far as I can see these (Elm and Roc) don’t look anything like ML. They just look like Haskell.

                  1. 5

                    Haskell is an ML descendent. It’s branched off a bit, but it’s related. See the family tree in the timeline.

                    https://courses.cs.washington.edu/courses/cse341/04wi/lectures/02-ml-intro.html

                    1. 1

                      That diagram pretty clearly puts it outside of the ML family.

                      1. 3

                        I didn’t say it was in the family. I just said it was a descendent. You can see that Miranda branches off of ML and Haskell follows.

                    2. 3

                      …and Haskell looks like ML

                      1. 1

                        Huh. Haskell doesn’t look like ML to me.

                        Guess it’s subjective.

            3. 14

              For those who would rather read than watch, here is a direct comparison with Elm.

              1. 3

                The tag unions look like a really elegant solution to error handling in a functional language, where you usually either have

                • data AppError = FSError | HTTPError | AppSpecificError | ThisTypeIsTooBroad | ... and everything returns Either AppError,
                • some type class setup like class FromHTTPError a where fromHTTPError :: HTTPError -> a, or
                • an effect system

                At first, I was a little disappointed with the lack of HKP, but I think now that this is a good trade-off for better compile times and type inference. If I wanted more a complex type system I could always go back to using Haskell.

                1. 3

                  Interesting, looking forward to having a bit more documentation to read about this as it progresses.

                  As an aside, is NoRedInk still invested in the Elm ecosystem?

                  1. 7

                    Heavily. Elm is for frontend. Roc technically can be used for frontend, but will probably never give as nice of an experience as elm. Elm is hyper focused on frontend web which makes it amazing for that use case. Roc is more targeted towards backend, system apps, cli, etc.

                  2. 3

                    Great language! It seems to fix pretty much all issues I had with Elm.

                    Why are function parameters separated by commas, but arguments separated by spaces? That feels inconsistent.

                    1. 1

                      Currying. It makes the syntax for curried function application more consistent.

                      1. 7

                        But according to the FAQ, Roc doesn’t have currying…

                    2. 2

                      ooh, been looking forward to it getting released!

                      1. 2

                        I think it’s interesting to have a pretty simple, strict, pure language in the ML family. I found that talk enjoyable. It’s nice to see row polymorphism both for records and for sum types, and it might even work if their error messages are good enough.

                        However, they seem to be making the catastrophic mistake of trying to write their own editor (with structural editing?). Focusing on a good LSP experience would be much better. This indicates to me that their priorities are wrong if they look to ship something useful that people might try (and maybe adopt). I hope they realize their mistake and make that a side project or something like that.

                        1. 1

                          Why is that a catastrophic error? Isn’t it, in the worst case, some sunk cost for something that gets tossed?

                          1. 2

                            Sure, it’s a grave mistake for them only if they care about adoption! Opportunity cost and all that :-). The first thing many people will ask is “is there a LSP server?”, and if their answer is “no, just use our editor” people will just shrug and lost interest.

                            1. 1

                              I would assume if the editor fails that badly, an LSP would be made. Also, I bet long term even if they don’t make the LSP, someone will.

                              Anyway, adoption isn’t everything. If the editor works for them and is nice, why does it matter what others think?

                        2. 1

                          Ooh it’s public!

                          Edit: looks like it’s in Rust now aww

                          1. 8

                            looks like it’s in Rust now aww

                            Look at the last entry in the FAQ. The compiler has always been written in Rust, the runtime is written in Zig. To see some of the Zig source code, look in crates/compiler/builtins/bitcode.

                            1. 2

                              would be interesting to read the story behind the rust rewrite

                              1. 8

                                As far as I know, the compiler has always been written in Rust! You can write platforms in whatever language you like, though.

                                1. 1

                                  oh, interesting; when they first announced the language i assumed it started life as a straight-up fork of the haskell-based elm compiler

                                  1. 5

                                    Always rust, though parts of it were translated very directly from the elm compiler. So some sections the code may be quite similar.

                            2. 1

                              I’ve always wanted a “Elm for Backend” and Roc looks promising but just reading the linked material, the \something syntax really bothers me, similar to PHP namespaces.

                              1. 2

                                You mean the syntax for functions? That’s taken from Haskell, where it’s supposed to be an imitation of the lambda calculus syntax.

                                λx . x
                                \x -> x
                                
                                1. 1

                                  Thanks for the explanation, I had no idea.

                                2. 2

                                  Eh, Roc is a descendant of Elm, and \something syntax is directly taken from Elm.