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
https://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