4) Functional paradigm- encourages decoupling of code by forcing state to be passed around explicitly as arguments, this also aids unit testing, it also reduces bugs further
5) Instant "forking" without having to worry about thread safety, and good semantics around it
6) Potential 99.999999999% uptime reliability (thanks to Erlang's OTP)
7) Hot-swappable code upgrades with no downtime
8) Pattern-matching reduces the amount of "switch logic" code greatly. In Ruby code I often saw complex logic branches with no test coverage- it's easier to cover those in Elixir when every "branch" is a different pattern-matched function
> A bunch of neato things such as build-your-own-sigils, which felt even more "Ruby-like" than Ruby's own capability
I like custom sigils, those are pretty cool, e.g.
def sigil_i(string, []), do: String.to_integer(string)
But, having to put that char into the method name rather than argument, doesn't that limit the characters that you can use? Seems like would be better as arg.
I believe for the sort of thing typically done in these sort of languages (which usually boil down to doing lots of string processing) Elixir may well be 10x faster.
The reason?
Lack of dynamism.
Function calls in python/ruby? SLOOOOOW
Function calls in Elixir? Hella fast, because it's all resolved at compile time, there's no dynamic lookup, no creating a locals dictionary for each call, etc.
(PS: Most typical web frameworks make a LOT of function calls - all that data sanitizing, templating, and formatting has to happen somewhere)
It's true that Elixir is slower if doing numerics heavy code since it can't just call out to a highly tweaked numeric library like NumPy.
(This is all talking single threaded, of course. With a parrallizeable task you won't even be in the same zip code.)
Erlang and Elixir are both dynamically typed and do dynamic dispatch.
Erlang does not know the types flowing through a call site in advance and therefore has to do dynamic dispatch.
In particular, Erlang has a "code server" that all calls throughout the system must thunk through, versus a statically typed language where a call is optimized to a single JMP instruction. Smarter JITs, like Java's HotSpot, can also do this, and HotSpot is smart enough to inline both virtual and dynamic dispatch at runtime. BEAM can't.
Erlang's closest thing to a JIT (HiPE) cannot inline calls across modules, has no support for deoptimization, and is in effect a naive, crappy, AOT compiler which does the bare minimum to work in an otherwise dynamic environment.
Source: I made this... it was basically Elixir before Elixir:
These days I like languages that can actually avoid this overhead through the use of static typing, like Rust.
Note that it isn't necessarily bad that Erlang works this way. When it comes to Erlang's core strength: coordinating the concurrent activities of a massive number of processes/clients, it really does shine. Just don't use it for anything CPU-intensive.
6) Potential 99.999999999% uptime reliability (thanks to Erlang's OTP)
I don't have much understanding of programming language internals but why we don't thing see low level stuff like distributed file system written in Erlang.
I genuinely interested in knowing why this is not tried by someone?
1) Immutable data throughout- prevents certain classes of bugs
2) 10x faster- obvious benefit
3) Actual macros- the ultimate metaprogramming: http://elixir-lang.org/getting-started/meta/macros.html
4) Functional paradigm- encourages decoupling of code by forcing state to be passed around explicitly as arguments, this also aids unit testing, it also reduces bugs further
5) Instant "forking" without having to worry about thread safety, and good semantics around it
6) Potential 99.999999999% uptime reliability (thanks to Erlang's OTP)
7) Hot-swappable code upgrades with no downtime
8) Pattern-matching reduces the amount of "switch logic" code greatly. In Ruby code I often saw complex logic branches with no test coverage- it's easier to cover those in Elixir when every "branch" is a different pattern-matched function
9) A bunch of neato things such as build-your-own-sigils, which felt even more "Ruby-like" than Ruby's own capability (or lack thereof) here: http://elixir-lang.org/getting-started/sigils.html
10) Trendy Actor model built-in from the get-go ;)