24. 1> User = {"John", "Doe", 35}.
...
2> {Name, Surname} = User.
** exception error: no match of
right hand side value
{"John","Doe",35}
Friday, February 10, 12
42. Concurrency
⢠any function can become a process
⢠process is a function executing in
parallel
⢠process shares nothing with other
processes
Friday, February 10, 12
43. Processes/Actors
⢠processes are extremely lightweight and
fast
⢠~15 seconds to spawn 100k processes on
my machine (MacBook Pro 8.1, OSX)
Friday, February 10, 12
67. 2> actor:start().
3> myActor ! 4.
sqrt(4) = 2.0
4> myActor ! "foo".
Process crashed. Restarting
=ERROR REPORT====
Error in process <0.41.0> ...
5> is_process_alive(whereis(myActor)).
true
6> myActor ! 9.
sqrt(9) = 3.0
Friday, February 10, 12
68. Other great features
⢠Hot code loading
⢠OTP Framework
â˘
Friday, February 10, 12
69. Simplicity
⢠You just learned
⢠~70% of Erlang syntax
⢠most major abstractions: modules,
functions and processes
⢠most of the core data types
Friday, February 10, 12
70. Complexity
⢠Erlang/OTP is a complex framework
⢠Learning it takes time and practice
Friday, February 10, 12
71. Bad Stuff
⢠syntax
⢠Strings
⢠code organization
⢠libraries
⢠underestimated complexity of OTP and
concurrent applications generally
⢠your colleagues will not understand you :)
Friday, February 10, 12