This is a somewhat close possibility barring comments, as elixir produces erlang AST.
However, the AST it produces won't be perceived fully idiomatic style-wise (because of how some macros expand) so there might be not much value in this.
Also, without Elixir stdlib, such compilation would be useless as idiomatic Elixir normally includes use of Elixir stdlib.
For me, what makes it safe to adopt Elixir is the fact that worse comes to worse, I still have my .ex sources, they compile to valid beams, why should I care?..
I care about unlikely, but still possible case, when Elixir tools like compiler and libraries, stopped to be supported, while standard Erlang VM and tools continue to evolve.
Today you can compile Elixir source code using --debug-info as an option. Then you would be able to retrieve the abstract format from beam files and write your own code that converts abstract format to erlang source. It is definitely doable and I wouldn't be surprised if someone already did it.
There is no easy way around the chance that some project dies. While José and I pointed that it is quite easy to convert the AST produced by Elixir back to Erlang source (erl_pp?), it might not be the best workaround for the unlikely death of the project. Death doesn't meant the compiler stops compiling :)
However, the AST it produces won't be perceived fully idiomatic style-wise (because of how some macros expand) so there might be not much value in this.
Also, without Elixir stdlib, such compilation would be useless as idiomatic Elixir normally includes use of Elixir stdlib.
For me, what makes it safe to adopt Elixir is the fact that worse comes to worse, I still have my .ex sources, they compile to valid beams, why should I care?..