by @saigowthamr

How to write hello world in Erlang

Home » erlang » How to write hello world in Erlang

This example will show you how to write a hello world program in Erlang.

  1. Create a new file called hello.erl.
  2. Now add the following code and save it.
-module(hello).
-export([hello_world/0]).

hello_world() -> io:fwrite("hello, world\n").
  • Compile the program by running the below command in your terminal (erlang shell).
1> c(hello_world).
2> hello_world:hello().
hello world
ok