Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Technology domain:
Erlang falls under the domain of functional programming languages. Therefore it
inherits all features common to functional programming languages.
It’s a declarative languages and declarative languages work on the principle of
trying to describe what should be computed, rather than saying how a value is
calculated which makes Erlang programs short and compact.
Peer technologies:
Currently there are other functional programming languages parallel to Erlang like
F#, LISP, Ocaml etc.
But Erlang has unique characteristics (described below) which gives it an advantage
over other peer functional programming languages.
Erlang characteristics:
Process scalability:
Erlang processes are lightweight because the Erlang virtual machine does not
create an OS thread for every created process. They are created, scheduled, and
handled in the VM, independent of the underlying operating system. As a result,
process creation time is of the order of microseconds and independent of the
number of concurrently existing processes. Compared with Java and C#, where for
every process an underlying OS thread is created, Erlang greatly outperforms both
languages.
Robustness:
Erlang has a set of simple but powerful error-handling mechanisms and exception
monitoring constructs, very general library modules have been built, with
robustness designed into their core. The libraries are collectively known as the OTP
(Open Telecom Platform) middleware. By programming for the correct case and
letting these libraries handle the errors, not only are programs shorter and easier to
understand, but they will usually contain fewer bugs.
Erlang processes can be linked together so that if one crashes, the other will be
informed, and then can either handle the crash or choose to crash itself. OTP
provides a number of generic behaviors, such as servers, finite state machines, and
event handlers. These generic behaviors are linked to a supervisor behavior whose
only task is to monitor and handle process termination. OTP puts the idea of links
into a framework whereby a process supervises other workers and supervisors, and
may itself be supervised by yet another process, all in a hierarchical structure.
** Case studies of existing systems build with Erlang has proven "five nines"
availability.
Summary:
If the requirement is to build a single threaded application which does a lot of
calculations, a graphics intensive system or client software running on a mobile,
Erlang might not be the best choice.
But if the target system is a high-level, concurrent, robust, soft real-time system
that will scale in line with demand, make full use of multi-core processors, and
integrate with components written in other languages, Erlang should be the choice.