pmjoe
How suitable is Elixir for a CLI application?
I need to develop a CLI application and I’m wondering how suitable Elixir is for this kind of application. The application must be distributed to clients and it should be as simple as possible to run, ideally a static build with a single binary. I know Elixir has some build systems and I’m wondering if some of these systems can produce a binary, in the end, packing everything inside like the Erlang VM, etc, etc…
Protecting the source code is also desirable.
Marked As Solved
josevalim
Here is my summary:
-
Are you making a CLI tool for Elixir developers only? If yes:
a. Do you want to extend Mix (like mix phx.new)? If so, usemix archive
b. Otherwise, usemix escript -
Otherwise, don’t use Elixir (for all the reasons mentioned above and for the same reasons I wouldn’t use ruby, python, java, etc)
Also Liked
ityonemo
You should not use elixir for this.
hauleth
Use Go, Zig, or Rust for that. Elixir is a poor choice there.
hauleth
Bakeware still doesn’t main problem with Elixir for CLI tooling - startup time. Most of the CLI tools is one-time quick tools that are launched often and that finish quickly. In such environment Erlang features aren’t that appealing and do not bring much to the table except familiarity.
derek-zhou
From a pure runtime startup time perspective:
perl < python2 < python3 < ruby < java < elixir < nodejs
So elixir is not the worst. Hell, many CLI programs are written in nodejs; I cringe every time I run webpack.
hauleth
Disagree. Python, Ruby, Perl, etc. are quite good solution for CLI tools. Sometimes even Java is ok solution.







