我目前通过 Elixir 和 Swift 开发在线小游戏的心得
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

2026 年 5 月 24 日,作者推出了 **Migo Games**,这是一个支持 iOS、macOS 和网页端的社交街机平台。该项目主要通过人工智能辅助编码开发,采用了精简的技术栈:后端使用 Elixir/Phoenix,原生客户端使用 Swift/SpriteKit。 作者总结了开发过程中的几个核心要点: * **架构:** Elixir 的进程模型与游戏房间完美契合,提供了固有的可扩展性和容错能力。 * **原生与网页:** 尽管网页开发更便捷,但作者认为原生性能——特别是触感反馈和动画效果——仍然优于网页方案。 * **AI 的转变:** 虽然 AI 大幅加速了开发进程并实现了精简的二进制文件大小,但作者指出,它并不能解决用户分发这一根本挑战。在一个 AI 导致应用数量爆炸式增长的时代,寻找受众变得比以往任何时候都更加困难。 作者强调,尽管 AI 可以处理语法,但深入的架构理解仍然至关重要。您可以访问 [migo.games](https://migo.games) 体验该项目。

在最近的一场 Hacker News 讨论中,用户 `calflegal` 分享了他们使用 Elixir 和 Swift 构建在线小游戏的经验。该项目名为“Migo Games”,突显了跨平台开发中关于服务器延迟的技术挑战。开发者指出,由于服务器托管在新泽西州,欧洲用户可能会遇到性能延迟。 讨论还涉及了开发流程的困难。一位评论者提出,移动开发缺乏网页开发中常见的快速且由人工验证的反馈循环,并指出基于浏览器的代理可以轻松测试 Web 应用,而移动模拟器则显得更为繁琐。尽管 `calflegal` 认可了这些架构上的权衡,但他们表示,未来会发布关于其技术栈更详细的分析。
相关文章

原文
24 May 2026

My most recent side project is a little social arcade called Migo Games. You can check it out on the App Store for Mac and iOS. You can also play one of the games on the web at migo.games.

It goes without saying that a lot has changed in the age of AI coding. I really can’t say I wrote any of the code. Keep in mind the date of publication of this post as well. Whatever I say about AI is likely to be out of date within weeks or months.

I do read the code, well, mostly. I certainly understand its design. I think that’s still really important with AI.

The tech stack of Migo Games is Elixir on Phoenix and Swift with SpriteKit. That’s really it. The back end runs on Fly.io. It’s got a managed Postgres database on Crunchy Bridge. One of the things I’m really proud of is the app’s lean binary size. At the time of writing it’s just a few megabytes. I think I added one Swift dependency so far, and that’s a Phoenix socket client library. I’m old enough to remember Nintendo 64. Mario 64 was like 8 MB, and I think most of it was music. My God is that amazing software. Anyway, I think AI reduces the need for so much bloat if one is mindful, and I think that’s really great.

Elixir has been awesome. It’s been so neat to have the core game unit, the room, exactly match the back-end process model. Talk about a good way to scale software. I remember reading a Cloudflare post about their Durable Objects that mentioned such an idea. I can’t easily find the link. Anyway, I’m confident the games could be fairly easily scaled because of this match. Then there are all the other benefits of Elixir such as the fault tolerance of this model. One room having a problem is not going to crash my whole system. I’m not really qualified to speak to all the cool parts of Elixir, but I’ll say I’ve been very happy with my decision to try it. If I need to add admin functionality or background tasks or anything else, I have all of the BEAM and Phoenix features right there waiting for me. I’m happy I didn’t just go with Node or Bun as would have been the default choice for a guy whose best language is TypeScript.

I could and maybe should say more about the architecture, but I’ll leave that for some other post.

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.

In the times before AI, I probably would have principally targeted the web. But in truth, and this is especially true of the iPhone, the web has really disappointed me in terms of performance when compared to native. It’s always outdone by native. You can even try this yourself with Migo! Play Arrow on the web then go try it on the native iPhone version. The cute haptics, the full screen, the animations, it’s really just not close.

Really none of this would have been possible without AI, so really I’m pretty grateful to be building software in this era. There are things I miss about the before times. Coaching clankers isn’t as prone to flow as writing syntax yourself. Oh well.

This isn’t to say that AI has solved everything. All the hardest parts of making successful software are still here. One of them is of course finding users/distribution. The clanker can’t really match my software to people from my repo. Bummer. In fact, there’s so much more software being written now that this problem is actually harder! I saw a chart showing tge explosion of number of apps in the app store from AI. Crazy stuff.

That’s all for now I guess. Give the games a shot. Leave a nice review in the App Store if you’re up for it. Happy building. Discuss on HN if you’d like.

联系我们 contact @ memedata.com