Languages Features Creators Calendar CSV Resources Blog About Pricing Add Language
GitHub icon


Elixir - Programming language

< >

Elixir is a programming language created in 2011 by JosΓ© Valim.

#46on PLDB 12Years Old 55.9kUsers
31Books 3Papers 89kRepos

Try now: Riju Β· TIO

Elixir is a functional, concurrent, general-purpose programming language that runs on the Erlang virtual machine (BEAM). Elixir builds on top of Erlang and shares the same abstractions for building distributed, fault-tolerant applications. Elixir also provides a productive tooling and an extensible design. Read more on Wikipedia...

Example from Riju:
IO.puts("Hello, world!")
Example from hello-world:
#!/usr/bin/env elixir IO.puts "Hello World"
# Hello world in Elixir defmodule HelloWorld do IO.puts "Hello, World!" end
Example from Linguist:
%{"cowboy": {:hex, :cowboy, "1.0.0"}, "cowlib": {:hex, :cowlib, "1.0.1"}, "hackney": {:hex, :hackney, "0.14.3"}, "hound": {:hex, :hound, "0.6.0"}, "httpoison": {:hex, :httpoison, "0.5.0"}, "idna": {:hex, :idna, "1.0.1"}, "phoenix": {:hex, :phoenix, "0.10.0"}, "plug": {:hex, :plug, "0.11.1"}, "poison": {:hex, :poison, "1.3.1"}, "ranch": {:hex, :ranch, "1.0.0"}}
Example from Wikipedia:
task = Task.async fn -> perform_complex_action() end other_time_consuming_action() Task.await task

Keywords in Elixir

after and catch do else end false fn in nil not or rescue true when

Language features

