beam me up, scotty
TRANSCRIPT
GPad
Born to be a developer with an interest in “system admin”
I develop using many languages like C++, C#, js and ruby. I have recently fallen in love
with functional programming, especially with elixir, erlang, clojure and haskell.
CTO & founder of coders51
We develop web and mobile solutions for the entire galaxy
We don’t develop web sites
At least not simple ones ...
Every time there is something new and interesting, we want to be there!!
HistoryFrom http://www.erlang.org/course/history
● 1982 -1985 - First experiment with 20 different languages.
● 1985 - 1986 - Experiments with Lisp,Prolog, Parlog etc. Conclusion: The language
must contain primitives for concurrency and error recovery.
● 1987 - First experiment with Erlang.
HistoryFrom http://www.erlang.org/course/history
● ...
● 1990 - Erlang is presented at ISS'90, which results in several new users.
● 1992 - Erlang is ported to VxWorks, PC, Macintosh etc. Three applications using
Erlang are presented at ISS'92.
● 1993 - Distribution is added to Erlang, which makes it possible to run a
homogeneous Erlang system on a heterogeneous hardware.
HistoryFrom https://en.wikipedia.org/wiki/Java_version_history#JDK_Alpha_and_Beta
The first alpha and beta Java public releases in 1995 had highly unstable APIs and
ABIs. The supplied Java web browser was named WebRunner.
From https://en.wikipedia.org/wiki/Java_version_history#JDK_1.0
The first version was released on January 23, 1996 and called Oak.[3][4] The first
stable version, JDK 1.0.2, is called Java 1.
HistoryFrom https://en.wikipedia.org/wiki/.NET_Framework_version_history#.NET_Framework_1.0
The first version of the .NET Framework was released on 13 February 2002 for Windows 98,
ME, NT 4.0, 2000, and XP.
Why BEAMFrom http://www.erlang.org/
Erlang is a programming language used to build massively scalable soft real-time
systems with requirements on high availability. Some of its uses are in telecoms,
banking, e-commerce, computer telephony and instant messaging. Erlang's
runtime system has built-in support for concurrency, distribution and fault
tolerance.
Why BEAMFrom http://stackoverflow.com/questions/16779162/what-kind-of-virtual-machine-is-beam-the-erlang-vm
The Erlang VM runs as one OS process. By default it runs
one OS thread per core to achieve maximum utilisation of
the machine. The number of threads and on which cores they
run can be set when the VM is started.
Why BEAMFrom http://stackoverflow.com/questions/16779162/what-kind-of-virtual-machine-is-beam-the-erlang-vm
Erlang processes are implemented entirely by the Erlang VM and have no
connection to either OS processes or OS threads. So even if you are running an
Erlang system of over one million processes it is still only one OS processes and
one thread per core. So in this sense the Erlang VM is a "process virtual machine"
while the Erlang system itself very much behaves like an OS and Erlang process
have very similar properties to OS processes, for example isolation. There is
actually an Erlang VM, based on the BEAM, which runs on the bare metal and is
in fact an OS in its own right, see Erlang on Xen.
Why BEAMFrom http://stackoverflow.com/questions/16779162/what-kind-of-virtual-machine-is-beam-the-erlang-vm
Btw it is perfectly possible to have systems running millions
of Erlang processes and it is actually done in some products,
for example WhatsApp.
We were definitely thinking very much about OSes when we
designed the basic Erlang environment.
Robert Virding
DEMO
https://github.com/gpad/beam-me-up-scotty/blob/master/beam.md
Why BEAM● A lot of process
● Message passing
● Link e monitored process
● GC distributed on every process
● Built with distributed in mind
● Not only ...
OTPFrom http://www.erlang.org/
OTP is set of Erlang libraries and design principles providing
middle-ware to develop these systems. It includes its own
distributed database, applications to interface towards other
languages, debugging and release handling tools.
DEMO
https://github.com/gpad/beam-me-up-scotty/blob/master/otp.md
https://github.com/gpad/beam-me-up-scotty/blob/master/distributed.md
Why OTP● GenServer
● Supervisor
● A lot of other patterns ...
● Always think in async and distributed way (timeout)
● The community think about to increase (CRDT, Kademlia, GenStage, etc…)