Hello, world! — In Erlang

The Hello World application serves as a very basic introduction to programming in a new language. So we start off with another Hello World, this time in Erlang.
Create your source file, helloworld.erl, using a text editor:
helloworld.erl

-module(helloworld).
-export([main/0]).

main() ->
	io:fwrite("Hello, world!~n", []).

Compile your Erlang code:

c(helloworld).
{ok,helloworld}

Run your Erlang program:

helloworld:main().
Hello, world!
ok

There you go! Your first Erlang program.
Share