Feature Supported Token Example
Unicode Identifers βœ“
Ξ΄ = 0.00001
Case Sensitivity βœ“
Exceptions βœ“
raise "oops, something went wrong"
Pattern Matching βœ“
def fib(0), do: 1
def fib(1), do: 1
def fib(n) when n >= 2, do: fib(n-1) + fib(n-2)
Runtime Guards βœ“
def abs(number) when number > 0, do: number
def abs(number), do: -number
Garbage Collection βœ“
Multiline Strings βœ“
template = """
This is the first line.
This is the second line.
This is the third line.
Infix Notation βœ“
seven = 3 + 4
Scientific Notation βœ“
Anonymous Functions βœ“
fn -> IO.puts("hello world") end
Pipes βœ“
"Elixir" |> String.graphemes() |> Enum.frequencies()
Streams βœ“
Macros βœ“
defmodule Example do
  defmacro macro_inspect(value) do
  def fun_inspect(value) do
Polymorphism βœ“
Range Operator βœ“
Single Dispatch βœ“
Maps βœ“
%{key: "value"}
Booleans βœ“ true false
Binary Literals βœ“
# 0b[01]+
Integers βœ“
# \d(_?\d)*
Floats βœ“
# \d(_?\d)*\.\d(_?\d)*([eE][-+]?\d(_?\d)*)?
Hexadecimals βœ“
# 0x[\da-fA-F]+
Octals βœ“
# 0o[0-7]+
Strings βœ“ "
"Hello world"
Lists βœ“
my_list = [1, 2, 3, 4, 5]
Regular Expression Syntax Sugar βœ“
~r/integer: \d+/
Print() Debugging βœ“ IO.puts
Message Passing βœ“
send(pid, :ping)
Line Comments βœ“ #
# A comment
Default Parameters Pattern βœ“
def multiply(a, b \\ 1) do
  a * b
Conditionals βœ“
if true do
  IO.puts("Hello world")
Assignment βœ“
name = "John"
File Imports βœ“
# Alias the module so it can be called as Bar instead of Foo.Bar
alias Foo.Bar, as: Bar

# Require the module in order to use its macros
require Foo

# Import functions from Foo so they can be called without the `Foo.` prefix
import Foo

# Invokes the custom code defined in Foo as an extension point
use Foo
Comments βœ“
# this is a comment
Disk Output βœ“
File.write!("helloworld.txt", "Hello, world!\n")
Shebang βœ“
#!/usr/bin/env elixir
Case Insensitive Identifiers X
Multiple Dispatch X
Units of Measure X
Pointers X
Semantic Indentation X
MultiLine Comments X

Books about Elixir from ISBNdb

title authors year publisher
Learning Elixir Ballou, Kenny 2016 Packt Publishing
"Programming Elixir 1.2: Functional > Pragmatic > Fun" Thomas, Dave 2016 Pragmatic Bookshelf
"Programming Elixir 1.3: Functional > Pragmatic > Fun" Thomas, Dave 2016 Pragmatic Bookshelf
"Programming Elixir β‰₯ 1.6: Functional > Pragmatic > Fun" Thomas, Dave 2018 Pragmatic Bookshelf
The Little Elixir & OTP Guidebook Tan Wei Hao, Benjamin 2016 Manning Publications
Elixir Cookbook Pereira, Paulo A 2015 Packt Publishing
Elixir in Action Juric, SaΕ‘a 2015 Manning
Programming Phoenix LiveView: Interactive Elixir Web Programming Without Writing Any JavaScript Tate, Bruce A. and DeBenedetto, Sophie 2022 Pragmatic Bookshelf
Learning Elixir Ballou, Kenny 2016 Packt Publishing
Erlang and Elixir for Imperative Programmers Loder, Wolfgang 2016 Apress
Phoenix Web Development: Create rich web applications using functional programming techniques with Phoenix and Elixir Voloz, Mike and Richey, Brandon 2018 Packt Publishing
Adopting Elixir Ben Marx; Jose Valim; Bruce Tate 20180314 Pragmatic Bookshelf
Introducing Elixir Simon St. Laurent; J. David Eisenberg 20161222 O'Reilly Media, Inc.
Introducing Elixir Laurent, Simon St.; Eisenberg, J. David 20151216 O'Reilly Media, Inc.
Introducing Elixir Simon St. Laurent 20140910 O'Reilly Media, Inc.
Mastering Elixir Andre Albuquerque; Daniel Caixinha 30-07-2018 Packt Publishing
Programming Ecto: Build Database Apps in Elixir for Scalability and Performance Wilson, Darin and Meadows-Jonsson, Eric 20190416 Pragmatic Bookshelf
Programmer Passport: Elixir Bruce Tate 20220622 Pragmatic Bookshelf
Designing Elixir Systems With OTP James Edward Gray II; Bruce A. Tate 20191202 Pragmatic Bookshelf
Concurrent Data Processing in Elixir Svilen Gospodinov 20210725 Pragmatic Bookshelf
Craft GraphQL APIs in Elixir with Absinthe Bruce Williams; Ben Wilson 20180327 Pragmatic Bookshelf
Build a Weather Station with Elixir and Nerves Alexander Koutmos; Bruce Tate; Frank Hunleth 20220106 Pragmatic Bookshelf
Build a Binary Clock with Elixir and Nerves Frank Hunleth; Bruce Tate 20220802 Pragmatic Bookshelf
Property-Based Testing with PropEr, Erlang, and Elixir Fred Hebert 20190117 Pragmatic Bookshelf
Designing Elixir Systems With OTP James Edward Gray II; Bruce A. Tate 20191202 Pragmatic Bookshelf
Genetic Algorithms in Elixir Sean Moriarity 20210120 Pragmatic Bookshelf
Exploring Graphs With Elixir Tony Hammond 20221025 Pragmatic Bookshelf
Testing Elixir Andrea Leopardi; Jeffrey Matthias 20210330 Pragmatic Bookshelf
Metaprogramming Elixir Chris McCord 20150129 Pragmatic Bookshelf
Learn Functional Programming with Elixir Ulisses Almeida 20180201 Pragmatic Bookshelf
Functional Web Development with Elixir, OTP, and Phoenix Lance Halvorsen 20180101 Pragmatic Bookshelf

Publications about Elixir from Semantic Scholar

title authors year citations influentialCitations
Elixir programming language evaluation for IoT Geovane Fedrecheski and L. Costa and M. Zuffo 2016 6 0
A Gradual Type System for Elixir Mauricio Cassola and AgustΓ­n Talagorria and Alberto Pardo and Marcos Viera 2020 2 0
An Elixir library for programming concurrent and distributed embedded systems Humberto RodrΓ­guez-Avila and E. G. Boix and W. Meuter 2017 1 0
mathematica.html Β· elixir.html Β· visual-basic.html

View source

- Build the next great programming language Β· Search Β· v2023 Β· Day 208 Β· Docs Β· Acknowledgements Β· Traffic Β· Traffic Today Β· Mirrors Β· GitHub Β·