aspose file tools*
The moose likes Threads and Synchronization and the fly likes General Erlang questions to book authors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "General Erlang questions to book authors" Watch "General Erlang questions to book authors" New topic
Author

General Erlang questions to book authors

Rohan kanade
Ranch Hand

Joined: Oct 22, 2009
Posts: 106
Hello, I have never used Erlang , but I once heard that erlang was used to write facebook's chat system.

So it got me curious enough to come over here to ask some questions in general.

my functional programming experience is limited only upto Haskell and scala currently.

So I would like to ask a few noobie questions

Since Erlang was intended for telecom operations software , why is there a push currently to use as a web backend development tool?
How does Erlang's performance compares to Current tools/languages used for web backend development ?
How can Erlang be source interpreted and also compile to bytecode for a VM and also compile to native assembly? Which one is better for what purpose?
Please briefly talk about hotswapping of code in the above context. how is done for say a natively compiled binary of Erlang code?

Lastly , any examples of open source production usage for Erlang other than the telecom domain?


SCJP 1.6 ,SCWCD 5
Alain O'Dea
Greenhorn

Joined: Nov 16, 2010
Posts: 9
Erlang has demonstrated leadership
positions with several Open Source middleware products. This seems to be its strength.

Zotonic, the Erlang CMS (a truly superior CMS, I have personal experience with this):
http://zotonic.com/

ejabberd (the leading Jabber server):
http://www.ejabberd.im/

RabbitMQ (the leading AMQP solution):
http://www.rabbitmq.com/

Basho Riak (the leading eventually consistent Key-Value store):
https://wiki.basho.com/display/RIAK/Who+is+Using+Riak

Apache CouchDB (the leading document database):
http://couchdb.apache.org/

Gemini Mobile's Hibari (transactional Key-Value store):
http://www.geminimobile.com/technologies/technologiesDB.html

YAWS (out scales Apache):
http://yaws.hyber.org/

There are many other excellent Open Source players in the Erlang community that have driven commercial success for companies. It has a very solid track record for delivering both in closed and open source deployments.
Rohan kanade
Ranch Hand

Joined: Oct 22, 2009
Posts: 106
Rohan kanade wrote:
Since Erlang was intended for telecom operations software , why is there a push currently to use as a web backend development tool?

How does Erlang's performance compares to Current tools/languages used for web backend development ?

How can Erlang be source interpreted and also compile to bytecode for a VM and also compile to native assembly? Which one is better for what purpose?

Please briefly talk about hotswapping of code in the above context. how is done for say a natively compiled binary of Erlang code?




thanks for the answer about production usage. but,
Can you shed light on some the above questions too ? especially about the hotswapping question.
Alain O'Dea
Greenhorn

Joined: Nov 16, 2010
Posts: 9
Since Erlang was intended for telecom operations software , why is there a push currently to use as a web backend development tool?

This is directly related to Erlang's concurrent I/O handling. It handles very high connection loads more efficiently with respect to memory and CPU usage than typical server systems like Servlets and Apache.

How does Erlang's performance compares to Current tools/languages used for web backend development ?

Erlang's is not competitive on computational performance, but a web back-end typically depends more on I/O than computation.

How can Erlang be source interpreted and also compile to bytecode for a VM and also compile to native assembly? Which one is better for what purpose?

I have only ever used the bytecode mode of compilation for production use. It performs well beyond my expectations. I don't think native compilation makes a compelling difference for web back-end usage.

Please briefly talk about hotswapping of code in the above context. how is done for say a natively compiled binary of Erlang code?

I do not know how natively compiled Erlang modules get hotswapped. In bytecode hotswapping new module code can be run by calling the function through the module rather than making a local function call. The difference is hot_module:function() instead of function(). If new code for the module hot_module is available it simply runs. The new code needs to be loaded into BEAM, but many servers (like Zotonic) do this automatically when they see new versions of the bytecode in the code path.
Richard Carlsson
author
Greenhorn

Joined: Nov 07, 2010
Posts: 9
Rohan kanade wrote:Since Erlang was intended for telecom operations software , why is there a push currently to use as a web backend development tool?
How does Erlang's performance compares to Current tools/languages used for web backend development ?
How can Erlang be source interpreted and also compile to bytecode for a VM and also compile to native assembly? Which one is better for what purpose?
Please briefly talk about hotswapping of code in the above context. how is done for say a natively compiled binary of Erlang code?

Lastly , any examples of open source production usage for Erlang other than the telecom domain?



Alain has already helped answer some of these questions quite well. For the question about Erlang as a telecom systems language, first read my answer at http://www.coderanch.com/t/517451/threads/java/Erlang-OTP. These language properties simply make Erlang a good choice as a backend for most kinds of network servers, including web servers.

About performance: Erlang was never designed mainly for computational speed, but the BEAM emulator is surprisingly fast, and native code is even faster. See the erlang-questions@erlang.org mailing list archive for many interesting discussions about optimizing Erlang programs.

Regarding bytecode compilation (the default), interpretation (done in the interactive shell), and native-compilation (optional), this is no different from what any other modern language does, including Java. Erlang currently doesn't do just-in-time native compilation, but there is nothing that prevents this either. For the time being, the user has to decide if it's worth it to compile to native code: it can make debugging harder, and many typical Erlang applications are more I/O intensive than CPU intensive, so they would gain nothing in any case. However, native compilation of certain CPU-heavy modules might speed up that part of the code enough so that you don't need to write a separate C driver, and that would make it worthwhile.

The details of hot swapping code, native or bytecode interpreted, are too complicated to discuss here. You might like to look at some papers from the High-Performance Erlang research group: http://www.it.uu.se/research/group/hipe/publications.shtml
Rohan kanade
Ranch Hand

Joined: Oct 22, 2009
Posts: 106
Thanks a lot for the detailed answers , I will definitely be using Erlang for some of my hobby projects to get a feel of it.
Alain O'Dea
Greenhorn

Joined: Nov 16, 2010
Posts: 9
Don't hesitate to ask questions on erlang-questions. To join the list visit the Erlang FAQ for instructions:
http://erlang.org/faq.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: General Erlang questions to book authors