Skip to main content

Elixir

Pronunciation
ih-LIK-ser
Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/elixir

In short

Elixir is a dynamic, functional language that runs on the Erlang virtual machine and is known for building fault-tolerant, highly concurrent systems.

What is Elixir?

Elixir is a general-purpose, functional programming language created by José Valim and first released in 2012, with version 1.0 arriving in 2014. It runs on the BEAM, the virtual machine built for Erlang, so it inherits decades of engineering for systems that must stay up for years. Elixir adds a friendlier syntax, macros for metaprogramming, and modern tooling such as the mix build tool and the Hex package manager.

Elixir code runs in lightweight processes, tiny isolated units managed by the BEAM rather than by the operating system, and a single server can run millions of them. Processes share no memory and communicate only by sending messages, while supervisors watch over them and restart any that crash, an approach known as "let it crash". Elixir is dynamically typed, and recent versions have begun adding a gradual type checker to the compiler.

Data in Elixir is immutable, and the pipe operator |> passes the result of one function as the first argument of the next, so a transformation reads from top to bottom like a recipe. Elixir is used for web applications and APIs, often with the Phoenix framework, and for real-time chat and notification systems, embedded devices and data pipelines.

Elixir is closely related to Erlang, and the two are often confused. Both compile to bytecode for the same BEAM virtual machine and can call each other's code directly, so Elixir projects use Erlang's OTP libraries for supervision and distribution. The difference is mostly on the surface: Elixir has a Ruby-inspired syntax, macros and newer tooling, while Erlang has a Prolog-inspired syntax and a longer history in telecom.

Key takeaways

  • Elixir runs on the BEAM, the Erlang virtual machine, and interoperates with Erlang code.
  • Lightweight processes and message passing make massive concurrency practical.
  • Supervisors restart failed processes, which helps systems recover automatically.
  • Data is immutable, and the pipe operator |> chains transformations.
  • It is popular for real-time web applications, often with the Phoenix framework.

Example

Pipes and lightweight processes in Elixirelixir
# Pipe a string through a series of transformations
"the quick brown fox jumps over the lazy dog"
|> String.split()
|> Enum.map(&String.length/1)
|> Enum.sum()
|> IO.puts()   # 35

# Spawn a lightweight process and send it a message
pid = spawn(fn ->
  receive do
    {:greet, name} -> IO.puts("Hello, #{name}!")
  end
end)
send(pid, {:greet, "Ada"})

Readers ask

What is the difference between Elixir and Erlang?

Both run on the same BEAM virtual machine and share the OTP libraries, so they have the same concurrency and fault-tolerance model. Elixir offers a Ruby-like syntax, macros and modern tooling, while Erlang is the older language with its own Prolog-inspired syntax.

What is Elixir used for?

Elixir is used for web backends, real-time features like chat and live dashboards, messaging systems, embedded devices and data processing pipelines, anywhere high concurrency and uptime matter.

Is Elixir statically typed?

Elixir is dynamically typed, but since 2024 its compiler has been gaining a gradual, set-theoretic type system that catches some type errors without requiring annotations. Developers can also write typespecs and run separate analysis tools.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings