170 likes | 422 Views
I CAN ERLANG. AND SO CAN YOU. ORIGINS. Who was this Erlang guy?. Mathematician, engineer. Invented traffic engineering and queuing theory. Invented the Erlang formula, a cornerstone of modern telecommunication network studies. Has a unit of measurement named for him. Agner Erlang.
E N D
I CAN ERLANG • AND SO CAN YOU
Who was this Erlang guy? • Mathematician, engineer. • Invented traffic engineering and queuing theory. • Invented the Erlang formula, a cornerstone of modern telecommunication network studies. • Has a unit of measurement named for him. Agner Erlang
What’s an Erlang? • Erlang was created by Ericsson in 1986 and designed by Joe Armstrong. • Erlang was later open-sourced in 1998. • Erlang is a functional programming language.
What’s it for? • Erlang is for mission critical applications • Concurrency
What’s so special about it? • Ability to be concurrent like a bad mammajamma. • Hot code swapping. • Soft-real time. • Fault tolerant.
Data Types • Aside from your standard fare of integers and floats, there are several other data types in Erlang. • Funs, pids and atoms • Syntactic sugar includes strings and records.
Built to be concurrent • Processes do not belong to the operating system, they are their own thing. Threads included. • Processes have their own memory space, not shared. • A benchmark made in 2005 made it to 20 million processes. The only limitation was memory.
How? • Each process has a dedicated mailbox. • The mailbox can receive anything Erlang. • Messages are passed asynchronously. • Messages are not necessarily executed in the order received.
When a process crashes, it will notify other processes and the will figure out how to handle it. • All of this is monitored by a supervisor process. Its only task is to watch for crashes. • This leads to a theoretical nine 9’s reliability rating or 99.9999999% uptime. (not counting software upgrade downtime). With that, it’s more like 5 nines.
Who uses this? • Maybe you have heard of them, but Facebook uses Erlang to power their messaging system. • Whatsapp uses it to power theirs as well. • T-Mobile uses it for authentication and SMS.
Enter Elixir • Elixir is an extension of Erlang. Making it way easier to type out things (no periods!)