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.
History
The name “Erlang”, attributed to Bjarne Däcker, has been presumed by those working on the telephony switches (for whom the language was designed) to be a reference to Danish mathematician and engineer Agner Krarup Erlang or the ubiquitous use of the unit named for him, and (initially at least) simultaneously as a syllabic abbreviation of “Ericsson Language”.
1982 - 1985
Experiments with programming of telecom using > 20 different languages. Conclusion: The language must be a very high level symbolic language in order to achive productivity gains ! (Leaves us with: Lisp , Prolog , Parlog …)
1985 - 1986
Experiments with Lisp,Prolog, Parlog etc. Conclusion: The language must contain primitives for concurrency and error recovery, and the execution model must not have back-tracking. (Rules out Lisp and Prolog.) It must also have a granularity of concurrency such that one asyncronous telephony process is represented by one process in the language. Rules out Parlog. We must therefore develop our own language with the desirable features of Lisp, Prolog and Parlog, but with concurrency and error recovery built into the language.
1987
The first experiments with Erlang.
1988
ACS/Dunder Phase 1. Prototype construction of PABX functionality by external users Erlang escapes from the lab!
1989
ACS/Dunder Phase 2. Reconstruction of 1/10 of the complete MD-110 system. Results: » 10 times greater gains in efficency at construction compared with construction in PLEX!Further experiments with a fast implementation of Erlang.
1990
Erlang is presented at ISS’90, which results in several new users, e.g Bellcore.
1991
Fast implementation of Erlang is released to users. Erlang is represented at Telecom’91 . More functionality such as ASN1 - Compiler , graphical interface etc.
1992
A lot of new users, e.g several RACE projects. Erlang is ported to VxWorks, PC, Macintosh etc. Three applications using Erlang are presented at ISS’92. The two first product projects using Erlang are started.
1993
Distribution is added to Erlang, which makes it possible to run a homgeneous Erlang system on a heterogeneous hardware. Decision to sell implementations Erlang externally. Separate organization in Ericsson started to maintain and support Erlang implementations and Erlang Tools.
Installation
Erlang Solutions offers a number of installs at http://www.erlang.org/downloads. Erlang/OTP Platform is a complex system composed of many smaller applications (modules). Installing the erlang package automatically installs the entire OTP suite. Since some of the more advanced users might want to download only a specific selection of modules, Erlang/OTP has been divided into smaller packages, all with the prefix ‘erlang-‘, that can be installed without launching the erlang package.
Most OS package managers provide pre-built binary packages. You can also download the latest stable releases from Erlang Solutions or try install with package managers.
1
2
3
4
5
For Homebrew on OS X: brew install erlang
For MacPorts on OS X: port install erlang
For Ubuntu and Debian: apt-get install erlang
For Fedora: yum install erlang
For FreeBSD: pkg install erlang
Shell
On Windows command line type werl on Linux or Mac OS X type erl.
Browsing the archives
Argument in parentheses but in quotes, preferably double quotes.
Doing …
Functions …
Mathematical functions supported by Erlang’s math module simple examples.
Numbers
Erlang recognizes integers and floating-point numbers. Uses the 64-bit IEEE 754-1985 “double precision” representation. This means that it keeps track of about 15 decimal digits plus an exponent.
Digits+Exponent notation
Base2+Value notation
Base16+Value notation
Variables
Variable can’t be signed with a new value.
Show bounded variables **b() . **
Clearing bounded variables **f(variable) . **
Clearing all bounded variables **f() . **
Continue …