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.
y = U64.from_str(b) ? InvalidSecond
# returns Err(InvalidSecond(BadNumStr))
Ooo, I like that syntax. Implicit wrapping, but it gives you a type you control so you can <do stuff> if needed.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.
The breadth of topics and how much they interplay is a lot more complicated than your typical software, and there's hundreds of small decisions you have to make along the way which you can only really understand how to design/steer if you understand the whole pipeline.
Your type system affects your syntax, and your syntax affects the complexity of types you can represent ergonomically, and your type system affects your runtime memory model and lowering, and so on and so on.
If you're willing to just let the LLM do all of the work and only judge it from the outside (observational correctness, but otherwise a black box), then sure, maybe you can get something. But I think that's:
1. going to lead to holes in your language design that you don't understand how to fix.
2. robbing you of the opportunity to learn. Learning design via one of the harder problems that exists, and also learning how to learn. You're forced to organize your approach to understanding the topics in a way that you can't just bruteforce components out of order and piecemeal unless you have an insane capacity to memorize things.
I’m saying the opportunity cost of trying new languages has never been lower.
all languages excel at something to the detriment of something else, no language can be good at everything.
the language also defines the terms for which you can reason about a problem.
even if you're not writing it, you're (hopefully) still reading it.
There's a good reason we're not writing web servers in assembly or SQL.
For me, there are 2 or 3 different levels to modeling what's going on. The first phase is the architecture; the second phase is the design, although some claim those two are merged. And then there's the modeling of the implementation, and that is driven by the programming language. Even though an LLM is generating all my code, I still read it; I still try to understand it so that when I debug it, I'm not going WTF quite as often.
The only difference is that now the offshoring team is out of luck, replaced by gremlins in the box.
I'm sure the same thing will happen to me after a while, like about a half hour from now.
It’s like calling clay pottery lumps of mud. Maybe technically accurate but you’ve lost the helpful nuance. Turns out people can shape and mold the slop into useful tools. At that point “slop” becomes less of a pejorative.
You could have a “nuanced” analysis of what the output is like. But there is no analysis to be had of where it came from. Like a car wholly made from stolen parts where no part has any serial number.
Pff.
> That absolutely has provenance here -- we can look at the 8 year history of this project, which of course predates mainstream agentic coding.
You would have to take that up with OP. The “slop” part, whether it started a week ago or a year ago, has no provenance.
Then how exactly can you or anyone else claim that the so-called slop (which clearly is so nebulous of a term that we need to debate said definition... Which probably means we shouldn't be throwing it around so casually...) was stolen? Saying something is stolen implies you know where the output actually came from.
You'll have to define "slop" then. For instance, code written by hand and then translated by an LLM has provenance, so is that slop?
If your definition of "slop" is "any generated code without provenance", then people can work to show provenance.
If your definition of "slop" is "any generated code" then the word is more of a shibboleth. And that's how people seem to use it, which is why I'm saying it's not useful anymore unless you're trying to promote an ideology.
I am always reluctant to try languages in their infancy though, not because of stability. I just don't know to what extent you can write sophisticated software such as a web server, a GUI application, etc.
I also notice that this Odin language is taking off. Never heard of it before but it's being used for the Rex client (superlogical) on Windows.
That is to say, I usually start paying attention when serious software is being made. (not a criticism of Roc though)
If it's any help, I've been writing "serious business apps" in Roc for the past two years, so you can already do quite a bit! I write mostly web apps and had to write my own web framework (https://github.com/niclas-ahden/joy) since it was such early days. I've been extracting and releasing as many packages as I can to help build out the ecosystem for people like you. I hope you'll have a great time when you decide to try it :)
If there's anything specific you need or are unsure about, post on https://roc.zulipchat.com/ and we'll help you!
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
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.
I'd love to understand the point.
1. The platform defines what effects your code can run. For certain use cases, it makes sense to have some but not the other. For example, a terminal app, a GUI, and a webserver need different primitives. Same with powering a UI for a smart fridge VS embedding into a text editor.
2. Most high level languages "drop down" to systems languages like C/C++ already, for example, Python.
> Might as well just use those languages to finish it off.
Different languages give you different things. Most people wouldn't want to write their entire app in C, for all the obvious reasons. Think about the Apache web server approach - it's a fast server written at the systems level, but passes the final piece off to whatever language you want. You can use a higher level language here for your business logic, without sacrificing all the speed.
At the end of the day, everything has to drop down to assembly to make a syscall, but that doesn't mean you want to write your whole app in assembly.
Another way to look at it is a practical comparison: JavaScript is a language, but it needs to run on something. If you run it in the browser, you get access to browser APIs. If you run it on the server with Node/Deno/Bun you get different APIs that are useful for web servers. In that scenario, the browser or Node/Deno/Bun is the platform.
The example above isn't apples-to-apples, but it's a good way to visualize the difference!
Does that help? :)
To me it just seems like roc can't function without other languages to make them useful.
Please don't take this on a bad way I'm just unable to describe it better.
Roc needs a platform written in another language, but you as a Roc author don't have to read or write that language. You don't even need to know which language a platform is written in.
Someone else (like me!) writes a platform, shares it, and you use it. That means you get whatever platform you want: maybe with the concurrency of Go? Or the performance of Zig? Or the memory safety of Rust? And the platform can give you access to their entire ecosystem. All that with no effort on your part, and you get to read and write only Roc. Sweet deal, right? ;D
Maybe it's just something I need to get used to.
Thanks for taking the time to explain though. If you're the guy that created the joy web framework (platform?) for roc, then I watched and enjoyed your talk about it.
Well, you could write your platform in a functional language :) What it is saying is that separating pure vs. effectful/impure comes with some nice benefits, and we're seeing that in the platforms concept. I think if you try it you may see it differently :)
>If you're the guy that created the joy web framework (platform?) for roc, then I watched and enjoyed your talk about it.
Yeah, that's me! Thank you so much! PS. I call it a "framework" just because it spans more than one platform. Not really an important :P
The main advantage it provides is restrictions. Roc cannot perform any side effects outside the ones provided by the platform and has no provision for unsafe behavior. This allows for very aggressive inlining at the language level which winds up being pretty close to what I've done with macros and compile time programming in other languages. In terms of system design, you can know that the app code can't break the abstraction boundary and design accordingly. I made an experimental web platform that had full and automatic cache invalidation which worked off a combination of sqlx-style compile time inspection of queries combined with SQLite's security hook callbacks and I never would have done the design without having to deal with platform design. Neither of these are doable if the entire thing is in Rust.
Someone in this thread described it an app framework that provides the IO primitives.
I have not used Roc at all just my impression of what's going on
Using zig or rust or something you lose the roc specific features of a high performance pure functional language
Much better than FFI where usage is not tracked in the type system
You could just pick up Roc, pick a platform, and start writing Roc right away without knowing any other language :) There are already a number of platforms to use for CLI apps, web servers, web apps, native GUIs etc.
However, if you want to write your own platform you can. That's a great power to be able to reach for if you want to but it's not typical.
Going back to the JavaScript example: most JS developers just pick a platform, like Bun, and start writing JS. In the same way, you'd pick a Roc platform and start writing Roc.
Sure, if Bun wasn't good enough the JS dev may write their own platform (Bum? :P), and then they'd need a second language. That's the same thing you could do in Roc if you wanted a custom platform :)
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.
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?
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:
compress :: Eq a => [a] -> [a]
compress [] = []
compress [x] = [x]
compress (x:ys@(y:_))
| x == y = compress ys
| otherwise = x : compress ys
Basically it enables you to use recursion more elegantly because the pattern matching is folded into the function signature.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.
It's not just Haskell, though. Like I said, Erlang/Elixer also support this, and it enables writing some really elegant code.
multi sub compress([]) { () }
multi sub compress([$x]) { $x }
multi sub compress([$x, @ys [$y, *]]) {
$x === $y ?? compress(@ys) !! ($x, |compress(@ys))
} (defn greet
([] "Hello!")
([name] (str "Hello, " name "!"))
([name title] (str "Hello, " title " " name "!")))
Which one could argue is cleaner for multiple arguments, but you can't pattern match on arguments themselves this way (but you can using multimethod)That's why both Go and Roc are able to be competitive with languages that have async/await on webserver throughput benchmarks!
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.
Edit: Happy for the 0.1.0 release. I look forward to using it!
The syntax is now very stable and hasn't changed for a long time. Getting everything under that working really well, like the specialising pipeline or the native backends, and all the platform/package ecosystem has really been a bigger focus this year.
I've written a lot of Roc over the years, and I think the experience is wonderful.
https://roc.zulipchat.com/#narrow/channel/358903-advent-of-c...
I was a type astronaut by definition. I loved talking about higher-level abstractions, different programming paradigms, Monads, Scala, Haskell, all of it. With the rise of LLMs, it feels like none of that matters anymore, almost as if I poured a chunk of my life into something that lost its value overnight. A few years ago, I was super enthusiastic about Roc; nowadays, I wonder what my lead would think if I even casually mentioned migrating away from Go to it. It probably doesn't matter at all anymore.
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.
--
originally replied at the wrong level
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.
The downvotes speak for themselves! :-D
There's more, you can just google "elm cult".
I was personally banned without warning by a rule they made up to specifically target me after the fact. A rule which 100% applies to Feldman, but he was in the inner circle so obviously that rule didn't apply to him. It's still the only rule they explicitly have written down actually.
[Edit:] Perhaps https://github.com/elm/forum-rules ? That actually is pretty weird!
It takes AI a little bit longer, like multiples time longer, but when it writes code is rock solid and it's easier to follow because it's much smaller code base.
So I would say that there is huge benefits in using AI to write in languages like this and of course you can write it always the artisanal way anytime of whenever you want.
Plus codebase in Roc is much more pleasurable to examine and watch, even if you write it with AI,then anything you can produce in Typescript or Rust.
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!
This is mediated by the Roc platform (i.e. app framework) and as for mechanics it works the same way the platform host language would work. I do have a Roc GUI platform written in Rust running on mac and android but it's built using just the OS drawing/input APIs and not using the rest of the platform's GUI stack so in practice they work closer to web apps with native performance/overhead. I've leaned into this so the apps are Elm Architecture, the styling is very similar to Tailwind, and things are generally web-app shaped. The LLMs are pretty good at web apps so the process of bringing up a new app is pretty straightforward.
Is the app open source? I'd love to tinker around that.
But also, my question is that since it's using rust, wouldn't there be an issue of rust compilation coming into place perhaps once again?
And would there be any advantages in having a Roc UI framework whose rust layers could be extremely small if not nil perhaps (again, I am not too familiar with the internals of Roc as in how the Roc platform works which I still have to explore but still, suggesting this idea)
I just want fast cross-portable (small) apps with fast compile speed/iteration speed. Golang really fails in some sense and rust loses on the cross-portable part. I really want a language within this space, I am gonna explore roc for this but do you have any other languages in suggestion as well?
It's open source [1] but not currently documented and therefore not "really" released. I've had several people ask me to just put it out without docs but not sure how useful it is to others.
[1] https://github.com/grayrest/kite
> Since it's using rust, wouldn't there be an issue of rust compilation coming into place perhaps once again?
App-level use compiles Rust once up front and is then on the Roc iteration loop. If you're messing with the platform then there's the normal Rust compilation cycle which is dependent on how deep you're making changes in the crate dependency graph.
> would there be any advantages in having a Roc UI framework whose rust layers could be extremely small if not nil perhaps
There are several other Roc platforms attempting this. I believe the most developed is Terroccotta.
My project places the app/platform boundary at the "web browser" level because I have an alternate backend that allows apps to run in the browser using DOM/CSS/WASM. Anything that would be in the browser in a webapp is in the platform and a large fraction of the browser's feature set with regards to app development is implemented (flex/grid layout, text decoration, borders, shadows, transitions, animation, etc).
> do you have any other languages in suggestion as well?
I do not. I'm about 2000 hours and almost half a million lines of Rust+Roc into this project because I wanted something like Electron/Tauri that would run with native app perf/resource consumption and work on my android devices.
https://www.roc-lang.org/docs/main/langref/functions/#effect...
I tried Linux x86_64
No glibc, I'm using musl
https://github.com/roc-lang/roc/releases/download/0.1.0/roc-...
275.4M roc
roc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
By comparison the size of the musl GCC toolchain I use is 242.3M
I've also used a static LLVM toolchain which is 328.8M
https://github.com/rsms/llvmbox/releases/expanded_assets/v15...
cat > 1
main!=|_args|{
echo!("Hello, world!\n")
Ok({})
}
^D
roc build --no-cache 1.roc; strip -s 117.5K 1 (with --opt=size result was 18.0K)
1: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=f44ebb81e1e06241ebccd8bb27a6e78dc07b9336, stripped
roc build --no-cache --opt=size --target=x64v1netbsd 1.roc; strip -s 1
1: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, for NetBSD 8.0, BuildID[sha1]=f9032032100b247585d25c60741307495f94a094, stripped
8.1K 1
It seems that --no-cache does not work when using --target
The `roc` binary size is almost all LLVM (and a bit of LLD on top of that). The actual Roc-specific logic is a very small fraction of the binary's contents. (You can see this by going to roc-lang.org and looking at the compiler we use in there for the in-browser repl; it doesn't bundle LLVM or LLD and it's otherwise the entire compiler, and last time I checked it weighed in at about 5mb of wasm uncompressed.)
We plan to replace both LLVM and LLD with smaller alternatives, but we don't want to sacrifice performance of optimized Roc code, so the transition won't be quick.
2. What are the suggested substitutes for OOP idioms like interfaces?
Yes. Most if not all the examples in the community section of the post are LLM authored. A large part of the reason is because there's been breaking changes most weeks for months. This comes with the territory for a pre-0.1 language and the Roc team says they've put in all the breaking changes they had on the roadmap so hopefully with the increased stability of a numbered release we'll see more non-LLM projects.
The only thing I've particularly needed to kick the LLM on is error handling idioms. It reaches for `match` when something shorter would suffice.
> What are the suggested substitutes for OOP idioms like interfaces?
This is beyond the scope of a comment post but interfaces play an outsized role in most OOP system designs due to the need to nominally type everything in hierarchies. The closest mechanism would be using a `where` clause[1].
[1] https://roc-lang.org/docs/main/langref/static-dispatch/#wher...
I imagine there is a similar corollary where hobbyist woodworking didn't go away with the advent of assembly-line manufacturing.
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 :(
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 you're into web apps and The Elm Architecture, then check out https://github.com/niclas-ahden/joy I built Joy so that I could use Roc on a daily basis for client work, and it's been awesome! Now it's growing into a full-stack web framework with full type-safety from the database to the browser. Hope you'll like it too! :D
If you're curious about Roc, then join us on the Zulip (https://roc.zulipchat.com/). Welcome in!
I'm not saying everyone should be doing this, but it was an opportunity for me to be able to use Roc while contributing a lot to the community. It did take a lot of work, but seeing where we are now, I'm thrilled with how it has turned out :)
Heh, I almost posted a link to a public-facing Roc app here, but that's not a great idea :P DM me on Zulip (https://roc.zulipchat.com/) if you want to see an example of an actual business running full-stack web apps in Roc!