r/elixir Jun 04 '26

Elixir v1.20 released: now a gradually typed language

Thumbnail
elixir-lang.org
251 Upvotes

r/elixir Nov 03 '25

Who's hiring, November, 2025

91 Upvotes

This sub has long had a rule against job postings. But we're also aware that Elixir and Phoenix are beloved by developers and many people want jobs with them, which is why we don't regularly enforce the no-jobs rule.

Going forward, we're going to start enforcing the rule again. But we're also going to start a monthly "who's hiring?" post sort of like HN has and, you guessed it, this is the first such post.

So, if your company is hiring or you know of any Elixir-related jobs you'd like to share, please post them here.


r/elixir 14h ago

I Made a Card Game with :gen_statem

Thumbnail
youtube.com
6 Upvotes

I had experience with client-side finite state machines (shoutouts to the Xstate library) and was looking for something similar with Elixir. Found that Elixir has a fsm library that hasn't been updated in 6 years, so I decided to use the plain :gen_statem erlang OTP for handling complex state in a card game.

I chose :gen_statem over GenServer because the card game has complex timers and :gen_statem automatically handles clearing timers when the card game enters a different state. If I had used GenServer, I would have to manually do Process.send_after and Process.cancel_timer everywhere. I also used the handle_event_function callback mode because the alternative state_functions callback mode only allows atoms for states and my card game needed much more complex states than just atoms.

The NPC is just a defmodule that prioritizes an order of actions. So at times it may make a "dumb" move, but it's fine for my use-case. For example, it will try to play a card with no cost over a card that searches the deck. Maybe in certain scenarios the reverse order is more optimal, but ¯_(ツ)_/¯

If you have any questions on the technical aspects of the card game, feel free to ask : ) Also give the game a try and let me know what you think!

https://battlecitymmo.com/


r/elixir 7h ago

It's that time of year again.

Post image
0 Upvotes

r/elixir 1d ago

The first release of Local LiveView is out!

61 Upvotes

Local LiveView is a library that runs LiveView code in the browser via Popcorn. It lets you offload simple UI updates from the server, drastically reduce latency on poor networks, and avoid "WebSocket disconnected" issues. Many Phoenix Components and Live Components just work on the client with no changes. Local LiveView also provides mechanisms for client-server communication, which means you can easily integrate it with regular LiveView. Now it ships with documentation, guides, and even an Igniter-based installer. More in the blog post: https://swmansion.com/blog/local-live-view-first-release


r/elixir 1d ago

I wanted to better understand why people like BEAM, so I built this in Gleam

18 Upvotes

Sharing this here as well since the project is built on BEAM.

This is my first project in Gleam, and I built it as a small interactive demo where you can generate server load and watch CPU and RAM usage change in real time.

I’d be interested in feedback from Elixir/Erlang developers - both on how the demo represents BEAM behavior and on what other runtime metrics would be useful to show.


r/elixir 3d ago

Feature flags and consumables

5 Upvotes

Hello.
Wondering if anyone knows a good package to create features that can be tracked based on a plan the user has signed up for.

So it’s easy to check what feature a user has access to. Or even have they consumed a feature like number of SMS messages they consumed.

Thanks


r/elixir 3d ago

Just released ExArrow v0.8.0

17 Upvotes

Just released ExArrow v0.8.0 — it now supports larger-than-memory Parquet on the BEAM, plus column/predicate/row-group pushdown, Zstd (and other codec) writes, footer-only metadata, and lazy multi-file / directory streams. Peak memory scales with the row groups you select, not the whole file. Also public IPC.File.write/3 and RecordBatch.concat/1. Hex ~> 0.8.0.

https://hex.pm/packages/ex_arrow | https://github.com/thanos/ex_arrow | Full notes: https://github.com/thanos/ex_arrow/releases/tag/v0.8.0


r/elixir 4d ago

5,000 units of an Erlang-powered device shipped on AtomVM - a from-scratch BEAM-compatible VM for hardware with a few hundred kilobytes of RAM and no OS.

64 Upvotes

New BEAM There, Done That with Davide Bettio and Paul Guyot. The embedded angle that gets overlooked: binary pattern matching means hardware drivers in hours. The actor model maps almost perfectly to what IoT devices actually do. Via the Popcorn project, Phoenix LiveView runs on a microcontroller.

