Erlang
1. Write a Hello World Erlang Program
Create the helloworld program using a Vim editor as shown below.
$ vim helloworld.erl
% hello world program
-module(helloworld).
-export([start/0]).
start() ->
io:fwrite("Hello, world!\n").
Note: Comment in Erlang starts with %.
2. Compile the erlang program
Compile the erlang hello world which will create the executable.
$ erlc helloworld.erl
$ ls
helloworld.beam helloworld.erl
3. Execute the erlang Program
Execute as shown below.
$ erl -noshell -s helloworld start -s init stop
Hello, world!
4. Erlang one liner
You can also execute erlang from the command line as shown below. This will print Hello World!.
$ erl -noshell -eval 'io:fwrite("Hello, World!\n"), init:stop().'
Hello, World!


Tutorials 