top | item 34301733

(no title)

kirushik | 3 years ago

Well, `mix release` (https://hexdocs.pm/mix/Mix.Tasks.Release.html) exists to address this very issue.

It still has limitations (the biggest one is the requirement for the os&architecture to match between the builder and the deployment target) — but the result is a standalone binary which not only embeds the VM and preloads the app's bytecode, but even "trims" the stdlib to only ship the required functions.

discuss

order

kitplummer|3 years ago

Right, so the moral of the story centers on the target user of the CLI tool. If you're building something for the Elixir community - game on I suppose, though there is still the complexity of build-env per OS/arch.

I wonder where WASM/container enters the discussion.

bongobingo1|3 years ago

> Firefly compiles Elixir applications faster and more efficiently than the BEAM can, and introduces WASI targeting to run applications in resource-constrained environments.

https://dockyard.com/blog/2022/09/01/dockyard-r-d-firefly-op...

Containers are already solved, its trivial to build and boot a mix release - but whether that's appropriate for a CLI tool depends on the complexity of the tool I guess, but not too far from flatpaks etc no?

throwawaymaths|3 years ago

Burrito is supposed to close the gap even further, though I've never used it.