brightball

brightball

Somebody told me about OCaml’s Riot the other day and I wanted to get some opinions on it. I remember seeing @OvermindDL1 speak highly of OCaml in the past.

Showing Posts 1 to 10

mneumann

mneumann

Ocaml 5 is definitively hot technology and the whole language is a beauty! I am not an Ocaml expert, though I can see two technical difficulties in general:

  • Shared mutable state
  • Garbage collection

Unlike Rust, Ocaml does not have “fearless concurrency”. As long as shared mutable state stays within the same scheduler thread, everything should be fine but once you start sharing it between threads, you easily shoot yourself into your foot.

From a performance perspective, the Ocaml GC used to be stop-the-world, not sure if this is still true for Ocaml 5.

Rust got plenty of these actor-model libraries, including one modeled after Pony’s actor system: Michael Neumann / tractor · GitLab (disclaimer: I wrote it :).

rvirding

rvirding

Creator of Erlang

Also sharing mutable data make the GC much more complex, especially if you need to do it across threads.

dimitarvp

dimitarvp

I believe they are quite aware of it and that’s why they are pushing hard to make their effects library have a stable API next, if memory serves well.

https://github.com/ocaml-multicore/ocaml-effects-tutorial

al2o3cr

al2o3cr

I haven’t been paying close attention, but there are some deep-dives into the process of getting OCaml to play well with multicore that are a good read:

As to Riot itself, at a glance the code example looks… like BEAM process-handling code written with an ML flavor. :man_shrugging:

dimitarvp

dimitarvp

Don’t forget strong static typing. To me that’s an improvement, though I never could find the bandwidth to learn OCaml. I am using my extra energy and time to learn async Rust better and boy, does it drain that and a lot more…

al2o3cr

al2o3cr

YMMV; as commonly encountered in strongly-typed messaging systems, the need to add every possible message shape to Riot.Message.t seems suboptimal.

Overall it seems very early on - for instance, the implementation of GenServer.call doesn’t currently use the selective-receive functionality, so sending a message to a process that’s waiting for a reply to a call will make it crash :crying_cat_face: https://github.com/leostera/riot/blob/main/riot/lib/gen_server.ml#L23-L32

dimitarvp

dimitarvp

YMMV indeed, to me that’s a feature. Messages should be strongly typed, they are a discrete set anyway and I’d love to know them all beforehand, not discover them afterwards (especially not through my error alerting system).

Seems like it, yeah. I know a few other Rust actor implementations that seems more mature – but I have no visibility if their maintainers will keep developing them (though 1-2 of them seem quite complete). Still had no opportunity to try them though.

v0idpwn

v0idpwn

YMMV indeed, to me that’s a feature. Messages should be strongly typed, they are a discrete set anyway and I’d love to know them all beforehand, not discover them afterwards (especially not through my error alerting system).

Types aren’t the issue. The issue is having a single type for messages.

dimitarvp

dimitarvp

We don’t actually need a single type for messages. You can have one type per actor, and that type is a sum type (enum in Rust parlance). To me that works great.

v0idpwn

v0idpwn

Do you have a reference for this allegation? For me, it seems that Riot supports a single type for messages, which is the extensible variant Message.t

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews