Erlang Programming Quick-Start with Hello-World on GNU/Linux

December 28, 2015 | By the+gnu+linux+evangelist.

Erlang Getting-Started for Linux

You are Welcome! The Tutorial shows you Step-by-Step How to Install and Getting-Started with the Erlang Programming Language with an Hello World Example on several GNU/Linux Distributions.

Open Source Erlang is a Functional Programming Language designed at the Ericsson Computer Science Laboratory.

Some of Erlang main Features are:

  • Clear declarative syntax and is largely free from side-effects
  • Built-in support for real-time, concurrent and distributed programming
  • Designed for development of robust and continuously operated programs
  • Dynamic code replacement at runtime

The Erlang distribution also includes OTP (Open Telecom Platform) which provides a rich set of libraries and applications.

Erlang Quick Start for Linux - Featured
  1. How to Install Erlang on Linux Distros

    Erlang SetUp for Linux
  2. Open a Shell Terminal emulator window
    (Press “Enter” to Execute Commands)

    Erlang Hello World on Linux - Featured

    Create an Erlang Hello World
    Here for simplicity I’ll make use of the nano editor..

    mkdir ~/Documents/erlang

    To put stuff into order an erlang directory is created with the above command

    cd ~/Documents/erlang

    We change to the target directory

    nano helloworld.erl

    And Append this Erlang content:

    -module(helloworld).
    -export([start/0]).
    
    start() -> io:format("Hello world~n").
    

    Ctrl+x to Save & Exit from nano editor

  3. Executing the Erlang Hello World.

    chmod +x ~/Documents/erlang/helloworld.erl

    This to give Execution Permissions

    erl

    Then we start the Erlang Shell to Compile and Run the example

    1> c(helloworld).
    {ok, helloworld}
    

    To compile the Erlang helloworld Module

    2> helloworld:start().
    Hello world
    ok
    

    To Run

    3> halt().
    

    To Stop the program
    In the end to Quit the Erlang shell hits Ctrl+c twice…

  4. OnLine Erlang Tutorials and Documents

    Erlang Docs

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

QuickChic Theme • Powered by WordPress