What I've Learned (So Far) Building Online Mini Games with Elixir and Swift

https://calvinflegal.com/2026/05/24/what-ive-learned-so-far-building-online-mini-games-with-elixir-and-swift.html

Comments

w10-1May 27, 2026, 6:27 AM
> Also, I would encourage others to target Mac in addition to iOS for a reason you might not expect: build times. The simulators and Xcode are really pretty slow. It’s all a lot faster if you’re targeting Mac.

Yes, this makes my day: (also) target macOS for continuous rapid loops on one project, or target iOS and end up flitting back and forth between many projects. ("mac (made for iPad)" does not work.)

zuzululuMay 27, 2026, 2:32 AM
was expecting a bit more substance but always interesting to read different approaches.

but I do wonder if BEAM is a bit of an overkill, even fly.io (known among developer threads to be very unreliable uptime) wouldn't be my first pick.

Cloudflare Durable Objects really is generous, not often can you get replicated database and realtime sync for such low barrier in cost and implementation.

I do wonder tho what Cloudflare's ultimate game is, as I'd imagine once they corner the market and practically everything is running off it, wouldn't be hard to say raise the $5/month to something higher.

frail_figureMay 27, 2026, 4:58 AM
> Cloudflare Durable Objects really is generous, not often can you get replicated database and realtime sync for such low barrier in cost and implementation.

BEAM gives it to you for free, and you don't rely on an Internet-scale monopoly to run it.

simoncionMay 27, 2026, 6:42 AM
> but I do wonder if BEAM is a bit of an overkill...

Why would it matter if something's overkill? If it's not much more work, and it runs on the systems you're targeting, it's better to start with something that's more reliable than you might strictly need than to start with something that you believe to be "proper kill", only to discover that you underestimated the amount of "kill" required. Retrofitting things like proper supervision and data/crash isolation can be a huge, huge pain in the ass.

apt-apt-apt-aptMay 27, 2026, 3:40 AM
Really interested in hearing more about the architecture. Especially (1) why you chose Elixir, Phoenix over TS (2) how you dealt with real-time multiplayer.

Aside: The links to the web game in the post don't lead to being able to play.

frail_figureMay 27, 2026, 4:55 AM
Not OP, but TS (as in TypeScript, right?) is not even in the same universe as Elixir with Phoenix when it comes to building backend services.

It's a very productive and readable programming language with excellent documentation and conventions, and the most ergonomic way of handling concurrent operations (thanks BEAM) I've encountered.

The VM it runs on was originally designed for telephone switches, which, it turns out, cleanly translates to the internet/http era.

It makes it trivial to do soft-realtime because it's just actors (GenServers) passing messages.

I invite you (and others) to try it out and do a small weekend project. It'll make you reconsider reaching for TS on the backend :)

apt-apt-apt-aptMay 27, 2026, 5:53 AM
Thanks, interestingly Elixir handles concurrency in what seems like a natural way, actors passing messages to each other. It's cool that this way is used in production, though it seems to be used mainly in niche distributed scaling.
nesarkvechnepMay 27, 2026, 5:55 AM
Not at all. It’s used to build standard web applications too.
mcintyre1994May 27, 2026, 5:50 AM
I’d guess that 2 is a huge part of the answer to 1 here - Elixir makes real-time multiplayer easy.
colechristensenMay 27, 2026, 4:06 AM
Phoenix is delightfully fast and not having to deal with two entirely different application stacks where your application is split down the middle (or the javascript ecosystem) is a breath of fresh air.
calflegalMay 24, 2026, 1:49 PM
I should've said more about the tech. I will later. The server is in NJ. If you're in the EU the game might really lag. Sorry!
oeziMay 27, 2026, 2:56 AM
You mention it is possible to play via Web, but all links just lead to pages which point to Apple's app store. Game over for Android and the web?
karadoMay 27, 2026, 1:55 AM
In my own projects I've found the feedback loop to be much slower in native mobile apps compared to web. For web apps my workflow has involved lots of human verification just through using the app myself and testing out the latest features/fixes. Sometimes I get the agent itself to do this before I do using Codex's chrome extension. This same process on mobile is a lot slower. How have you approached this aspect? Have you figured out a way to get the agent to control an emulator?
zuzululuMay 27, 2026, 2:28 AM
Maestro but honestly you should always be testing on real devices
calflegalMay 24, 2026, 10:17 AM
My post about my recent project, Migo Games
ipnonMay 27, 2026, 2:03 AM
I’ve never thought about how the room model matches the LiveView socket model before. Which socket library are you using?