3. Source:
What is Erlang?
Erlang is a programming language used to build
massively scalable soft real-time systems with
requirements on high availability. Some of its uses
are in telecoms, banking, e-commerce, computer
telephony and instant messaging. Erlang's runtime
system has built-in support for concurrency,
distribution and fault tolerance.
Erlang homepage
4. Source:
What is Erlang?
Erlang's syntax is very similar to Prolog's, but the
semantics are very different. An early version of
Erlang was written using Prolog, but today's Erlang
can no longer meaningfully be said to be "based
on Prolog."
StackOverflow
6. Components of Erlang
virtual machine - the new BEAM (Bogdan/Björn's Erlang Abstract
Machine)
OTP - Open Telecom Platform, a framework/library
erl - Erlang interactive console
rebar* - an Erlang build tool [ ]GitHub
* technically it's not an official component, but it is very useful
18. OTP - Open Telecom Platform
OTP stands for Open Telecom Platform, although
it's not that much about telecom anymore (it's
more about software that has the property of
telecom applications, but yeah.) If half of Erlang's
greatness comes from its concurrency and
distribution and the other half comes from its
error handling capabilities, then the OTP
framework is the third half of it.
19. OTP example
-module(server).
-behaviour(myserver).
-export([ % The behaviour callbacks
init/1, % - initializes our process
handle_call/3, % - handles synchronous calls (with response)
handle_cast/2, % - handles asynchronous calls (no response)
handle_info/2, % - handles out of band messages (sent with !)
terminate/2, % - is called on shut-down
code_change/3]). % - called to handle code changes
21. What is Elixir?
Elixir is a dynamic, functional language designed
for building scalable and maintainable
applications. Elixir leverages the Erlang VM, known
for running low-latency, distributed and fault-
tolerant systems, while also being successfully
used in web development and the embedded
software domain.
22. The basics
:hello # an atom
"utf string ąę" # in erlang that would not be so easy
hello = "a thing" # no longer capitalized, yay!
hello = :hello # notice how we can overwrite the value
IO.puts("hellonworld")
length([1,2,3]) # I'll speak of lists in a second
length [1,2,3] # notice how we can skip brackets
25. Modules and functions
defmodule Calculator do
def add(x, y) do
x + y
end
end
defmodule Lists do
def reverse([head|tail], acc) do
reverse(tail, [head|acc])
end
# function clauses do not have to be distinguished
def reverse([], acc) do
acc
end
end
27. Phoenix framework
Phoenix is a web development framework written
in Elixir which implements the server-side MVC
pattern. Many of its components and concepts will
seem familiar to those of us with experience in
other web frameworks like Ruby on Rails or
Python's Django.
29. Bibliography
The official "Getting started" guide -
Learn You Some Erlang -
Erlang Doc on distributed systems -
OTP for beginners -
Elixir Lang homepage -
Phoenix Framework homepage -
http://www.erlang.org/download/getting_started-5.4.pdf
http://learnyousomeerlang.com/
link
link
http://elixir-lang.org/
http://www.phoenixframework.org/