synrc / mad

⚡ MAD: Managing Application Dependencies LING/UNIX
https://mad.n2o.dev
Other
173 stars 53 forks source link

Feature request bundle beam emulator #22

Closed khia closed 9 years ago

khia commented 9 years ago

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 in erl_start/erl_init from erl_init.c.

5HT commented 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.

khia commented 9 years ago

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.

5HT commented 9 years ago

You can use self-extracting archive.