[erlang-questions] Calling Elixir From Erlang

Igor Clark igor.clark@REDACTED
Fri Mar 1 17:41:50 CET 2019


Thanks Onorio, yes I looked at that. I’m really looking for tooling that will do this at a project level, adding code paths in code seems a bit brittle for that.

Following up, I haven’t got anywhere far with the rebar3 mix plugin, it seems sub-dependencies of elixir deps are a problem, and various libraries have problems not finding “prod.exs”, which I guess is something to do with envs but haven’t really got time to dig into.

Had a look at erlang.mk which seems to handle it much more, but I don’t know that I want to switch everything to using makefiles like that, I like rebar3.

At some point if it becomes urgent I’ll look into just using mix for everything but for now as it was just curiousity I’m going to move on - if I could just add an elixir dep and start using it that’d be great but it definitely doesn’t seem that simple at the moment.

Cheers and thanks for the responses,
Igor

On 1 Mar 2019, at 15:45, Onorio Catenacci <Catenacci@REDACTED> wrote:

>> 
>> Message: 2
>> Date: Fri, 1 Mar 2019 10:26:14 +0000
>> From: Igor Clark <igor.clark@REDACTED>
>> To: erlang-questions@REDACTED
>> Subject: [erlang-questions] Elixir from Erlang
>> Message-ID: <A517E1CE-0B46-415F-841E-02CD06FF65AA@REDACTED>
>> Content-Type: text/plain;       charset=utf-8
>> 
>> Hi folks,
>> 
>> Seeing a lot of interesting stuff coming out of CodeBeam SF talking about Elixir and how it can leverage the Erlang platform and libraries. There are some really interesting Elixir projects there, and loads elsewhere.
>> 
>> I haven?t looked into it much but from what I can tell Elixir takes full advantage of BEAM - there?s no special runtime or VM stuff happening, and the compiler just creates standard beam files, right? - and Elixir can use Erlang deps without any particular effort, just pull in via ?mix? - but there?s been no obvious mechanism created to expose Elixir back to Erlang, so there's no *obvious* way to pull in Elixir deps in an Erlang project. Meaning any new Erlang code can immediately be used in Elixir projects, but the reverse isn?t true; Erlang projects can?t easily get access to any of the heaps of new Elixir libraries being written.
>> 
>> Is that right, or am I missing something? Is there a way to do this? Are there language-level reasons or extensions which mean this isn?t possible anyway? If not, what would be involved? Would it be possible for rebar3 to support this, so that erlang projects could just include elixir libraries as deps? Perhaps via a plugin that (for example) calls out to the Elixir compiler in the way the port compiler does for C code? How complex would that be?
>> 
> 
> You might find this helpful to read:
> 
> https://joearms.github.io/published/2017-12-18-Calling-Elixir-From-Erlang.html
>  
> -- 
> Onorio Catenacci
> http://onor.io
> https://twitter.com/OldDutchCap
> 
> 
> _______________________________________________
> 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/20190301/bd4909fd/attachment.htm>


More information about the erlang-questions mailing list