Hello Erlang

This seminar is not compulsory but highly recomended for those of you that need help in learning Erlang. We will do some Erlang programming and explore how messages can be sent across a network. If you do not have any problems programming in Erlang you can safely skip this seminar.

After this seminar you're expected to know how to work in a Erlang programming environment. You should be able to write, compile and run smaller Erlang programs.

KTH student computer room

If you work with the KTH computers, you will not be able to run Erlang distributed over the network. You can however run several Erlang shells on the same computer and let them communicate with each other. In order to start Erlang in local distribution mode you start Erlang as follows:

erl -sname foo -setcookie secret

and

erl -sname bar -setcookie secret

Now check which name your erlang node has with the call node(). It will probably say something like foo@pc9826. Now, if you register a process under a name "q" then the you should be able to send a message to this process using

{q, 'foo@pc9826'} ! hello.

Ubuntu and other linux users

If you're using Ubuntu you could install Erlang in less than three minutes.  However the repository in for example Ubuntu does no longer include the erlang-wx module. We use wxWorks, a graphics package,  for som of the labs and to get it to work with Erlang we need the erlang-wx module. The simplest solution is to instead go to Erlang Solutions and install the latest version of the Erlang systems. When you do this you might have to reolve some dependencies but you should be up and running in no time.

Choose your favorite packet manager  and search for "erlang". Choose the main erlang paket and if you want to use Emacs as a development environment also choose "erlang-mode". The "erlang-doc" packet is also nice since then you will have the html documentation local on your machine.

If you're running other operating systems, you will find packets for most platforms at Erlang Solutions. If not you should be able to compile a system using the source found at www.erlang.org. The Erlang system is ported to most platforms so it should not be a problem.

Emacs

It's only fun to use Emacs if you learn the twenty most common commands using ctr- and esc-sequences. If you google on "emacs commands" you will find many good listings that wil explain what you need to know.

Warning, once you master Emacs there is no going back!

Teacher Johan Montelius created page 8 July 2012

Johan Montelius edited 25 August 2012

This seminar is not compulsory but highly recomended for those of you that need help in learning Erlang. We will do some Erlang programming and explore how messages can be sent across a network. If you do not have any problems programming in Erlang you can safely skip this seminar.


* An Erlang Primer
After this seminar you're expected to know how to work in a Erlang programming environment. You should be able to write, compile and run smaller Erlang programs.

At the six'th floor If you work with the KTH computers on six'th floor you will not be able to run Erlang distributed over the network. You can however run several Erlang shells on the same computer and let them communicate with each other. In order to start Erlang in local distribution mode you start Erlang as follows:

erl -sname foo -setcookie secret

and

erl -sname bar -setcookie secret

Now check which name your erlang node has with the call node(). It will probably say something like foo@pc9826. Now, if you register a process under a name "q" then the you should be able to send a message to this process using

{q, 'foo@pc9826'} ! hello.

Ubuntu and other linux users If you're using Ubuntu you will install Erlang in less than three minutes. Choose your favorite packet manager  and search for "erlang". Choose the main erlang paket and if you want to use Emacs as a development environment also choose "erlang-mode". The "erlang-doc" packet is also nice since then you will have the html documentation local on your machine.

If you're running other linux or unix distributions, you will find packets for most platforms if you look around. If not you should be able to compile a system using the source found at www.erlang.org. The erlang system is ported to most platforms so it should not be a problem.

Emacs It's only fun to use Emacs if you learn the twenty most common commands using ctr- and esc-sequences. If you google on "emacs commands" you will find many good listings that wil explain what you need to know.

Warning, once you master Emacs there is no going back!

Windows users Install Erlang from www.erlang.org. As a IDE you can choose Eclipse (there are plugins for Erlang) but I would recomend Emacs and install the Erlang modules that will allow you to run Erlang inside Emacs.

Feedback News