logoalt Hacker News

Roc version 0.1.0, eight years in the making

443 points • by DrDeadCrash • yesterday at 12:15 PM • 115 comments • view on HN

Comments

niclas-ahden • yesterday at 5:34 PM

I've been using Roc for the past two years and it's been a blast! The compilation speed is great, hot-reloading gives you a really nice development experience, and the error-handling is sweet :)

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!

➕ show 1 reply
oDot • yesterday at 1:02 PM

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.

gdotdesign • yesterday at 1:15 PM

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.

➕ show 4 replies
ylisav • yesterday at 4:01 PM

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.

➕ show 2 replies
commandersaki • yesterday at 6:53 PM

This is quite compelling.

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)

➕ show 1 reply
tarr11 • yesterday at 2:29 PM

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

➕ show 1 reply
jkl5xx • yesterday at 5:08 PM

Been following Roc for awhile and really love a lot of the concepts (like Platforms). Got a bit nervous they were losing the thread when they went for a big rewrite, but it looks like it’s panning out!

ifh-hn • yesterday at 8:48 PM

I don't really get the application/platform thing. I've read the docs and asked AI to explain it but I'm still not clear on really what they are or the point. Platforms just seem to mean using another programming language to do the hard bits. Might as well just use those languages to finish it off.

I'd love to understand the point.

➕ show 4 replies
stingraycharles • yesterday at 2:26 PM

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.

➕ show 1 reply
crowdhailer • yesterday at 3:44 PM

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

Fervicus • yesterday at 4:54 PM

I have been keeping an eye on this language. Maybe it's time to dive into it and give it a proper try. Any recommendations for good learning resources?

➕ show 2 replies
cma256 • yesterday at 9:16 PM

@rtfeldman Earlier in Roc's development it had a much stronger resemblance to Elm. Now it resembles Rust more strongly. My understanding is that this was driven by need and not aesthetic preference. Has the syntax for Roc stabilized? Will it change in the future? You're likely the most experienced Roc programmer in the world so I'd like to know if you find writing Roc to be a pleasant experience.

Edit: Happy for the 0.1.0 release. I look forward to using it!

dtdeb2 • yesterday at 1:04 PM

Congratulations. Lots in there for a 0.1! I hope Roc gathers serious momentum.

roblh • yesterday at 1:59 PM

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.

➕ show 1 reply
lemming • yesterday at 10:03 PM

What is Roc’s memory safety story? Is it pure GC, or does it do static analysis to bake manual memory management into the program in combination with reference counting, like Lobster or (I believe) Koka? Maybe I’m blind but I couldn’t see this in the doc after a quick scan.

➕ show 1 reply
sondr3 • yesterday at 2:09 PM

Maybe I should check this out for Advent of Code this year, would be fun to compare against Haskell which I usually use.

➕ show 2 replies
agumonkey • yesterday at 3:16 PM

morphic teams papers https://morphic-lang.org/publications.html in case people are curious about roc influences

hobo_mark • yesterday at 2:13 PM

Briefly hoped this was https://roc-streaming.org/

mcc1ane • yesterday at 1:43 PM

Unrelated to Rocq (https://rocq-prover.org/), formerly named Coq.

➕ show 1 reply
ahf8Aithaex7Nai • yesterday at 2:42 PM

I'm still pretty upset about Elm, and I'm not sure if that means I should avoid Roc or give Roc a try.

➕ show 2 replies
desireco42 • today at 12:29 AM

Several people mentioned AI and sloppification, but let me say one thing. I use Gleam a lot and using languages like this with AI, especially using AI to write in them.

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.

GortashWasRight • yesterday at 7:10 PM

Maybe slightly off-topic, but I just realized how much I used to enjoy stuff like this.

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.

➕ show 1 reply
Imustaskforhelp • yesterday at 3:05 PM

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

➕ show 1 reply
cptmurphy • yesterday at 2:10 PM

Why there are no managed typed effects? Only naming functions by convention

➕ show 1 reply
Mond_ • yesterday at 9:37 PM

LET'S GOOOOOOOO

aaronvg • yesterday at 7:03 PM

interested to see when concurrency primitives would launch

pkilgore • yesterday at 8:53 PM

Congrats!

1vuio0pswjnm7 • yesterday at 7:08 PM

Download: https://github.com/roc-lang/roc/releases/expanded_assets/0.1...

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 1

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

➕ show 1 reply
esafak • yesterday at 3:35 PM

1. Do LLMs write it well?

2. What are the suggested substitutes for OOP idioms like interfaces?

➕ show 1 reply
enoch_hou • yesterday at 5:13 PM

[dead]

frizlab • yesterday at 4:39 PM

Sad this is probably one of the last projects we’ll see that are handcrafted and made with love instead of machines…

➕ show 1 reply
dzonga • yesterday at 2:56 PM

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 :(

➕ show 2 replies
yewenjie • yesterday at 5:46 PM

I used to be super excited about Roc, around 2020 I guess. I distinctly remember at around GPT-3 thinking "alas, all this amazing developments in programming language design will never really matter in a few years".

master004 • yesterday at 5:33 PM

How many more programming languages do we need?

brainzap • yesterday at 2:10 PM

create a new language but keeping the pipe characters, is a mystery to me

➕ show 1 reply