Scanning the Internet for External Cloud Exposures via SSL Certs
Erlang crash course CiA Oslo 2012
1. Crash course in Erlang
Erlang in 15 minutes
Page 1
Baksia CiA2012 Erlang
, 09.02.12
2. " Erlang
• The world is concurrent
• Things in the world don't share data
• Things communicate with messages
• Things fail
- Joe Armstrong
Page 2
Baksia CiA2012 Erlang
, 09.02.12
3. " What is Erlang
• Created and maintained by Ericsson (now open source)
• Functional, single assignment, strict evaluation, dynamic
typing
• Actor model, concurrent oriented, fault tolerant, soft-realtime
• Light weight processes that communicate using message
passing (an Erlang process is more light weight than a
Java thread)
• Erlang started life as a modified prolog
• Erlang shell, escript and compiled .beam bytecode
Page 3
Baksia CiA2012 Erlang
, 09.02.12
4. " Atoms and tuples
• An atom is a global constant starting with lower case
• A tuple is an ordered set of elements
• Your Java or C# class would be a tuple with an atom
identifier
Page 4
Baksia CiA2012 Erlang
, 09.02.12
5. " Erlang processes
• Erlang is designed for massive concurrency. Erlang
processes are light-weight (grow and shrink dynamically)
with small memory footprint, fast to create and terminate
and the scheduling overhead is low.
• A process is created by calling spawn
• Spawn returns a process Id PID in which you can send
messages to with the bang ! sign
Page 5
Baksia CiA2012 Erlang
, 09.02.12
13. " Tail optimized recursion
tail
recursion
as
seen
here
is
not
making
the
memory
grow
because
when
the
virtual
machine
sees
a
funcAon
calling
itself
in
a
tail
posiAon
(the
last
expression
to
be
evaluated
in
a
funcAon),
it
eliminates
the
current
stack
frame.
Page 13
Baksia CiA2012 Erlang
, 09.02.12
15. " BIF Built In Functions
• BIFs are functions that are part of the Erlang language
• BIFs usually do tasks that are impossible to do in Erlang
• list_to_tuple([22,cat,”text”]).
• spawn(fun() -> my_fun(“Hello”) end).
Page 15
Baksia CiA2012 Erlang
, 09.02.12
16. " Learn you some Erlang
• Great site
• http://learnyousomeerlang.com/
Page 16
Baksia CiA2012 Erlang
, 09.02.12
17. CiA
2012
-‐
Bridging
the
gaps
8
februar
17:30
–
20:30
Page 17
Baksia CiA2012 Erlang
, 09.02.12