Erlang Central

Hello World

Revision as of 00:28, 5 September 2006 by Bfulgham (Talk | contribs)


You want to write the classic "Hello World!" program in Erlang.


This is very easy in Erlang:

1> "Hello World!".
"Hello World!"
2> io:fwrite("Hello World!\n").
Hello World!


Erlang provides an interactive prompt, called the Read-Eval-Print-Loop (REPL), that allows you to type some simple function definitions into Erlang and have them evaluated immediately. This allows for much more immediate feedback than compiled languages.

This is the first program many C programmers write, but it isn't the best way to start programming Erlang. Erlang makes extensive use of the functional style and it is better to become acquainted with this style before delving into input and output.