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

Mikael Pettersson mikpelinux@REDACTED
Fri Sep 14 12:07:07 CEST 2018


Yes, escripts can include ZIP archives of beam and other files.  I
experimented a bit with that a while ago, resulting in "eld" (an
Erlang linker) https://github.com/mikpe/eld (emphasis on experiment.

Some of the build tools out there already support this feature, you
should probably stick with those.

On Fri, Sep 14, 2018 at 9:13 AM, Roger Lipscombe <roger@REDACTED> wrote:
> "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
>>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list