Erlang Programming QuickStart with Hello-World on GNU/Linux

December 28th, 2015 by thelinuxevangelist

Erlang Getting-Started for Linux




The Linux Tutorial Shows You Step-by-Step How-to Install and Getting-Started with the Erlang Programming Language with an Hello World Example on severals 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 QuickStart 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
(Visited 6 times, 1 visits today)
Share on Tumblr

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


Comments are disabled