Hacker News new | past | comments | ask | show | jobs | submit login

Elixir is great but it most definitely doesn't fit the "C++ strengths" part of the requirements. Contrary to popular belief, Elixir is a slow language. Think Python/Ruby slow for compute-intensive tasks.



It's slow compared to C++, but for most tasks its ~5x faster than python or Ruby. If the task is parallelizable, it will be quite a bit faster. But yeah, you aren't going to be doing math with Elixir. One of the things you'll get with Elixir/BEAM languages is really low and stable latency. You'll never get that with long running Python or Ruby processes.


Well, it's mainly slow in one thing: math. Why? The BEAM uses arbitrary precision representation for most numeric values(Bignum).

From _The Beam Book_:

> There are two types of integers in ERTS, small integers and bignums. Small integers fits in one machine word minus four tag bits, i.e. in 28 or 60 bits for 32 and 64 bits system respectively. Bignums on the other hand can be as large as needed (only limited by the heap space) and are stored on the heap, as boxed objects.

Outside of that, I have found Elixir/Erlang to be very resource efficient. And if you need blazing fast math, you can always implement such computations in C and expose it in your Elixir/Erlang application using NIFs. There are a few golden rules to pay attention to in order to avoid danger, but if you do, you can get great speed. I'm currently implementing a Protocol Buffer library in Elixir and expect to make use of this for increased performance once my library is feature complete(if I find performance to be an issue at scale).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: