2. What is Elixir?
A Ruby-inspired language built on the Erlang Virtual
Machine
Extends Erlang with macros, pipelines, and sigils
Your next programming language
3. What is Erlang?
Created in 1986 by Ericsson
Open sourced in 1998
Functional, concurrent language
Based on Prolog, Smalltalk, CSP, and functional
programming
21. Elixir Syntax: Fn
fn (x) -> x * x end
&(&1 * &1)
!
fn (x, y) -> x + y * 2 end
&(&1 + &2 * 2)
22. Elixir Syntax:
Modules and Functions
defmodule Demo do
def say_hello() do
IO.puts(“Hello”)
end
def say_goodbye(), do: IO.puts(“Goodbye”)
defp private_function(), do: “Top Secret”
end