A popular program for Erlang beginners is "Hello, World". We can write the following code and save it in a file called hello.erl:
-module(hello).
-export([start/0]).
start() ->io:format("Hello, World!~n").
Then, we can open the Erlang Shell, where we can write and run small amounts of Erlang code. Enter the following commands to run the Hello World program:
% Compile the module
c(hello).
% Run the function
hello:start().
Top comments (0)