Apr
26
Posted on 26-04-2007
Filed Under (Erlang, Programming) by Federico Feroldi on 26-04-2007

That’s what it takes to write an Hello World program in Erlang, after you installed the Erlang system on your machine.

Here’s the program itself:

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

hello_world()->
    io:format("Hello World ~n").

What does that means? Briefly:

-module(hello).
Create a module for the following functions, think of it like a namespace declaration.

-export([hello_world/0]).
This tells the compiler that we want to export the

hello_world/0

function to the outer world. It means the other modules can call this function. What does the “/0″ means? It means the “hello_world” function with 0 parameters. In Erlang, you can have different functions with the same name and different number of parameters.

hello_world()->
Declare a new function named “hello_world” that accept no parameters, the body will follow the arrow.

    io:format(“Hello World ~n”).
This calls the “format” function from the module “io” that prints out the Hello World message. The “~n” characters prints the Carriage Return, the same as “/n” in other languages.

To run your program you must start the Erlang shell first:

$ erl Erlang (BEAM) emulator version 5.5.4 [async-threads:0] Eshell V5.5.4 (abort with ^G) 1> c(hello). {ok,hello} 2> hello:hello_world(). Hello World ok 3>

Try it, and understand it. Next time will be a little bit more complex! :)

Note: if you guess why by copying and pasting the code you get a lot of errors, that’s because SciTe, the editor I use, exports the code with fancy double quotes. That’s a good reason to not being lazy and write the program by yourself! Writing it’s a nice way of learning! :)

(14) Comments    Read More   
Apr
23
Posted on 23-04-2007
Filed Under (Erlang, Ruby on Rails) by Federico Feroldi on 23-04-2007

Maybe not yet, but it’s interesting to see that Erlang gets mentioned in the Scaling Twitter presentation. Apparently Twitter used the ejabberd Jabber/XMPP server as their instant messaging platform. They also mention RabbitMQ, an Enterprise-class messaging system built in Erlang, as a possible high performance platform for their message passing infrastructure.

(8) Comments    Read More   
Apr
22
Posted on 22-04-2007
Filed Under (Life facts, Yahoo, Talks, PHP) by Federico Feroldi on 22-04-2007

I’m excited, I will give a talk on the PHP usage at Yahoo at the upcoming PHP Day 2007 on the 18th May in Verona.

The GrUSP (Php Italian users and developers group) is pleased to announce the 4th edition of PHP Day. An event totally dedicated to php language is going to be held on Friday 18 May 2007 in Verona (Italy).

During the meeting there will be talks on the professional use of php language (Enterprise path) and more technical conferences (Developer path).

phpday quarta edizione - 18 maggio  2007 verona

(1) Comment    Read More   
Apr
20
Posted on 20-04-2007
Filed Under (Erlang) by Federico Feroldi on 20-04-2007

Recently Erlang is gaining a lot of popularity, probably due to the publishing of the Programming Erlang book from the Pragmatic Programmer. In this article about the Erlang future, Joe Armstrong explaing why Erlang Concurrency Oriented Programming will be much more important from now on, since we’re moving to a multi core processing era!

Nobody can predict the future, but I’m going to make a few informed guesses.

Let’s suppose Intel is right: let’s suppose that the Keifer project succeeds. If this happens, then 32 core processors will appear on the market as soon as 2009/2010.

This comes as no surprise; Sun already ships the Niagara with 8 cores running 4 hyperthreads per core (which is equivalent to 32 cores).

This is a development that makes Erlang programmers very happy. They have been waiting 20 years for this to happen, and now it’s payback time.

Here’s the good news for Erlang programmers:

Your Erlang program should just run N times faster on an N core processor

(5) Comments    Read More