Erlang Central

Difference between revisions of "Main Page"

From ErlangCentral Wiki

m (Removed some categories that were covered elsewhere)
Line 41: Line 41:
  
 
The Open Transaction Platform (OTP) is set of Erlang libraries and design principles providing middle-ware to develop distributed, fault tolerant, massively concurrent soft real-time systems.
 
The Open Transaction Platform (OTP) is set of Erlang libraries and design principles providing middle-ware to develop distributed, fault tolerant, massively concurrent soft real-time systems.
 +
 +
====Here is an example of Erlang code:====
 +
<pre style="float:left">
 +
-module(beersong).
 +
-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.
 +
</pre>
  
 
==Starter==
 
==Starter==
Line 47: Line 92:
  
 
[[:Category:HowTo|HowTo documents]] - Tutorials and Guides for Erlang developers<br/>
 
[[:Category:HowTo|HowTo documents]] - Tutorials and Guides for Erlang developers<br/>
[[:Category:CookBook|Erlang Cookbook]] - A large collection of Erlang solutions to specific problems<br/>
+
[[:Category:CookBook|Erlang Cookbook]] - A collection of Erlang solutions to specific problems<br/>
 
[[:Category:Concepts|Erlang Concepts]] - Articles dealing with specific Erlang aspects<br/>
 
[[:Category:Concepts|Erlang Concepts]] - Articles dealing with specific Erlang aspects<br/>
 
[[:Category:Best Practices|Erlang Best Practices]] - Articles dealing with best practices in Erlang<br/>
 
[[:Category:Best Practices|Erlang Best Practices]] - Articles dealing with best practices in Erlang<br/>
 
+
[[:Category:Articles|Erlang Articles]] - Articles of interest to Erlang developers and testers<br/>
[[:Category:Articles|Erlang Articles]]<br/>
+
 
+
 
[[ErlangJobs]] - Erlang and Erlang related Jobs<br/>
 
[[ErlangJobs]] - Erlang and Erlang related Jobs<br/>
  
Line 58: Line 101:
 
*[[:Category:Links|Links]]
 
*[[:Category:Links|Links]]
 
*[http://www.trapexit.org/planet/ Check out our RSS Feeds]
 
*[http://www.trapexit.org/planet/ Check out our RSS Feeds]
 
== Help with wiki ==
 
 
If you need help with using a wiki, please read trough the MediaWiki [http://meta.wikimedia.org/wiki/Help:Contents help pages].
 

Revision as of 19:02, 2 July 2007

Your Erlang Community Site

Trapexit News

<irss max=1 news=true>http://www.trapexit.org/forum/rss_mod.php?f=19</irss>

Latest Forum Posts

<irss max=3>http://www.trapexit.org/forum/rss_mod.php?f=23</irss>
<irss max=3>http://www.trapexit.org/forum/rss_mod.php?f=7</irss>
<irss max=3>http://www.trapexit.org/forum/rss_mod.php?f=14</irss>

Latest Mailing Lists Posts

<irss max=3>http://www.trapexit.org/forum/rss_mod.php?f=2</irss>
<irss max=1>http://www.trapexit.org/forum/rss_mod.php?f=11</irss>
<irss max=1>http://www.trapexit.org/forum/rss_mod.php?f=12</irss>

Welcome 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.

What is Erlang and OTP?

Erlang is a programming language and a runtime system with strong built-in support for concurrency, distribution and fault tolerance. Originally developed at Ericson, Erlang was released as open source in 1998.

The Open Transaction Platform (OTP) is set of Erlang libraries and design principles providing middle-ware to develop distributed, fault tolerant, massively concurrent soft real-time systems.

Here is an example of Erlang code:

-module(beersong).
-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.

Starter

Good places to start on trapexit.org

HowTo documents - Tutorials and Guides for Erlang developers
Erlang Cookbook - A collection of Erlang solutions to specific problems
Erlang Concepts - Articles dealing with specific Erlang aspects
Erlang Best Practices - Articles dealing with best practices in Erlang
Erlang Articles - Articles of interest to Erlang developers and testers
ErlangJobs - Erlang and Erlang related Jobs

Links