6. And other fun stuff
•
Huge, expressive standard lib
•
Heredocs, Multiline Strings, String Interpolation
•
Sigils(i.e %w/%c etc)
•
Great documentation
•
ITS FUN(C) TO WORK WITH
13. The pipe operator
We all wrote code like this from time to time:
people
!
orders
tax
filing
!
=
=
=
=
DB.find_customers!
Orders.for_customers(people)!
sales_tax(orders, 2013)!
prepare_filing(tax)!
Or worse, this:
filing =
prepare_filing(sales_tax(Orders.for
_customers(DB.find_customers)))!
21. Few notes about actors
•
They’re fast & lightweight - you can have 10,000 of
them on a tiny machine.
•
The queue is managed by the VM
•
Support hot-swapping
22. Native support for multi
machine distribution
•
on
~>
on
~>
!
Actors can be on a local or remote VM, and it’s
transparent to you!
machine1!
iex --name node1@machine1.com --cookie a_cookie_string!
machine2!
iex --name node2@machine2.com --cookie a_cookie_string!
iex(node1@machine1.com)1> Node.connect :"node2@machine2.com"!
true!
!
iex(node1@machine1.com)2> print_node_name = fn -> IO.puts Node.self end!
#Function<erl_eval.20.80484245>!
!
iex(node1@machine1.com)3> Node.spawn(:"node2@machine2.com", print_node_name)!
node2@machine2.com!
#PID<7789.49.0> !
24. Reliability
•
Linked processes/Supervisor tree
•
Failover nodes
•
Hot code reload
•
20 years of battle-tested code, it’s VERY hard to break.
•
used by a very huge scale applications:
•
Facebook Messages/ WhatsApp
•
Riak/ CouchDB/ RabbitMQ