Re: Calling Elixir From Erlang

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Calling Elixir From Erlang

Onorio Catenacci

Message: 2
Date: Fri, 1 Mar 2019 10:26:14 +0000
From: Igor Clark <[hidden email]>
To: [hidden email]
Subject: [erlang-questions] Elixir from Erlang
Message-ID: <[hidden email]>
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:

 
--

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Calling Elixir From Erlang

Igor Clark
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 <[hidden email]> wrote:


Message: 2
Date: Fri, 1 Mar 2019 10:26:14 +0000
From: Igor Clark <[hidden email]>
To: [hidden email]
Subject: [erlang-questions] Elixir from Erlang
Message-ID: <[hidden email]>
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:

 
--
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions