Re: Using Erlang libs in Elixir

Michael Truog <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <[email protected]>
If you wanted to convert an Elixir module to be an Erlang module that 
lives in an Erlang/OTP application without a runtime dependency on the 
Elixir runtime, you can do that with 
https://github.com/okeuday/reltool_util/blob/master/ex2erl .  That 
approach would allow you to use Elixir macros and other Elixir features 
without being focused on their implementation.  If you use ex2erl, it 
would be best to keep updating the output with future releases of 
Elixir, but I wouldn't expect breaking changes due to a recent Elixir 
release.

Best Regards,
Michael

On 9/1/21 4:03 PM, Serge Aleynikov wrote:
> Is there any guideline for making Erlang projects be more Elixir friendly?
>
> When developing an Erlang library, it would be nice to have its 
> functions callable from Elixir not like:
>
> :erl_lib.some_fun()
>
> but rather
>
> ErlLib.some_fun()
>
> without needing to write a "glue" module compiled into 
> 'Elixir.ErlLib.beam'  that would import all functions from erl_lib and 
> export them locally?
>
> Are there more requirements of some metadata (e.g. '__info__'/1) to be 
> included in the Erlang modules?
>
> Regards,
>
> Serge
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.