There is a special place in my heart for people who work on hard software tech such as programming languages. Especially in times of AI and slopification.
In some ways it’s never been a better time to launch a new programming language. LLMs make adoption much more about developer preferences than familiarity. LLMs can help with the learning curve of new language paradigms. And they greatly de-risk the long term costs of picking the wrong language given their facility with rewriting.
I think new languages have more freedom than ever to be bold and take risks. We are not nearly so confined by culture or technical debt as we used to be and freedom to experiment has probably never been better.
I've been following Roc quite closely while I build (EYG lang) another functional language for my own use. I'm super impressed with the performance results they share. I thought that would be a distraction while developing. And maybe it was as it took 8 years. I don't love the result of purity tracking rather than a full effect system. I was quite enamored with proper effect tracking and have labeled effects in EYG. I think my holiday hacking might have to be try something real in Roc and see if I learn to love this approach to effects
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.
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.
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.
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.
So, for the sake of pedantry, in the programming language world "multiple dispatch" (and "[dynamic] dispatch" in general) typically refers to late binding - the function that's called is determined at runtime, and the caller doesn't actually need to know about the implementation being called.
What Haskell is doing there is basically just a kind of syntactic sugar around a pattern match, which is (to a very rough approximation) basically a super-powerful switch. Like a switch, the compress function knows about all of the branches statically, even if at runtime it dynamically selects which branch to take based on the structure of its arguments. And the structure of its arguments is "closed": it knows at compile-time all the different forms they can take.
Haskell achieves dynamic dispatch through typeclasses, and it can do multiple dispatch with the MultiParamTypeClasses extension. With these a caller doesn't need to know about the implementation it's invoking, and it doesn't need to know in advance anything about the possible values of its arguments beyond that they have an implementation that can be used - typeclasses are open, you can always define new implementations without updating every caller that uses them.
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.
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!
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.
Hard to say. Lean has its moment right now in mathematics, but Rocq grows in verified software space thanks to early industrial success with a verified C compiler, OS kernel, etc. that received certifications for automotive. Iris - a Rocq framework for proving concurrent code - really blew up in recent years, too.
And it’s not a Zero-sum game: multiple languages for theorem proving and software verification can blossom and grow the overall field together. To me it seems like Rocq, TLA+, and Lean have very bright future.
> sadly now with llms the art of programming languages might be forgotten since llms now write all the code
I've noticed that e.g. people who were JS devs before LLMs continue writing code in JS. Or Python in Python, and so on.
My experience with LLMs has been there's a vast difference between driving an LLM in a context you're familiar with, and an unfamiliar context. -- I can get an LLM to give me something pretty good if I know what to ask for, but I can only get an LLM to give me something okay-ish if I'm unfamiliar.
I tend to think programming languages & arguments will continue to matter just as much.
> [and LLMs do all the] review it :(
"LLMs are so strong that you won't need to read the code" I think this still allows that there should still be value in reading code.
I tend to think: an LLM is going to work more efficiently when the codebase is well organised compared to if it's disorganised.
I think that's more likely than, for example, "LLMs will be so good at coding, but only in a way that they produce unreadable spaghetti code that you can't understand". -- Surely if LLMs are so proficient at coding that you don't need to read the code, the LLM can also make the code easy to understand.
If it's the personality cult, the banning, the gaslighting, and the double standards? Then I would be hesitant about Roc since Feldman was doing a lot of the gaslighting and double standards.
If it was that it was that it's super dead, then Roc looks more promising. By a lot.
For those of us who witnessed that mess, no citation is necessary. I wish Roc all the best, but I’m not touching anything that comes from the people in Elm’s inner circle anymore. At least not until it has been made unmistakably and credibly clear that a change in mindset has taken place.
Kind of love the fact that Roc is fast,memory safe and compiles really fast.
This sort of combination is probably gonna take some developers. I have definitely heard of rust's compile time speed being a bottleneck in many aspects.
I want to know how to build cross-platform (preferably android,iOS as well with the normal linux,macOS and windows)applications with roc.
I just want something where I can easily and fastly iterate upon creating cross-platform applications. Waiting for rust to finish was a real issue that I sort of observed during one of my tinkering experiments.
Another thing that I am thinking right now is one Hackernews comment[0] that I had seen sometime ago which talked about having an android application (I think written in python), and they can basically change the code live and it will automatically reflect. I imagine that if roc is fast-enough, some sort of live development system could also be created.
Overall, I think that if AI can rewrite code or start writing code from scratch in almost any language good enough, then there are lots of experiments which can be conducted at scale which previously were not so feasible. Though one might ask what's the point as to the rewrite, I think that some of the features roc provides could be interesting to many sort of projects.
Also the language just looks elegant to me and more approachable than rust and C/C++ (from my first glance), so kudos for making a fast (functional) language which looks like something that I want to use myself!
I mean typed algebraic effects. They are not tracked in types. I don't see how you can define a custom effect, you have only pure and not pure functions, how to type a specific side effect?
There is a special place in my heart for people who work on hard software tech such as programming languages. Especially in times of AI and slopification.
In some ways it’s never been a better time to launch a new programming language. LLMs make adoption much more about developer preferences than familiarity. LLMs can help with the learning curve of new language paradigms. And they greatly de-risk the long term costs of picking the wrong language given their facility with rewriting.
I think new languages have more freedom than ever to be bold and take risks. We are not nearly so confined by culture or technical debt as we used to be and freedom to experiment has probably never been better.
Why would you care about which language you're using if you don't care to get familiar with it?
This is, by now, AI and fully slopified.
I've been following Roc quite closely while I build (EYG lang) another functional language for my own use. I'm super impressed with the performance results they share. I thought that would be a distraction while developing. And maybe it was as it took 8 years.
I don't love the result of purity tracking rather than a full effect system. I was quite enamored with proper effect tracking and have labeled effects in EYG.
I think my holiday hacking might have to be try something real in Roc and see if I learn to love this approach to effects
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.
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.
Have a look at the eros crate for rust. It implements a convenient error set mechanism mostly without macros
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
> Looking forward to trying this out and congrats to Evan and team on the release
You probably meant "congrats to Richard" who is Roc's BDFN (Benevolent Dictator for Now) https://www.roc-lang.org/bdfn
I'm pretty sure the BDFL of elm did not contribute to Roc.
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.
>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?
Not really, what Haskell / Erlang offer is that you can do pattern matching in the function signature.
So you can, say, have a definition for when the value of n is 0, n is 1, etc.
This is a nice example in Haskell:
Basically it enables you to use recursion more elegantly.So, for the sake of pedantry, in the programming language world "multiple dispatch" (and "[dynamic] dispatch" in general) typically refers to late binding - the function that's called is determined at runtime, and the caller doesn't actually need to know about the implementation being called.
What Haskell is doing there is basically just a kind of syntactic sugar around a pattern match, which is (to a very rough approximation) basically a super-powerful switch. Like a switch, the compress function knows about all of the branches statically, even if at runtime it dynamically selects which branch to take based on the structure of its arguments. And the structure of its arguments is "closed": it knows at compile-time all the different forms they can take.
Haskell achieves dynamic dispatch through typeclasses, and it can do multiple dispatch with the MultiParamTypeClasses extension. With these a caller doesn't need to know about the implementation it's invoking, and it doesn't need to know in advance anything about the possible values of its arguments beyond that they have an implementation that can be used - typeclasses are open, you can always define new implementations without updating every caller that uses them.
Congratulations.
Lots in there for a 0.1!
I hope Roc gathers serious momentum.
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.
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!
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.
morphic teams papers https://morphic-lang.org/publications.html in case people are curious about roc influences
Maybe I should check this out for Advent of Code this year, would be fun to compare against Haskell which I usually use.
Awesome! There's an Advent of Code thread going on Roc Zulip with beginner advice that may be helpful:
https://roc.zulipchat.com/#narrow/channel/358903-advent-of-c...
Unrelated to Rocq (https://rocq-prover.org/), formerly named Coq.
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.
On the other hand, seems to me like theorem provers that aren’t called ”Lean” are having a pretty rough go of it as well.
Hard to say. Lean has its moment right now in mathematics, but Rocq grows in verified software space thanks to early industrial success with a verified C compiler, OS kernel, etc. that received certifications for automotive. Iris - a Rocq framework for proving concurrent code - really blew up in recent years, too.
And it’s not a Zero-sum game: multiple languages for theorem proving and software verification can blossom and grow the overall field together. To me it seems like Rocq, TLA+, and Lean have very bright future.
rich is a nice guy. language makers called rich are nice people.
elm is where I learnt functional programming - concepts were easier to grasp for someone like me compared to oop.
sadly now with llms the art of programming languages might be forgotten since llms now write all the code n review it :(
more like the art of programming languages for humans has less focus.
I certainly see an uptick in work on programming languages for AI/agents.
> sadly now with llms the art of programming languages might be forgotten since llms now write all the code
I've noticed that e.g. people who were JS devs before LLMs continue writing code in JS. Or Python in Python, and so on.
My experience with LLMs has been there's a vast difference between driving an LLM in a context you're familiar with, and an unfamiliar context. -- I can get an LLM to give me something pretty good if I know what to ask for, but I can only get an LLM to give me something okay-ish if I'm unfamiliar.
I tend to think programming languages & arguments will continue to matter just as much.
> [and LLMs do all the] review it :(
"LLMs are so strong that you won't need to read the code" I think this still allows that there should still be value in reading code.
I tend to think: an LLM is going to work more efficiently when the codebase is well organised compared to if it's disorganised.
I think that's more likely than, for example, "LLMs will be so good at coding, but only in a way that they produce unreadable spaghetti code that you can't understand". -- Surely if LLMs are so proficient at coding that you don't need to read the code, the LLM can also make the code easy to understand.
I'm still pretty upset about Elm, and I'm not sure if that means I should avoid Roc or give Roc a try.
I guess it would depend why you're upset?
If it's the personality cult, the banning, the gaslighting, and the double standards? Then I would be hesitant about Roc since Feldman was doing a lot of the gaslighting and double standards.
If it was that it was that it's super dead, then Roc looks more promising. By a lot.
Pretty bold claims, so, citation needed
For those of us who witnessed that mess, no citation is necessary. I wish Roc all the best, but I’m not touching anything that comes from the people in Elm’s inner circle anymore. At least not until it has been made unmistakably and credibly clear that a change in mindset has taken place.
The trick with banning and deleting comments is that you get rid of the evidence.
Briefly hoped this was https://roc-streaming.org/
Kind of love the fact that Roc is fast,memory safe and compiles really fast.
This sort of combination is probably gonna take some developers. I have definitely heard of rust's compile time speed being a bottleneck in many aspects.
I want to know how to build cross-platform (preferably android,iOS as well with the normal linux,macOS and windows)applications with roc.
I just want something where I can easily and fastly iterate upon creating cross-platform applications. Waiting for rust to finish was a real issue that I sort of observed during one of my tinkering experiments.
Another thing that I am thinking right now is one Hackernews comment[0] that I had seen sometime ago which talked about having an android application (I think written in python), and they can basically change the code live and it will automatically reflect. I imagine that if roc is fast-enough, some sort of live development system could also be created.
Overall, I think that if AI can rewrite code or start writing code from scratch in almost any language good enough, then there are lots of experiments which can be conducted at scale which previously were not so feasible. Though one might ask what's the point as to the rewrite, I think that some of the features roc provides could be interesting to many sort of projects.
Also the language just looks elegant to me and more approachable than rust and C/C++ (from my first glance), so kudos for making a fast (functional) language which looks like something that I want to use myself!
[0]: https://news.ycombinator.com/item?id=50678306
Why there are no managed typed effects? Only naming functions by convention
They are managed and typed!
https://www.roc-lang.org/docs/main/langref/functions/#effect...
I mean typed algebraic effects. They are not tracked in types. I don't see how you can define a custom effect, you have only pure and not pure functions, how to type a specific side effect?
[deleted]
create a new language but keeping the pipe characters, is a mystery to me
I haven't been programming in Elm for a few years now (for unfortunate reasons), but I still use the pipe operators (and TEA).