Erlang Flashcards
(39 cards)
erlang og need
telecom systems where reliability, responsiveness, scalability, and constant availability were needed
nature of erlang programs
immutable data, pattern matching, functional programming, garbage collector
sequential subset of erlang lang supports
eager evaluation, single assignment, dynamic typing
normal erlang application built out of
thousands of small erlang programs
BEAM
virtual machine at core of erlang
part of run time system
.beam file extension
Erlang run time system (ERTS) compiles
erlang source code into bytecode which runs on BEAM
ERTS designed for systems with these traits:
distributed, fault tolerant, soft real time, highly available non stop apps, hot swapping
what makes erlang processes “living” objects
data encapsulation, message passing and capable of changing behavior during runtime (hot swapping)
thread of execution
process
how does erlang communicate
asynch signaling
most commonly used signal
message
other common signals
exit, link, unlink, monitor, demonitor
basic unit of concurrency
process
process
lightweight thread of execution that runs independently and communicates with other processes through message passing
how are processes created
spawn function -> takes function as an argument and returns process identifier (pid)
what is a program a call to
call to an initial function
how are processes scheduled
virtual machine (vm)
erlang: let it crash or let it fail
let it fail -> less code devoted to defensive programming
design philosophy
systems -> expect failure to happen, build supervisor structure to monitor executions, detect failures, and restart failed processes
variables
sequence of characters, must begin with uppercase letter
are variables single assignment
yes, value cannot be changed once assigned
atoms
sequence of characters, must begin with lowercase
functions
named sequences of expressions to be evaluated
modules
primary mechanism for organizing erlang code -> contain func defs