DEV Community

seng
seng

Posted on

learning Erlang step by step[1]

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").

Enter fullscreen mode Exit fullscreen mode

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().
Enter fullscreen mode Exit fullscreen mode

Top comments (0)