Closed khia closed 9 years ago
There is alredy relx support in mad, relx is able to bundle BEAM virtual machine, runtime and OTP. If you need more compact solution you should go with LING virtual machine, Erlang on Xen.
I don't think relx has support for that. It creates a directory structure for a relase but it doesn't produce single executable binary. The idea of the feature is to build static version of beam VM and have small application which can be used as:
cat loader > result.app
cat beam.vm >> result.app
cat mad.bundle >> result.app
chmod +x result.app
Or loader could include beam if it is easier. Anyway just an idea.
You can use self-extracting archive.
It would be a killer feature if you could bundle beam emulator into bundle. This would allow writing small cli tools for systems where erlang is not installed. Crate for ruby could be used to get general idea of the feature. In order to avoid modification of erts source you would probably want to overide entrypoint to build static beam emulator which you can link with loader. Magic to start
erl
from C is inerl_start
/erl_init
from erl_init.c.