5 ms·
Since Elixir runs on the Erlang VM and is more "modern" with modern tooling/resources; should I be using Elixir for new projects or Erlang? (I know neither, but
by h4ch1 3y ago
Since Elixir runs on the Erlang VM and is more "modern" with modern tooling/resources; should I be using Elixir for new projects or Erlang? (I know neither, but I have a good functional background with Haskell).
Also are there cases where one is well suited than the other?
- rramadass 3y agoThink of the relationship between Erlang->Elixir as that between C->C++. The latter is effectively built on the abstract machine model defined by the former. So whether you prefer Elixir or not you have to know Erlang. This becomes even more true when you have to go outside the Elixir/any other BEAM based language ecosystem but still need the BEAM facilities. The Erlang System is actually an "Application Operating System (AOS)" (Joe Armstrong's definition) and the "Erlang language" is its "native system language". An analogy is writing Python code running on Linux but making a kernel system call through the C language interface. Here Python is your Elixir, Linux is the Erlang AOS(ERTS+BEAM) and the C language interface is the Erlang language interface. PS: I hope you have watched the two videos i have linked to in this thread, they are well worth your time and answer all your questions.
- throwawaymaths 3y ago> Think of the relationship between Erlang->Elixir as that between C->C++. This is not right. It's more like Java -> Kotlin > So whether you prefer Elixir or not you have to know Erlang. Not really. You can get quite far in Elixir without knowing any Erlang. Eventually you probably should learn to read Erlang docs (but not necessarily code) and maybe you might need to be able to read Erlang code, but this is truly rare.
- rramadass 3y agoI was making a loose analogy to get the point across and also used the phrase "abstract machine model" for a reason. > It's more like Java -> Kotlin Not quite true either. If you want to do the analogy of a VM-based language the BEAM is not just a VM like the JVM. It plus the rest of the ERTS is an AOS. > Not really. You can get quite far in Elixir without knowing any Erlang. True. But eventually when you do want to go outside of the Elixir ecosystem you need Erlang to access the BEAM facilities. The point was that Erlang is the "native language" of the "Erlang AOS" and is worth knowing whether you prefer Elixir/whatever on BEAM.
- cangeroo 3y agoAs usual, it depends on the use case. Enterprise vs hobbyist, for example. I greatly admire the principles, but in practice, the Erlang platform underdelivers in a modern context, because applications are usually not deployed by hot-swapping, but by rollout on Kubernetes. High availability is achieved by load balancing over horizontal scale-out of pods. Distributed systems today use external systems for state, like databases, keyvalue/caching stores, message queues, etc. Elixir is a convenient language, like Python, with lots of convenience tools. But for a long list of reasons, I wouldn't use it for anything other than prototyping/hobby projects.
- petrocrat 3y agoWhatsApp, famously launched and served millions of users with a small team using Elixir. Seems to me that speaks to the language's production capability, or enterprise capability, if you will. Considering that, can you go more into detail about your assertion here? > But for a long list of reasons, I wouldn't use it for anything other than prototyping/hobby projects.
- cangeroo 3y agoIt's an interesting topic, but it seems that presenting an opposing viewpoint is generally downvoted on Hackernews (and likely other social media), so I'm not sure it's worth spending the time. My position is pragmatic, from a managerial economics perspective, of maximizing value and reducing risk. I suspect that Elixir attracts a fair amount of language enthusiasts, who are somewhat biased when they evaluated the business value of a language choice. WhatsApp/Discord is a very specific use case, of needing a high number of concurrent users that expect real-time messages when to the same session (e.g. chat/chatroom, "Bob is typing..."). AFAIK, BEAM excels at immutability (lots of reads, like readers in a chatroom) and concurrency (vertical scalability). So those are not appropriate reference use cases for the typical user. BEAM is notoriously slow, and has been bottom-ranking in Techempower benchmarks. Although that seems to have improved in recent years. https://www.techempower.com/benchmarks/#hw=ph&test=json§ion=data-r22&l=yw2xv3-cn3 https://www.techempower.com/benchmarks/#hw=ph&test=json§...
- 3y ago