š§Ŗ Elixir v1.9
Wooow, Elixir-lang implemented ābuild releaseā in their latest version!!
The official blog post: Elixir v1-9-0 released.
TL;DR; from the article:
Releases allow developers to precompile and package all of their code and the runtime into a single unit.
A release is a self-contained directory that consists of your application code, all of its dependencies, plus the whole Erlang Virtual Machine (VM) and runtime.
Code preloading, configuration and customisation, Self-contained, multiple releases, management scriptsā¦
I made a small test with a basic āHello worldā app in Elixir 1.9. After that, I executed:
$ MIX_ENV=prod mix release
In the folder ā_build/prod/rel/ā, the production app is only 8MB !! š±
I uninstalled Elixir and Erlang after compiling the app and I executed:
$ _build/prod/rel/kv/bin/kv version
and some commands to run the āhelloā function and it worked perfectly. Thatās why Iām so excited about it!
Because one of the most important reasons I stopped using Elixir a few years ago, was that I couldnāt find any way to export my apps in a portable way, like they just implemented now. And the smallest Docker container with Elixir was a few hundred MB. Well, the second reason was the ecosystem was too small, so I had to write a lot of code just to make simple automation stuff, so I switched to Python.
Many things have happened since thenā¦ But I donāt regret my decision, now that Iām using Go-lang for Spinal š.
Even if Go syntax is horrible and Elixir syntax is for sure, the most beautiful thing you could possible write, as a programmer. In my opinion.