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.
Emerge dev-lang/erlang
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.
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.
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").
Windows: werl.exe or "erl" in command prompt if you added it to PATH
Linux: "erl" command
pwd().
prints current directory
cd("DIRECTORY_NAME").
changes directory to "DIRECTORY_NAME"
Ensure that you use "/" and not "\"
c(MODULE_NAME).
to compile the module in the current directory
Once you've compile the file call the function using the module:funtion().
format
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>
Name | E-mail address |
---|---|
Tom Most | mosttw@rose-hulman.edu |
Peter Lundgren | lundgrpb@rose-hulman.edu |
Daniel Waters | watersdc@rose-hulman.edu |
Matthew Luke | lukemc@rose-hulman.edu |