erlang-vs-scala

Juan Jose Comellas jcomellas at gmail.com
Sat Jun 14 08:26:43 PDT 2008


Hot code swapping is essential for a lot of projects, especially if you need
to run 24x7, and it's completely trivial to do in Erlang. It's true that
its syntax looks alien and some of its limitations are baffling at first,
but there are very good reasons for them. Single assignment is very
important for handling concurrency. It makes the language safe and allows a
lot of optimizations at the VM level. In Erlang you normally have thousands
of lightweight processes (similar to Java's green threads) running, and
each one of them has its own heap, which can be garbage-collected
individually so that the application is never stopped completely during a
garbage-collection cycle.

Erlang is much simpler than either C++ or Java. The problem is just that it
doesn't share a "common ancestor" with them. That, and the lack of a huge
amount of libraries, are the biggest hurdles for its general adoption. I
still think that the future looks very promising for it, as there isn't any
other language that is better suited for tackling projects with massive
concurrency with the maturity that the Erlang VM provides today.

I've recently moved a 15-developer project from Java/C to Erlang/C and in my
experience it takes about a week for a Java developer to understand
Erlang's syntax and write simple programs with it, and 3 to 4 weeks to be
able to use Erlang and the OTP framework productively. It helps a lot if
you have been exposed to a functional programming language before, of
course, but it's not critical.


renoX wrote:

> janderson a écrit :
>> A friend at work pointed out this article to me:
>> 
>> http://yarivsblog.com/articles/2008/05/18/erlang-vs-scala/
>> 
>> -Joel
> 
> Very interesting, thanks.
> 
> Ssome advantage of Erlang are mostly theoretical in my book: 'hot code
> swapping' bah, if you want to have full availability you need redundant
> hardware and you can use this for software version change (though it's
> not trivial I agree).
> If you don't need full availability you just stop your software for
> version change: it's much more simple this way.
> 
> Also, I disagree about the 'ease' of learning Erlang: Erlang has an
> alien syntax (which I don't like much) and an alien way of doing things
> (single assignment) which is not so easy for developers..
> IMHO developers learn Erlang because it's good at distributed
> programming not because of the language itself whereas Scala has a
> really nice syntax (better than D's), but it's not as good as
> distributed programming some criticism in the article where interesting
> (cooperative scheduling)..
> 
> renoX




More information about the Digitalmars-d mailing list