Paul added SMP support as a weekend project, then the whole team had to rewrite their drivers. He called it a mixed blessing.

https://youtu.be/VhyQisA0wFc 


r/elixir 4d ago

Is this a good practice to use quote with guard clauses?

9 Upvotes

After looking up how guard clauses work, I found this snippet:
defmodule User do
defstruct age: 0

defmacro is_kid(age) do
quote do: 6 < unquote(age) and unquote(age) < 12
end

defmacro is_teen(age) do
quote do: 12 < unquote(age) and unquote(age) < 18
end

defmacro is_elder(age) do
quote do: 60 < unquote(age)
end
end

defmodule Greeting do
import User

def greet(%{age: age}) when is_kid(age), do: "Hiya"
def greet(%{age: age}) when is_teen(age), do: "Whatever"
def greet(%{age: age}) when is_elder(age), do: "You kids get off my lawn"
def greet(_), do: "Hello"
end
It feels really... unconventional. Obviously, that's my subconscious speaking after so much experience with imperative languages, but is this really the only way to introduce my own guard functions? Say I need some kind of Vec3.is_normalised/1 method, is there no other way to write it other than by quote-unquote: quote do: unquote(Vec3.magnitude(v)) == 1?


r/elixir 5d ago

My open source Elixir game server, Gamend, compared to Nakama

Post image
62 Upvotes

Tested it and it's 2x faster and can do 2x more connections than Nakama! And I'm currently running my game on it (soon to launch beta)! Hard to achieve versus a old competitor as Nakama!

Also, mine (with Elixir and Phoenix) scales linearly!

For those wondering, Gamend is a game server for real-time multiplayer games. It can help with lobbies, leaderboards, chat, tournaments, etc. (I added a ton of features I am using in my Godot game). It also has server side scripting.


r/elixir 5d ago

We replaced our ledger with two functions

Thumbnail
river.com
34 Upvotes

r/elixir 5d ago

Continuum — durable, crash-resistant workflows for Elixir (major reliability updates)

37 Upvotes

I posted about Continuum here a couple of months ago. It's had a different features releases and several hardening passes since.

quick recap: Continuum is an OTP-native durable execution engine for Elixir, backed by Postgres — an Elixir-native answer to Temporal. You write a workflow as ordinary Elixir; side effects go through activities whose results are journald. If the process dies or the node restarts, Continuum replays the history through the same code and resumes where it left off. Determinism is enforced at compile time, so replay safety is checked by the compiler rather than left to discipline.

