Calling Elixir from Erlang

I just wrote this:

https://joearms.github.io/published/2017-12-18-Calling-Elixir-From-Erlang.html

I’m not sure if I’m doing things correctly – the code seemed to work but I’m unsure if this is the best way to go about things.

All comments are most welcome

10 Likes

Here is more information about the app file: https://hexdocs.pm/mix/Mix.Tasks.Compile.App.html

As for adding the current version of Dave’s software, I believe you should switch your deps code to the following:

defp deps do 
 [
   {:exexif, "~> 0.0.5"},
 ]
end

Since the package has been posted to hex.pm this is the recommended strategy https://hex.pm/packages/exexif

1 Like

Mix can directly handle your erlang code as well. Add a src folder in the mix project and elixirc_paths: ["lib", "src"] in the mix.exs project config. Then mix should compile your erlang files in src as well as the elixir files in lib and all the dependencies.

1 Like

There’s no need to modify elixirc_paths. Mix automatically picks up erlang files from src and elixir files from lib.

7 Likes