<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">On Tue, Mar 26, 2019 at 5:42 AM joe mcguckin <<a href="mailto:joe@via.net">joe@via.net</a>> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What’s the main difference between Erlang & Elixir? What web framework is popular with Erlang?<br>
Just as a toy app  for learning a bit of both languages I want to implement a URL shortner.<br>
<br></blockquote><div><br></div><div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">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.</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">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.<br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Does a CPU with more cores tend to handle more of a load? If so, it seems to me that a multi-socket <br>
RYZEN platform ought to be a good choice.<br>
<br></blockquote><div><br></div><div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">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.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Also, I saw a talk given by someone from WhatApp and he mentioned that they had a lot of internal BEAM fixes<br>
for performance speedups. Does anyone know if those fixes have been merged back into the public sources?<br>
<br></blockquote><div><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">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.</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"></div><br></div></div>