brightball

brightball

OCaml Riot, an actor-model multi core scheduler - thoughts?

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.

Most Liked

yawaramin

yawaramin

Hello, I checked this thread a while back and there were no replies, forgot to check back and I see now there are a few :slight_smile:

Overall I think Riot is exciting. The creator (Leandro) is a long-time Elixir hacker and OCaml legend. He is also very focused on DX and making libraries with great documentation and design. I have every confidence that the Riot ecosystem he is creating is going to be extraordinary.

Let me address a couple of things that caught my eye in this thread.

Riot does, yes, but that’s a design decision in this library and not an inherent limitation of statically-typed actor systems. For example see Akka, which has typed actors with distinct message types: Introduction to Actors • Akka core

As you can imagine, having multiple ‘standard libraries’ is not centrally planned by the OCaml community. Different people make different libraries that solve their problems. My advice is to stick with the default Stdlib that ships with OCaml until you need something specific, then add the specific library eg uuseg for Unicode string segmentation.

Example 2: package and dependency management. I have personally seen mailing lists / forum threads with the ever so helpful “what is dependency management?”

In every community, you will find some bored cranks who question every modern practice as a matter of course, it doesn’t mean that is the majority opinion. And in fact there are multiple OCaml teams working hard on package management concerns.

There’s a lot of effort to bring the community into the modern era. Things are looking very exciting. And Riot is going to take OCaml 5 Multicore to the next level with massive concurrency. It’s super exciting.

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.

Where Next?

Popular in Discussions Top

blackode
Elixir Upgrading is so Simple in Ubuntu and It worked for me Ubuntu 16.04 git clone https://github.com/elixir-lang/elixir.git cd elixir...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
mmport80
I have put far too much effort into Dialyzer over the last year or so - and basically - I doubt it’s worth the effort. It’s not as easy ...
New
mmmrrr
Just saw that dhh announced https://hotwire.dev/ Is it just me or is this essentially live view? :smiley: Although I like the “iFrame-e...
New
arpan
Hello everyone :wave: Today I am very excited to announce a project that I have been working on for almost 3 months now. The project is...
New
tmbb
This is a post to discuss the new Phoenix LiveView functionality. From Chris’s talk, it appears that they generate all HTML on the serve...
342 18272 126
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19675 166
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
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
100phlecs
Are there any downsides, like perf issues, to putting all functional components in CoreComponents as long as you prefix it with the conte...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement