this post was submitted on 16 Sep 2025
199 points (96.7% liked)

Programmer Humor

26373 readers
1337 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
[โ€“] davidagain@lemmy.world 3 points 5 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 43 minutes ago* (last edited 42 minutes ago)

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.