Fl4m3Ph03n1x
How to write an Elixir terminal app with `mix release` instead of escript?
Background
I have an elixir app that is a terminal application. After discussions in this forum, it was strongly recommended to me to that I do not use escript and use mix release instead:
So, naturally, now I want to build an elixir app, it can be as simple as an hello world app, that uses mix releases, in terminal.
Problem
The issue here is that all the information I found thus far, all the tutorials (even the ones in this forum) use escript, the exact tool I want to avoid. Therefore I dont know how to build a simple terminal app that when invoked with a parameter returns hello world.
Questions
- Does anyone know how to build an Elixir app with mix releases that upon execution with a command returns hello world?
- Is it even possible to have this without escript?
Most Liked
josevalim
To be clear, if you want to build a command line app, then by all means, use escript. But if you want a long running system that you are going to deploy in a server somewhere, then releases are a better fit.
Releases are not going to give you a convenient command line API though. The best you can do is to assemble a release and run commands like start, rpc, and eval.
LostKobrakai
Even that won‘t help much. Different versions of the same distro are often not compatible with each other.
LostKobrakai
Yes and no. Releases need to be build specifically for the architecture of the target system (OS, C ABI, …). This usually doesn’t play nice with how people want to build their terminal applications and is one of the reasons people often suggest to use something else than a beam language to build those.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









