1
votes

Has anyone used Erlang and Elixir in the same app? Would it be better to keep two separate repos - one for Erlang app and one for Phoenix/Elixir app?

Or can one combine Erlang/Elixir in the same app structure - as two different apps?

Thanks

1

1 Answers

2
votes

I've used Erlang apps inside Elixir. For example, when I need a rich name register, I often use :gproc which is an Erlang app. In my mix.exs file I just add it to my applications:

defmodule MyApp.Mixfile do
  use Mix.Project

  (...)

  def application do
    [applications: [:logger, :gproc],
     mod: {MyApp, []}]
  end

  defp deps do
    [{:gproc, "~> 0.5.0"}]
  end
end

I personally would keep the apps in separate repositories mainly because they have a different project structure, but you can use them together by adding them to the dependencies of your project just like I did with :gproc in the example.

I hope this answer your question.