[erlang-questions] Running multiple beam files from an escript

Roger Lipscombe roger@REDACTED
Fri Sep 14 09:13:52 CEST 2018


"rebar3 escriptize" --
http://www.rebar3.org/docs/commands#section-escriptize -- lets you combine
multiple .erl files into a single escript. You can do the same with Elixir;
see
https://www.thegreatcodeadventure.com/executable-elixir-working-with-escripts/

Both of these take advantage of the fact that Erlang knows how to load BEAM
files from a .ZIP file, and that .ZIP files can have "garbage" on the
front. Said "garbage" being an entry point escript that invokes the main
module from the ZIP.

I experimented with it here: https://github.com/rlipscombe/escriptize --
but it's not maintained, so don't bother using it unless you need to
support dependencies with NIFs/ports in them.

On 13 September 2018 at 22:47, Awsaf Rahman <awsafrahman1704@REDACTED>
wrote:

> Hi all,
>
> I wrote a few microbenchmarks in Erlang to measure execution time. I have
> never used escripts but want to know how they work. Is it possible to run
> multiple beam files from an escript? For example, some condition decides
> which Beam file would be invoked?
>
> Regards
> Awsaf
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180914/1fc261a1/attachment.htm>


More information about the erlang-questions mailing list