For the sake of trying out some ideas, I experimented with doing this:
$ cat > t.erl
-module(t).
-export([t/1, '__info__'/1]).
'__info__'(module) -> 'Elixir.Temp';
'__info__'(functions) -> [];
'__info__'(macros) -> [];
'__info__'(Key = attributes) -> get_module_info(?MODULE, Key);
'__info__'(Key = compile) -> get_module_info(?MODULE, Key);
'__info__'(Key = md5) -> get_module_info(?MODULE, Key);
'__info__'(deprecated) -> [].
t(A) -> A + 1.
$ erlc +debug_info t.erl
$ iex
iex(1)> Temp.t(1)
** (UndefinedFunctionError) function Temp.t/1 is undefined (module Temp is not available)
Temp.t(1)
This error makes sense - Erlang expects the module name to be 't', and Elixir expects it
to be 'Elixir.Temp', and the meta information doesn't help much.
If we rename the file to Elixir.Temp.erl and the module name to 'Elixir.Temp',
then all works well.
Wouldn't it be nice if the Erlang modules allowed aliases so that we could have a single
module compiled by Erlang to be used in both languages using their native naming convention?