![]() |
![]() |
|
![]() |
![]() |
Encyclopedia :
E :
ER :
ERL :
Erlang programming language |
|
|
Erlang programming languageErlang is a general-purpose concurrent programming language andruntime system. The sequential sub-set of Erlang is a functional language, with strict evaluation, single assignment and dynamic typing. It was designed at Ericsson to support distributed, fault-tolerant, soft-real-time, non-stop applications. It is named after A. K. Erlang. It is sometimes mistakenly thought that its name is as abbreviation of ERicsson LANGuage, owing to its heavy use inside Ericsson.
Functional languageCode looks like this: -module(fact). -export([fac/1]). fac(0) -> 1; fac(N) where N > 0 -> N * fac(N-1). Below is an implementation of a Quicksort algorithm. %% quicksort(List)
%% Sort a list of items
-module(quicksort).
-export([qsort/1]).
qsort([]) -> [];
qsort([Pivot|Rest]) ->
qsort([ X || X <- Rest, X < Pivot]) ++ [Pivot] ++ qsort([ Y || Y <- Rest, Y >= Pivot]).
The above example recursively calls the function However, a compare function can be used if the order on which Erlang bases its return value ( Concurrency oriented languageMain strength of Erlang is support for concurrency. It has small but powerful set of primitives to create threads and communicate between them. Location of thread is transparent (it can be within the same operating system process or on different computer). Code examples: Pid ! a_message % send message to the thread (asynchronously)
receive % receive message sent to this thread
a_message -> do_something
end.
Erlang contains mechanisms to deal with errors and to ensure high availability of the whole system. Dynamical replacement of code (hot swapping) is supported. DistributionErlang was released as open source to ensure its dependence on single source and to increase awareness of the language. Distribution of the language together with libraries and real-time distributed database is known as Open Telecom Platform, OTP. Ericsson offers commercial support for Erlang. Since taking the open source path in 1998, it became used by several companies world-wide, including Nortel and T-Mobile. However, it didn't and hasn't yet become a wide-spread mainstream programming language. As of 2005, Erlang is under active development with regular releases. It is available for several Unix-like operating systems and Windows. AdvantagesDisadvantagesSee alsoExternal links
|
|
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License. |
|
| © 2008 Chamas Enterprises Inc. |