www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - erlang-vs-scala

reply janderson <askme me.com> writes:
A friend at work pointed out this article to me:

http://yarivsblog.com/articles/2008/05/18/erlang-vs-scala/

-Joel
Jun 03 2008
next sibling parent Sean Kelly <sean invisibleduck.org> writes:
This is a fairly interesting blog as well:

http://www.sauria.com/blog/2008/05/28/notes-on-a-history-of-erlang/

It's largely a collection of quotes from Joe Armstrong, the creator
of Erlang.  Here's one of the many that may be interesting regarding
D 2.0:

"… the status of Erlang as a fully &#64258;edged member of the functional
family is dubious. Erlang programs are not referentially transparent
and there is no system for static type analysis of Erlang programs. Nor
is it relational language. Sequential Erlang has a pure functional subset,
but nobody can force the programmer to use this subset; indeed, there
are often good reasons for not using it."

The blog also notes that Joe Armstrong has never mentioned the Actor
model in relation to Erlang, and suggests that this means that the Actor
model was rediscovered independently during the creation of Erlang.


Sean
Jun 04 2008
prev sibling next sibling parent reply renoX <renosky free.fr> writes:
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
Jun 08 2008
next sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
renoX wrote:
 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).

When developing in Java for Eclipse (that has a ~1 min startup time), I frequently use hot-swapping and am often annoyed the sun JVM only allows hot-swapping for method body changes. I looked into adding native code hot-swapping support on top of DDL, but it looked like all the challenges of writing a static linker + a dynamic linker + a compiler, so I gave up.
Jun 08 2008
prev sibling next sibling parent bearophile <bearophileHUGS lycos.com> writes:
renoX:
 whereas Scala has a really nice syntax (better than D's),

It's not just a matter of syntax, Scala has other kind of ideas too. I think D may enjoy some ideas coming from Scala. If you (or someone else) knows Scala, then I suggest to write a list of ideas that can be interesting for D. Bye, bearophile
Jun 09 2008
prev sibling next sibling parent reply Sean Kelly <sean invisibleduck.org> writes:
== Quote from renoX (renosky free.fr)'s article
 janderson a écrit :
 A friend at work pointed out this article to me:

 http://yarivsblog.com/articles/2008/05/18/erlang-vs-scala/

 -Joel

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).

This isn't always feasible. Consider a phone switch (the purpose for which Erlang was created in the first place). In such instances, even if the programmer has the money and the space for duplicate hardware (unlikely, if you've ever seen a phone switch) then they would still have to reroute all new calls to the backup box and then wait an indefinite period for all existing calls to complete before cycling the old box. As someone who has actually done this, I can tell you that I'd have much preferred simply having new calls simply be able to use the new software.
 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..

I disagree. The Erlang syntax is really pretty straightforward. In fact, the Erlang book covers the entire language in about the first two chapters, and leaves the rest for discussing concepts like concurrency. I felt that this was more than enough coverage for the language itself, and was able to get going with Erlang in the short time it took me to read these first few chapters. There are some things that most users won't need to know anyway, like bit packing and dealing with binary blobs.
 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

Fair enough. I was drawn to D for its syntax rather than what it did as well, so I can see how someone might be drawn to Scala for the same reason. Sean
Jun 09 2008
parent reply renoX <renosky free.fr> writes:
Sean Kelly a écrit :
 == Quote from renoX (renosky free.fr)'s article

 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..

I disagree. The Erlang syntax is really pretty straightforward.

Sure, but straightforward isn't the same as easy to learn: you cannot make a syntax more straightforward than Lisp's syntax but this doesn't make the language easy nor pleasant to learn.. Why? Because it's different from what we're used to. And what about the single assignment? Personally I'm not fond of functional programming only. Regards, renoX
Jun 09 2008
parent Sean Kelly <sean invisibleduck.org> writes:
== Quote from renoX (renosky free.fr)'s article
 Sean Kelly a écrit :
 == Quote from renoX (renosky free.fr)'s article

 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..

I disagree. The Erlang syntax is really pretty straightforward.

make a syntax more straightforward than Lisp's syntax but this doesn't make the language easy nor pleasant to learn..

Fair enough.
 Why? Because it's different from what we're used to.
 And what about the single assignment?
 Personally I'm not fond of functional programming only.

I agree that it's important for mutability to be available if necessary. But Erlang integrates reasonably well with C, so I don't consider this an issue really. In fact, I prefer this approach to the "all in one" approach that D 2.0 seems to be aiming for, as I prefer that there be a semantic separation between my functional and imperative code. I feel that this is a good way of preventing "bleed through" of concepts that would complicate and confuse code. It also neatly avoids a motivator for producing monolithic code, and the consequent risk that the mutable-state portion may fail and corrupt the entire process. But this is really a matter of preference. I'm sure many people disagree, and others simply don't work on the type of applications Erlang was designed to target. I just happen to be in the niche that Erlang was specifically intended for. I only wish I'd heard about it 15 years ago instead of spending all that time mucking about with C++. Sean
Jun 09 2008
prev sibling next sibling parent reply Juan Jose Comellas <jcomellas gmail.com> writes:
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

Jun 14 2008
parent Robert Fraser <fraserofthenight gmail.com> writes:
Charles Hixson wrote:
 On Sat, 14 Jun 2008 12:26:43 -0300, Juan Jose Comellas wrote:
 
 ...
 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

... 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


Isn't Erlang extremely slow, though? The comparisons I seen all place it several times slower than, say, Ruby at the same task. (Granted the tasks were chosen to compare languages that are largely single stream of execution. I'm thinking of places like http://shootout.alioth.debian.org/)

For multithrreaded tasks it does much better, but not as well as multithreaded code written in a native language. When you're developing, say, for a supercomputer where a fifty clock cycle difference in an inner loop/frequently called function can man 3 more days of execution time when the program is used in production, these things tend to matter a lot more.
Jun 14 2008
prev sibling parent Charles Hixson <charleshixsn earthlink.net> writes:
On Sat, 14 Jun 2008 12:26:43 -0300, Juan Jose Comellas wrote:

 ...
 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. ... 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


Isn't Erlang extremely slow, though? The comparisons I seen all place it several times slower than, say, Ruby at the same task. (Granted the tasks were chosen to compare languages that are largely single stream of execution. I'm thinking of places like http://shootout.alioth.debian.org/)
Jun 14 2008
prev sibling parent reply Georg Wrede <georg nospam.org> writes:
janderson wrote:
 A friend at work pointed out this article to me:
 
 http://yarivsblog.com/articles/2008/05/18/erlang-vs-scala/

This is what I'd call invisible advertising in blogs. The mention of D is quite brief, but amounts to product placing in film/TV, for which companies traditionally pay top dollar. Very effective.
Jun 10 2008
parent reply janderson <askme me.com> writes:
Georg Wrede wrote:
 janderson wrote:
 A friend at work pointed out this article to me:

 http://yarivsblog.com/articles/2008/05/18/erlang-vs-scala/

This is what I'd call invisible advertising in blogs. The mention of D is quite brief, but amounts to product placing in film/TV, for which companies traditionally pay top dollar. Very effective.

I didn't see a reference to D. Note: My motivation was that a wide range of views/understandings are helpful in the never ending quest to improve programming skill and language design. -Joel
Jun 12 2008
parent Robert Fraser <fraserofthenight gmail.com> writes:
janderson wrote:
 I didn't see a reference to D.

Quote at the end of the article.
Jun 13 2008