Main Page

From Erlang Community

Your Erlang Community Site

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.

Trapexit News

New HowTo on Measuring Execution Time!

Adam Lindberg has contributed an article on how to measure the execution time of function calls, adding to trapexit's extensive collection of tutorials and howtos. To view it, click Here... If you have similar tutorials and articles you want to share with Erlang Users, add them in the Erlang Wiki.

What is Erlang and OTP?

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. 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, applications to interface towards other languages, debugging and release handling tools. These tools and applications distributed by Ericsson are complemented by numerous other open source 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.


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 to Erlang related sites outside Trapexit
RSS Feeds related to Erlang, including blogs and software development

Latest Forum Posts

Erlang

RE: An Absolute Beginner!!
  (Sat May 17, 2008 7:31 pm)
RE: Trace Files for Erlang
  (Tue May 06, 2008 10:00 am)

Open Telecom Platform (OTP)

OTP Supervisor with added functionality?
  (Tue Apr 29, 2008 9:38 pm)
JInterface and java 1.5
  (Wed Apr 16, 2008 7:43 am)

Advanced Erlang/OTP

RE: GS module info
  (Fri May 02, 2008 9:09 pm)
RE: GS module info
  (Fri May 02, 2008 6:02 pm)

User Contributions

Erlbol : Erlang + REBOL gui
  (Wed May 07, 2008 4:25 pm)

Improvements

RE: missing files in tutorials?
  (Wed Feb 06, 2008 3:00 am)

Latest Planet Entries

Caoyuan's Blog: Scala for NetBeans Screenshot#12: Better Completion with More Types Inferred
  (Fri May 09, 2008 11:52 am)
Caoyuan's Blog: Which Programming Language J. Gosling Would Use Now, Except Java?
  (Thu May 08, 2008 2:39 pm)
EazyErl!: EasyErl goes Mobile Friendly
  (Thu May 08, 2008 8:35 am)
Hypothetical Labs: Busy x 10^bazillion
  (Thu May 08, 2008 12:55 am)
Torbjorn Tornkvist: The dsl_engine demo
  (Wed May 07, 2008 12:47 pm)

Latest Wiki Changes

Installing Erlang OTP on Asus EEE Pc
  (Fri May 02, 2008 3:59 pm)

Mailing Lists Posts

Erlang questions mailing list

RE: question: gen_sctp problems on macosx / linux
  (Mon Apr 28, 2008 4:06 pm)

Yaws mailing list

RE: DIME attachments in soap server
  (Fri Apr 25, 2008 11:47 am)

Erlyweb mailing list

RE: [Idea] A more generic validation function
  (Wed Apr 23, 2008 3:59 pm)

RabbitMQ mailing list

RE: RabbitMQ perfomance testing & troubles
  (Fri Apr 25, 2008 6:15 am)


Erlang/OTP Projects
Personal tools