this post was submitted on 16 Sep 2025
239 points (96.5% liked)

Programmer Humor

26390 readers
1682 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] frezik@lemmy.blahaj.zone 2 points 14 hours ago (1 children)

I wish more languages used ref counting. Yes, it has problems with memory cycles, but it's also predictable and fast. Works really well with immutable data.

[–] davidagain@lemmy.world 3 points 14 hours ago (1 children)

Roc uses immutable data by default. It performs opportunistic in-place mutation when the reference count will stay 1 (eg this code would satisfy the borrow checker without cloning or copying if it were rust - static code analysis).

[–] frezik@lemmy.blahaj.zone 1 points 9 hours ago* (last edited 9 hours ago) (1 children)

Thanks, this looks really interesting. I've thought for a while that Rust's borrow checker wouldn't be such a pain in the ass if the APIs were developed with immutable data in mind. It's not something you can easily slap on, because the whole ecosystem fights against it. Looks like Roc is taking that idea and running with it.

[–] davidagain@lemmy.world 2 points 4 hours ago

I think that roc and rust are both aiming for fast memory safety, but rust is aiming to be best at mutable data and rpc best at immutable data.

I heard of someone trying to do exactly that - immutable functional programming in roc, but they gave up for the same reason you said - the whole ecosystem is working on the opposite assumption.

As far as I'm aware most of the roc platforms are currently written in rust or zig. Application-specific code is written in roc calling interface/io/effectful functions/api that the platform exposes and the platform calls into the roc code via the required interface.

I do think it's really interesting, and once they have a desktop gui app platform (which must compile for windows for me to be able to use it for work), I'll be giving it a good go. I think it's one of the most interesting new languages to arrive.