josefrichter
I was looking at some news about Ruby 3 (see Ruby 3.0.0 Released | Ruby) and came also across this GenServer implementation which I thought I’d share here:
What do you folks think about Ruby 3? What kind of applications does it open in Ruby world that were previously not feasible? How does it compare to Elixir, what might be the implications, good or bad.
Just to be clear, I am curious about your opinions, not in some pointless Ruby vs Elixir flamewar. I love both Elixir and Ruby and I am pretty sure many people in this forum feel the same.
Trending in Discussions
This is the start of my Elixir learning journal/journey. I plan to share my journey in this thread and am open to all feedback, construct...
New
This is where the projects in the Hologram Showcase get posted: apps built with Hologram and libraries made for it. New ones go up usuall...
New
Never used it. I know it’s well-liked by some and the authors have put a lot of work into it.
Aside from that, is there a community cons...
New
Hi everyone!
This is our fourth edition. Last year, 1,000+ developers took part. The more of you who answer, the more useful the results...
New
Over the years I’ve tried dozens of time tracking and invoicing apps, and Harvest was the only one I liked. Primarily due to its relative...
New
I have a project that I’d like to build in Elixir, but there’s a statistical decision engine component that will likely use hierarchical ...
New
Hi all, a short report from production, and a thank-you to @josevalim, @chrismccord and everyone behind Elixir, Phoenix and LiveView.
Wh...
New
Other Trending Topics
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
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
On November 23, 2026, an unauthorized third party exploited a vulnerability in hex.pm (CVE-2026-129514, CVSS 10.0) that let them run comm...
New
Hi everyone :waving_hand:
I’ve been working on PhiaUI, an open-source UI component library for Phoenix LiveView, and I wanted to share i...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #code-sync
- #exunit
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #ai
- #authentication
- #elixirconf-us
- #umbrella
- #full-time-contract
- #blog-post
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-eu
- #distillery
- #security
- #processes
- #api
- #forms
- #hex










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
subbu
I haven’t read Ruby 3 feature list yet, but IMO, GenServer gets its power from OTP/BEAM and its ability to run long running processes. You can store arbitrary data in the process and use it however you want. I am not sure actor model is powerful without a VM. What do others think?
al2o3cr
Some quick observations:
Stackis threaded through every call, but functions likeStack#pushmutate the data inside it, leading to code with hidden connections:corollary: If a handler accidentally returns a reference to
stateto a caller, now you’ve got unsynchronized access to a shared mutable data structurethe
handle_cast/handle_callidiom is very dependent on pattern-matching in function heads; while it’s not semantically different to have a single body with a giantcase, it doesn’t seem as readable to me.overall, I’m not sure if trying to exactly reproduce the
gen_serverplumbing is the right approach. I’ll be very interested to see what people build with more Rubyish idioms.dimitarvp
As others pointed out, the runtime is much more important than the actor model (the model is not some magic by itself). After all, we have actor systems implemented in many languages and I’ve heard people walk away from Akka and Orleans disappointed due to lack of part of the guarantees that the BEAM VM has (although let’s be objective here, most users of these libraries are satisfied).
If people use some sort of a linter / static code checker in combination with Ruby’s actor support that ensures only immutable data are passed around (I believe you can achieve this in Ruby with the
.freezemethod), then it could work. But then you also need a reliable messaging inbox implementation for all actors.Me too.
egze
Wondering if the
start_linkeven makes sense in Ruby? Does it really link anything?lucaong
I think it’s a great feature that has the potential to bring a solid concurrency pattern to Ruby. I think that it is quite amazing that Ruby adopted the actor model: this has the potential to make Ruby even better than it already was.
Is this making Ruby preferable to Elixir/Erlang for concurrency? Most likely not, because of the issues with mutability mentioned above, and the lack of a VM designed from the beginning for safe concurrency. But I believe that’s not the point: this feature makes Ruby better, and applicable to more problems than it used to be.
I think about this as beneficial “cross-pollination” between languages, not as a competition.
As an engineer that loves both Ruby and Elixir, this feature makes me happy, as it expands the creative space of my favorite tools. If I am designing specifically for concurrency, I will still reach for Elixir. But in a project that fits Ruby better, this makes it possible to introduce concurrency where needed, using a pattern I like.
As for the GenServer implementation, I look at it more as an example to understand how Ractors work, than as a piece of code I would introduce in a real app. It wouldn’t make real sense to port exactly OTP GenServers to Ractors, as the underlying system is different. In Ruby, I would use the actor model idiomatically, without trying to mimic OTP too closely.
kokolegorille
It seems they also have ractor supervisors, so it might make sense.
dimitarvp
I have seen several Rust libs (frameworks?) that employ the actor model and they all go subtly different about it compared to the OTP, which is good and we might need the innovation. It’s nice that not everyone is trying to yet again prove the impossible thesis that shared state with naked OS threads will work for sure this time.
ityonemo
Yeah, I’d say gen_server interface is the worst. Ok. I’m exaggerating (I also appreciate that there is a reason why gen server looks like it does), but I really take Dave thomas famous “dogs breakfast” criticism to heart. Only reason I don’t use a package to organize it is because I think it’s bad form to add an unnecessary abstraction layer into the mental model for a commonly accepted pattern… One of these days I’ll do “isaacs best practices with gen_server” video, but I’m baffled by why someone working with ruby would ever want to repeat what exists verbatim, except that maybe they are worried about losing relevance to elixir.
gregvaughn
It’s funny how things come together. I don’t know the Ruby 3 feature list, but I learned of an actor framework in Ruby that was strongly influenced by OTP (GitHub - celluloid/celluloid: Actor-based concurrent object framework for Ruby · GitHub) about the same time I heard of Elixir in 2013, and even then, I was more interested in Elixir because it was running on BEAM and could take advantage of its guarantees.