Language Installation Instructions
Programming Language Paradigms

  1. Installation
    1. Linux
    2. Windows
  2. “Hello world” in Erlang
  3. Team contact information

Installation

Linux

Ubuntu/Debian

Install the erlang package with your favorite package management tool (aptitude is suggested).

Note that on a desktop Ubuntu system the Erlang prompt erl is already available, as it is used for Desktop Couch. Installing the erlang package will pull in more libraries than are in the base install, however.

Gentoo

Emerge dev-lang/erlang

LUG server

Erlang is installed on the LUG server! ssh lug.rose-hulman.edu will get you there. Log in using your Rose username and password, unless you've had a local account set up.

Windows

Download the latest windows binary from http://www.erlang.org/download.html. As of Sep. 2010, the latest is opt_win32_R14B.exe.

Run the exe. Click next, next, install, and close.

Add Erlang to your PATH variable (optional). Right click on My Computer. Properties. Advanced. Environment Variables. Add ;C:\Program Files\erl5.8.1\bin to the end of PATH. You can now run the Erlang shell by typing erl into a command prompt.

“Hello world” in Erlang

Save the following as "hello.erl"

Module name in "-module() needs to match file name!

-module(hello).
-export([start/0]).

start() ->
	io:format("Hello, World!~n").
	

HOWTO run Erlang Code

1) Start up the Erlang Shell

Windows: werl.exe or "erl" in command prompt if you added it to PATH

Linux: "erl" command

2) Change directory to that of the file you wish to compile and run

pwd(). prints current directory

cd("DIRECTORY_NAME"). changes directory to "DIRECTORY_NAME"

Ensure that you use "/" and not "\"

3) Compile the code

c(MODULE_NAME). to compile the module in the current directory

4) Run it

Once you've compile the file call the function using the module:funtion(). format

Example

This is a transcript of the aboves steps on Windows.

Erlang R14B (erts-5.8.1) [smp:2:2] [rq:2] [async-threads:0]

Eshell V5.8.1  (abort with ^G)
1> pwd().
C:/Documents and Settings/watersdc
ok
2> cd("My Documents/CSSE 403 PLP/Erlang").
C:/Documents and Settings/watersdc/My Documents/CSSE 403 PLP/Erlang
ok
3> c(hello).
{ok,hello}
4> hello:start().
Hello, World!
ok
5>
	

Team contact information

NameE-mail address
Tom Mostmosttw@rose-hulman.edu
Peter Lundgrenlundgrpb@rose-hulman.edu
Daniel Waterswatersdc@rose-hulman.edu
Matthew Lukelukemc@rose-hulman.edu