Elixir from Erlang

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

Elixir from Erlang

Igor Clark
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?

Thanks!
Igor


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

Re: Elixir from Erlang

Justin Wood-2
Hi Igor,

Tristan has already done some work around this. You will want to checkout https://github.com/tsloughter/rebar_mix.

Justin


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, 1 March 2019 05:26, Igor Clark <[hidden email]> wrote:

> 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?
>
> Thanks!
> Igor
>
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Elixir from Erlang

Igor Clark
Oh cool, I didn’t know about that, thanks (& thanks Tristan)! I’ll try it out.

Cheers :-)

> On 1 Mar 2019, at 12:39, Justin Wood <[hidden email]> wrote:
>
> Hi Igor,
>
> Tristan has already done some work around this. You will want to checkout https://github.com/tsloughter/rebar_mix.
>
> Justin
>
>
> Sent with ProtonMail Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>> On Friday, 1 March 2019 05:26, Igor Clark <[hidden email]> wrote:
>>
>> 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?
>>
>> Thanks!
>> Igor
>>
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Elixir from Erlang

Roger Lipscombe-2
In reply to this post by Igor Clark
On Fri, 1 Mar 2019 at 10:26, Igor Clark <[hidden email]> wrote:
> 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?

Or you could use mix for compiling your Erlang project, at which point
you get access to both sets of deps. Note, however, that there's an
outstanding problem with running eunit tests from mix that we never
managed to nail down properly.

Or or you could compile your project with erlang.mk, which also
supports hex.pm dependencies and can compile Elixir with a plugin.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Elixir from Erlang

Oliver Korpilla
Hi.

In our project we use mix as the central build tool, pulling in both Erlang and elixir dependencies.

Experience is generally good with just a rather minor gripes:
* It looks like some step has to always be redone for our rebar3 dependencies. syn and ibrowse are always listed as being rebuilt but always finish quickly.
* It was tricky to use dependencies from local share and building without connecting to the internet. (Not allowed in our build process for reproducibility reasons.)

So, our configuration based on mix/hex/distillery has been great for delivering a packaged release but I won't deny it has a few quirks of its own. Since we use asn1ct, syn, and ibrowse we have plenty of pure Erlang code in the mix (pardon the pun) and I could imagine using the same for a pure Erlang project, too.

Oliver

Gesendet: Freitag, 01. März 2019 um 15:18 Uhr
Von: "Roger Lipscombe" <[hidden email]>
An: "Igor Clark" <[hidden email]>
Cc: erlang-questions <[hidden email]>
Betreff: Re: [erlang-questions] Elixir from Erlang
On Fri, 1 Mar 2019 at 10:26, Igor Clark <[hidden email]> wrote:
> 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?

Or you could use mix for compiling your Erlang project, at which point
you get access to both sets of deps. Note, however, that there's an
outstanding problem with running eunit tests from mix that we never
managed to nail down properly.

Or or you could compile your project with erlang.mk, which also
supports hex.pm dependencies and can compile Elixir with a plugin.
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Elixir from Erlang

Igor Clark
In reply to this post by Roger Lipscombe-2
Thanks Roger. I have quite a lot of rebar3 projects and have got used to using it - I'd like to try to continue using that to build if possible. Will try mix or erlang.mk if I can't get anywhere with that.

> On 1 Mar 2019, at 14:18, Roger Lipscombe <[hidden email]> wrote:
>
> On Fri, 1 Mar 2019 at 10:26, Igor Clark <[hidden email]> wrote:
>> 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?
>
> Or you could use mix for compiling your Erlang project, at which point
> you get access to both sets of deps. Note, however, that there's an
> outstanding problem with running eunit tests from mix that we never
> managed to nail down properly.
>
> Or or you could compile your project with erlang.mk, which also
> supports hex.pm dependencies and can compile Elixir with a plugin.

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