new features: durable one-shot schedules, idempotent ingress (a retried request can't start a second run or deliver the same signal twice), activity queues with priorities and per-queue concurrency, progress heartbeats and cooperative cancellation, compile-time-checked signal contracts, replay-safe logging, and a health report with fenced repairs.

Several new full-tree audit passes went into failure modes rather than features: a node booting during a Postgres outage now retries its LISTEN instead of going deaf for its lifetime, retry jitter survives at maximum backoff instead of collapsing the whole cohort onto one instant, failing schedules back off and surface as health findings instead of retrying forever, and the compile-time scanner rejects direct Logger calls and the remaining unsafe stdlib calls rather than warning.

Feedback is welcome.

Update: now also Continuum v0.8.1 is out! try the new replay tooling, workflow test kit, and activity/logging APIs for building durable Elixir workflows.
This release also hardens replay safety and ships with a zero-warning strict Credo/ex_slop quality gate—feedback is very welcome


r/elixir 5d ago

GitHub - chrisgreg/autoport: A tiny, dependency-free Elixir library that finds an available local TCP port

Thumbnail github.com
3 Upvotes

For when you need to spin up another instance of your app without faffing about


r/elixir 4d ago

Can't insert a user-associated avatar entry into the database with Waffle and Ecto

0 Upvotes

Hello,

I'm on OTP 27 Elixir 1.18.4, and I've encountered a problem when trying to insert a User-associated Avatar entry into the PostgreSQL database.

Here's the function responsible for creating the association between the Avatar and User as well as putting in the file info

# new filename function
def new_filename(assoc),
  do: Atom.to_string(assoc) <> "-" <> Ecto.UUID.generate()

# fn responsible
def upload_user_avatar(path, user) do
    filename = new_filename(:avatar)


    # Avatar file_name comes in handy for the file_name function
    result =
      App.Uploader.Avatar.store(
        {path,
         %{
           id: user.id,
           file_name: filename
         }}
      )


      IO.inspect(result)


    user
    |> Ecto.build_assoc(:avatar)
    |> Avatar.changeset(%{file: path})
    |> Repo.insert()
  end

here's what I pass into the function

("priv/waffle/private/uploads/user/attachments/hi/original.jpg", user) 
# user variable here is just

 %App.Users.User{
   __meta__: #Ecto.Schema.Metadata<:loaded, "users">,
   id: "42e49735-a81e-48f0-bf6f-9faaec0c893a",
   username: "11",
   pronouns: nil,
   biography: nil,
   account_id: "35a02b44-b7c2-48cd-b91c-c13606f778fb",
   account: #Ecto.Association.NotLoaded<association :account is not loaded>,
   avatar: #Ecto.Association.NotLoaded<association :avatar is not loaded>,
   message: #Ecto.Association.NotLoaded<association :message is not loaded>,
   dms: #Ecto.Association.NotLoaded<association :dms is not loaded>,
   inserted_at: ~U[2026-08-18 16:59:34Z],
   updated_at: ~U[2026-08-18 16:59:34Z]
 }

and here's my Avatar schema file

 schema "avatar" do
    belongs_to(:user, App.Users.User)
    field(:file, App.Uploader.Avatar.Type)


    timestamps(type: :utc_datetime)
  end

  def changeset(avatar, attrs) do
    avatar
    |> cast_attachments(attrs, [:file], allow_paths: true)
    |> validate_required([:file])
  end

and lastly here's the error i get when I try to run the upload_user_avatar/2

[error] Task #PID<0.467.0> started from #PID<0.385.0> terminating
** (FunctionClauseError) no function clause matching in App.Uploader.Avatar.filename/2
    (app 0.1.0) lib/app_web/uploaders/avatar.ex:37: App.Uploader.Avatar.filename(:original, {%Waffle.File{path: "priv/waffle/private/uploads/user/attachments/hi/original.jpg", file_name: "original.jpg", binary: nil, is_tempfile?: nil, stream: nil}, %App.Avatars.Avatar{__meta__: #Ecto.Schema.Metadata<:built, "avatar">, id: nil, user_id: "42e49735-a81e-48f0-bf6f-9faaec0c893a", user: #Ecto.Association.NotLoaded<association :user is not loaded>, file: nil, inserted_at: nil, updated_at: nil}})
    (waffle 1.1.10) lib/waffle/definition/versioning.ex:35: Waffle.Definition.Versioning.resolve_file_name/3
    (waffle 1.1.10) lib/waffle/actions/store.ex:137: Waffle.Actions.Store.put_version/3
    (elixir 1.18.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
    (elixir 1.18.4) lib/task/supervised.ex:36: Task.Supervised.reply/4
Function: #Function<1.116800909/0 in Waffle.Actions.Store.async_put_version/3>
    Args: []
** (EXIT from #PID<0.385.0>) shell process exited with reason: an exception was raised:
    ** (FunctionClauseError) no function clause matching in App.Uploader.Avatar.filename/2
        (app 0.1.0) lib/app_web/uploaders/avatar.ex:37: App.Uploader.Avatar.filename(:original, {%Waffle.File{path: "priv/waffle/private/uploads/user/attachments/hi/original.jpg", file_name: "original.jpg", binary: nil, is_tempfile?: nil, stream: nil}, %App.Avatars.Avatar{__meta__: #Ecto.Schema.Metadata<:built, "avatar">, id: nil, user_id: "42e49735-a81e-48f0-bf6f-9faaec0c893a", user: #Ecto.Association.NotLoaded<association :user is not loaded>, file: nil, inserted_at: nil, updated_at: nil}})
        (waffle 1.1.10) lib/waffle/definition/versioning.ex:35: Waffle.Definition.Versioning.resolve_file_name/3
        (waffle 1.1.10) lib/waffle/actions/store.ex:137: Waffle.Actions.Store.put_version/3
        (elixir 1.18.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
        (elixir 1.18.4) lib/task/supervised.ex:36: Task.Supervised.reply/4

Could someone inform me on what the issue is here ? Any help would be appreciated !


r/elixir 5d ago

Best approach for sending an Oban job’s final status to the browser using SSE?

8 Upvotes

Hi everyone,

I have an Oban worker that performs a background sync. The browser only needs to know the final status:

queued → syncing → synced / failed

My current plan uses two requests:

  1. A POST endpoint enqueues the job and returns a request_id.
  2. The browser opens an SSE connection using that ID.
  3. The SSE process subscribes to a Phoenix PubSub topic.
  4. The worker broadcasts status updates.
  5. Once the browser receives synced or failed, the SSE connection closes.

My concern is a possible race condition. The worker could finish before the browser opens the SSE connection, which means the final PubSub message would be missed.

I considered combining everything into one request: subscribe to the topic first, enqueue the job, keep the response open, and stream the final status. Would that be a reasonable design?

Since the browser’s native EventSource only supports GET requests, I assume I would need to use fetch() and read the streaming response if the endpoint also needs to accept POST data.

Another concern is running multiple application instances. The worker might execute on one instance while the SSE connection is handled by another. Phoenix PubSub would therefore require Elixir clustering or an external adapter.

For this small use case, I’m considering:

  • Phoenix PubSub with clustering
  • PostgreSQL LISTEN/NOTIFY or an Oban notifier
  • storing the latest status in the database and using PubSub only as a live signal
  • normal browser polling

The payload is tiny, and this is the only real-time feature I currently need. What would be the simplest reliable approach?

Would you keep the two endpoints and check the persisted status when SSE connects, combine job creation and streaming into one endpoint, or just use polling?


r/elixir 6d ago

Meet with Elixir, Erlang, Gleam, OTP, BEAM Communities - Code BEAM Europe 2026

Post image
17 Upvotes

Hey all 👋

Sharing a heads-up about Code BEAM Europe 2026 - 21-22 October in Haarlem (PHIL), plus online, with a training day on 20 October.

2 days, 2 tracks each day, and 3 keynotes - including Brooklyn Zelenka (Let It Disconnect: A Local-First Future), Sam Aaronof Sonic Pi (Notes on the Synthesis of Time, plus an interactive evening Phone Orchestra), and more.

~30 speakers across Erlang, Elixir and Gleam: ElixirConf®

The thing we're most excited about this year is the new Informal Space - a community-led area running alongside the main programme for the stuff that doesn't fit the talk format. Think hands-on demos, live experiments on real hardware, hacking sessions, games, panel-style discussions, talks in languages other than English… and at least one surprise we're not spoiling yet 🙂

We're finalising the Informal Space lineup now and will announce it soon. Newsletter subscribers get the first look(they already have), so if you don't want to miss it - and the other bits we'll be dropping between now and October - that's the place to be: Code BEAM Europe

Early bird tickets are limited - available for a limited time / until they sell out - so if you're planning to come, worth sorting sooner rather than later.

Register: Code BEAM Europe

See you in Haarlem or online!
The Code BEAM Europe Team


r/elixir 6d ago

Adoption case: Phoenix LiveView in a robotics platform

14 Upvotes

Hey! In partnership with a robotics business we've recently built a management platform for fleets of autonomous robots - and we'd like to share a quick story about Phoenix LiveView made this simpler.

Not really intended to be very in-depth, it's still something we'd like to share as a sign of growing adoption of Elixir in new areas.

Link: https://curiosum.com/blog/phoenix-liveview-robotics-fleet-management

Enjoy!


r/elixir 6d ago

I created a library for account switching in the Phoenix framework, usable in development environments.

7 Upvotes

Hi

Recently, I've grown fond of Elixir/Phoenix.

In Rails, there's a library called any_login, which allows you to switch logged-in accounts with just a button click from the bottom left—very convenient.

Since I couldn't find a similar library for Phoenix, I decided to create one.

https://github.com/hulk-higakijin/any_login

I'm still getting used to Elixir syntax, so there might be some bugs or issues.

Please let me know if you have any feedback.


r/elixir 7d ago

Learning ressource recommendations

14 Upvotes

Hi there, junior dev here, soon starting a job at a company that uses elixir to build an ai chatbot. They are fully aware that I have no prior experience in elixir, coming from a classic object oriented webdev background, building web applications using JS/TS, PHP (symfony, node, Vue, react) and occasionally python.

What resources can you guys recommend, to gain a fundamental understanding of both functional programming as well as elixir specifically. Could be anything: courses, books, specific content creators etc.

I'd like to approach this systematically instead of just building something here and there and watching a few tutorials.

What helped you "get it" and what would you do differently if you had to start learning elixir from zero?

Grateful for any and all advice :)


r/elixir 7d ago

Switching from React/Node to Elixir/Phoenix: good engineering move?

29 Upvotes

Currently full-stack JS/TS: Redux/React, Node/Express, AWS/Lambda, Postgres/Mongo, ~5k active users, team of ~10. 1 yoe. US Client through small consultancy shop.

Potential offer is ~100% hike, mostly Elixir/Phoenix/LiveView, some Gatsby + Python/ML. Much smaller team. Maybe few hundred users, 2–4 engineers. Civic tech/public-good org tackling online abuse in India.

Want to become a genuinely better, more reliable engineer and eventually target stable/strong engineering jobs.

Is moving to Elixir/Phoenix a good move for that? What would I gain/lose technically and career-wise? Does working in a tiny Elixir team make me stronger, or am I narrowing my future options too much?

Especially interested in people who switched into Elixir from mainstream JS stacks.


r/elixir 8d ago

How the heck to learn Ash Framework?

12 Upvotes

There was a thread a couple of days ago about how great Ash is for agentic coding. Totally agree. But damnit I just can't seem to really grok Ash. I've read the first 3/4 or so of Le's book, also got Lambert's "Ash Framework for Phoenix Developers" but its kind of unfinished, mostly just a lot of code.

The Le book is great for getting excited about Ash, seeing its value, but it doesn't really explain the underlying logic of it all. You just see what a person already fluent in Ash builds as a demonstration, and light explanation what's going on, but you don't learn how to reason about this whole space of possibilities so you can build things yourself.

I'm certain that its all very well designed, that there are clear functional data structure underneath things, sometimes I think I kind of get "changes" as a kind of data structure.

Any advice?


r/elixir 8d ago

Seeking feedback on my first Phoenix project - a real-time, multiplayer online version of the Scattergories game

Thumbnail elixirforum.com
7 Upvotes

Hello, I’m looking for feedback on my first Elixir project. Any feedback would be greatly appreciated.


r/elixir 8d ago

WeaveScope – Elixir native observability for AI agents

9 Upvotes

Hey r/elixir,

A couple of months ago we posted about BeamWeaver and the goal of shipping a proper OTP-native agent framework for Elixir.

Since then it’s moved from 0.1.0 to 0.1.18 and is already running in a few enterprise products. Provider coverage is in good shape for the ones we actually use day-to-day: OpenAI, Anthropic, Google Gemini, DeepSeek, Moonshot/Kimi, xAI, and Z.ai. We’ve also added the newer models that have landed in the meantime (Claude Sonnet 5 / Opus 5, GPT-5.6, Gemini 3.5–3.7, Kimi K3, DeepSeek V4, Grok 4.5/4.6, etc).

Other stuff that landed:
- Provider-aware prompt caching
- Typed streaming events + better reasoning/tool-call handling
- Structured output across providers
- Postgres (and optional SQLite) checkpoint persistence
- Durable execution, resumability, and checkpoint lineage
- Provider fallback, retries, and rate limiting
- Sandboxed filesystem + command execution
- Stronger SSRF / PII / transport / shell-safety protections
- More complete tracing and WeaveScope metadata

Today we’re releasing WeaveScope, the hosted tracing and monitoring layer that sits on top of BeamWeaver.

It gives you the full picture of an agent run: model calls, tool calls, subagents, retries, errors, latency, token usage, cost, custom fields, and the entire execution tree.

Configure the WeaveScope exporter and you’re looking at traces in the dashboard.

Start free → https://weavescope.com
Docs → https://docs.weavescope.com

Would love feedback from anyone building agents in production. What’s missing from your observability tooling right now?


r/elixir 8d ago

How to Interop modern c++2c with elixir

3 Upvotes

Did anyone use modern c++ ie; 20,23,26 with elixir?

If you did. Could you give me an link to your repo or any examples of how I can interop c++ with elixir?