When comparing Elixir vs Zig, the Slant community recommends Elixir for most people. In the question“What are the best (productivity-enhancing, well-designed, and concise, rather than just popular or time-tested) programming languages?” Elixir is ranked 3rd while Zig is ranked 18th. The most important reason people chose Elixir is:
Leverages the existing Erlang BEAM VM
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Great for concurrency
Leverages the existing Erlang BEAM VM
Pro Great getting started tutorials
The tutorials are very clear and concise (even for a person not used to functional programming). Plus they are also very mobile friendly.
Pro Powerful metaprogramming
Write code that writes code with Elixir macros. Macros make metaprogramming possible and define the language itself.
Pro Full access to Erlang functions
You can call Erlang functions directly without any overhead: https://elixir-lang.org/getting-started/erlang-libraries.html
Pro Scalability
Elixir programming is ideal for applications that have many users or are actively growing their audience. Elixir can easily cope with much traffic without extra costs for additional servers.
More details can be found here.
Pro Great as a first functional programming language!
Pro Great documentation
Elixir's documentation is very good. It covers everything and always helps solving any problem you may have. It's also always available from the terminal.
Pro Syntax is similar to Ruby, making it familiar for people used to OOP
All of the benefits of Erlang; without as steep a learning curve of prolog based syntax. Elixir is heavily inspired by Ruby's syntax which many people love.
Pro Easy to download libraries
Comes with built in build tool called "mix". This will automatically download libraries and put them in the scope of the application when you add them to the "deps" function and run mix deps.get
Pro Some safety
It's safer than C, at least.
Pro C Interop
Zig programs can import C libraries and export header files to be used in C programs.
Pro Performance
Zig is pretty fast, in some cases even faster than C.
Pro Control flow is simple and obvious
No operator overloading, property methods, runtime dispatch, macros, etc.
Pro Cross-compilation is easy
The Zig compiler can build artifacts for any Tier 3 Supported platform without additional downloads.
Pro Small binary
Produces binary smaller than C.
Pro Compile-time execution
Zig can execute code at compile-time, allowing for more performant and readable programs.
Pro No Hidden Control flow
Zig will not do anything on your back that might slow down your program & make you loose your control over your program.
Cons
Con Deployment is still not as easy as it should be
Con Some design choices may seem strange
Some design choices could have been a little more appealing, for example: using "do...end" comes natural in Ruby for blocks but Elixir uses them for everything and it looks pretty weird:
Enum.map [1, 2, 3], fn(x) -> x * 2 end
or
receive do
{:hello, msg} -> msg
{:world, msg} -> "won't match"
end
Con Convoluted syntax
Claims to be an improvement over C, but in this area, not really.
Con No lambdas
Missing many key and useful features other languages have.
Con Deceptively gives impression it's near being production ready
No plans to hit 1.0 until 2025 (3 years later), according to Zig Roadmap speech. Impression is given that (0.9.1) language was close to ready, when it's not.
Con Creator admits to not knowing what he's doing
Creator admits his shortcomings during Zig Roadmap speech. Very disturbing. Not a language to invest in or take seriously, outside personal experimentation.
Con No closures
Does not have closures.
Con Almost no community
Lacking in libraries and users.
Con No interfaces/traits
Features that are useful are missing, where you can find them in other languages.
Con Fundraising looks suspicious
Why do we keep seeing an overhyped unfinished alpha level language showing up everywhere? That answer looks like a financial incentive to promote the language, the Zig Software Foundation, that is making hundreds of thousands of dollars a year from donations. To aggressively maintain cash flow, it appears any opinions that goes against their narrative is suppressed, attacked, or eliminated. All while the hype machine runs rampant. That isn't a language for the people, that looks to be a cash grab for the few that will result in nothing useful. Save yourself the headache and games, better to just use C or other languages with C-like syntax, can interface with C, and are actually useful. Better to not waste your valuable time on crap like Zig, false media hype, or getting scammed.
”If it sounds too good to be true, it probably is.”
This blog has published 2 excellent articles on how Zig's claims do not live up to reality after more than 6 years of development.
Con Poor compiler errors
Several years into development, language still a mess, and no hope of fixing itself for yet more years later.
Con No standard package manager
Several years into development, and still no standard package manager is ridiculous.
Con Exhibits cult-like behavior and animosity towards other programming languages
Strange culture that bashes other languages and are not open to criticism about the faults of their language. Very close-minded, sometimes scary.