3 ms·
One of the great things about Elixir is that it encourages you to think of your application as the code that executed the purpose of your system and everything
by brightball 4y ago
One of the great things about Elixir is that it encourages you to think of your application as the code that executed the purpose of your system and everything else as an interface to it.
So a web interface, an API interface, a CLI interface, etc are all treated the same way since the code doing the work isn’t tightly integrated to any of them.
From that perspective, Elixir can be great for CLI.
- lycos 4y agoEither I don't understand what you are saying, or this is not unique to Elixir at all? Or both lol
- brightball 4y agoWith Elixir/Erlang the various BEAM nodes can connect and call each other so the code internally tends to reflect the same approach. The equivalent approach in most other languages would be to create a single web API and have everything talk to it via REST, etc. It’s closer to thinking of everything having an RPC interface by default I suppose.
- dmix 4y agoAnd not all CLI tools are isolated UNIXy bins you install. It could be an interface to a larger app running on the system like a database.
- thesneakin 4y agoIt's not. I keep factoring my CLI scripts to something that's very MVC. Everytime.
- SirGiggles 4y agobrightball is perhaps alluding that the BEAM VM environment itself is treated more as an operating system within an operating system rather than just another process in an operating system. The BEAM VM is unique (at least compared to mainstream languages) in that everything is run as a preempted, stackful coroutine. The result is an environment reminiscent of an operating system.