Main Page
From Erlang Community
| Revision as of 08:03, 24 September 2007 (edit) Karl (Talk | contribs) m (Fixed RSS-links, now points to the most recent post in the topic, rather than to the topic itself) ← Previous diff |
Revision as of 08:50, 14 October 2007 (edit) (undo) Admin (Talk | contribs) Next diff → |
||
| Line 14: | Line 14: | ||
| === What is Erlang and OTP? === | === What is Erlang and OTP? === | ||
| - | Erlang is a programming language and | + | Erlang is a programming language used to build server side industrial grade scalable, massively scalable soft real-time systems with high availability requirements. 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. Originally developed at Ericsson, it was released as open source in 1998. |
| - | + | OTP is set of Erlang libraries and design principles providing middle-ware to develop these systems. It includes its own distributed database, SNMP and CORBA agents, debugging tools and release handling tools. These tools and applications distributed by Ericsson are complemented by numerous other open source project projects. | |
| ====Here is an example of Erlang code:==== | ====Here is an example of Erlang code:==== | ||
Revision as of 08:50, 14 October 2007
Your Erlang Community SiteWelcome to trapexit.org, the Erlang community site where you can read news and weblogs related to Erlang/OTP, discuss projects, issues and ideas with other Erlang developers, and read and publish articles and HowTos related to Erlang/OTP. Trapexit NewsWhat is Erlang and OTP?Erlang is a programming language used to build server side industrial grade scalable, massively scalable soft real-time systems with high availability requirements. 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. Originally developed at Ericsson, it was released as open source in 1998. OTP is set of Erlang libraries and design principles providing middle-ware to develop these systems. It includes its own distributed database, SNMP and CORBA agents, debugging tools and release handling tools. These tools and applications distributed by Ericsson are complemented by numerous other open source project projects. Here is an example of Erlang code:
-module(beersong).
-author('BillClementson').
-export([sing/0]).
-define(TEMPLATE_0, "~s of beer on the wall, ~s of beer.~n"
"Go to the store and buy some more,"
"99 bottles of beer on the wall.~n").
-define(TEMPLATE_N, "~s of beer on the wall, ~s of beer.~n"
"Take one down and pass it around, ~s"
" of beer on the wall.~n~n").
create_verse(0) ->
{0, io_lib:format(?TEMPLATE_0, phrase(0))};
create_verse(Bottle) ->
{Bottle, io_lib:format(?TEMPLATE_N, phrase(Bottle))}.
phrase(0) -> ["No more bottles", "no more bottles"];
phrase(1) -> ["1 bottle", "1 bottle", "no more bottles"];
phrase(2) -> ["2 bottles", "2 bottles", "1 bottle"];
phrase(Bottle) ->
lists:duplicate(2,integer_to_list(Bottle) ++ " bottles") ++
[integer_to_list(Bottle-1) ++ " bottles"].
bottles() -> lists:reverse(lists:seq(0,99)).
sing() ->
lists:foreach(fun spawn_singer/1, bottles()),
sing_verse(99).
spawn_singer(Bottle) ->
Pid = self(),
spawn(fun() -> Pid ! create_verse(Bottle) end).
sing_verse(Bottle) ->
receive
{_, Verse} when Bottle == 0 ->
io:format(Verse);
{N, Verse} when Bottle == N ->
io:format(Verse),
sing_verse(Bottle-1)
after
3000 ->
io:format("Verse not received after 3 seconds"
" - re-starting singer~n"),
spawn_singer(Bottle),
sing_verse(Bottle)
end.
StarterGood places to start on trapexit.org HowTo documents - Tutorials and Guides for Erlang developers |
|

Digg It
Del.icio.us
Reddit
Facebook
Stumble Upon
Technorati

