Erlang questions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Erlang questions

joe mcguckin
What’s the main difference between Erlang & Elixir? What web framework is popular with Erlang?
Just as a toy app  for learning a bit of both languages I want to implement a URL shortner.

Something a little bit more complicated than “Hello World!”.

Does a CPU with more cores tend to handle more of a load? If so, it seems to me that a multi-socket
RYZEN platform ought to be a good choice.

Also, I saw a talk given by someone from WhatApp and he mentioned that they had a lot of internal BEAM fixes
for performance speedups. Does anyone know if those fixes have been merged back into the public sources?

Thanks,

Joe


Joe McGuckin
ViaNet Communications

[hidden email]
650-207-0372 cell
650-213-1302 office
650-969-2124 fax



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Erlang questions

Jesper Louis Andersen-2
On Tue, Mar 26, 2019 at 5:42 AM joe mcguckin <[hidden email]> wrote:
What’s the main difference between Erlang & Elixir? What web framework is popular with Erlang?
Just as a toy app  for learning a bit of both languages I want to implement a URL shortner.


Both Erlang and Elixir run on the same Bytecode engine, called BEAM. From a language perspective they are much more alike than they are different. The two main differences, as I see them, are that Elixir has some neat support for protocols; a somewhat bastardized version of what one would call an interface, and is also embracing macros to a much greater extent than typical Erlang code.

As for web frameworks, the dominant one on Elixir is Phoenix. On the Erlang side, there is Zotonic, and also n2o. At a lower level, one that could be suitable for a simple URL shortener, you could just use a web server such as cowboy directly. I want to stress these are just what I remember: there are more frameworks out there for Erlang, so do a search.

Does a CPU with more cores tend to handle more of a load? If so, it seems to me that a multi-socket
RYZEN platform ought to be a good choice.


More cores will not make a single process any faster. But if you have multiple processes, which can all do work at the same time, the VM will start using additional cores. If you have a RYZEN platform with multiple sockets, 128 threads of execution is not that far fetched. You can utilize this, provided you have 128 url shortening requests at the very same time in your system.
 
Also, I saw a talk given by someone from WhatApp and he mentioned that they had a lot of internal BEAM fixes
for performance speedups. Does anyone know if those fixes have been merged back into the public sources?


Modern BEAM (OTP-21 and later versions) implemented a set of optimizations which has made some of the older WhatsApp changes obsolete. WA still have a set of unique optimizations though. Most notably a way to quickly empty a queue and a way to push a message to the front of the queue. The latter breaks the semantics of Erlang and the message order guarantees, but WA uses it to check for progress in certain core processes, which makes sense.



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions