Elixir Flavoured Erlang: an Erlang to Elixir Transpiler
Erlang
70
74 commits
updated Aug 4, 2021
An Erlang to Elixir Transpiler
Check otp.ex for examples of the output generated by this tool.
Here are some blogposts with more details:
An LFE (Lisp Flavoured Erlang) to Elixir Transpiler
⚠️ Work in Progress ⚠️
./efe pp-lfe file.conf my-code.lfe
Try some examples:
make lfe-test
Check:
rebar3 escriptize
cp _build/default/bin/efe .
The general format is:
efe pp file.conf file.erl+
where file.conf is a config file with the following format:
#{
% blobs, if relative (start with .) are joined with current erlang file directory
includes => [".", "../../*/include", "../../*/src"],
% map of macro names and what they should expand to
macros => #{'VSN' => '1.0', 'COMPILER_VSN' => '2.0'},
encoding => latin1, % or utf8
output_dir => "./out",
% prefix to add to compiled modules, useful when transpiling otp to avoid
% conflicts
mod_prefix => "m_"
}.
Here is the config used to transpile cowboy
#{
includes => [".", "../include", "../../"],
macros => #{},
encoding => utf8,
output_dir => "./out"
}.
git clone git@github.com:erlang/otp.git
mkdir -p out
./efe pp otp.conf otp/lib/*/src/*.erl otp/erts/preloaded/src/.erl
Results in out/otp/
git clone https://github.com/ninenines/cowboy.git
# need header files from cowlib
git clone https://github.com/ninenines/cowlib.git
mkdir -p out
./efe pp cowboy.conf cowboy/src/*.erl
Results in out/cowboy
72 commits
2 commits
Erlang
98.1%
Makefile
1.4%
Elixir Flavoured Erlang: an Erlang to Elixir Transpiler
Erlang
70
74 commits
updated Aug 4, 2021
An Erlang to Elixir Transpiler
Check otp.ex for examples of the output generated by this tool.
Here are some blogposts with more details:
An LFE (Lisp Flavoured Erlang) to Elixir Transpiler
⚠️ Work in Progress ⚠️
./efe pp-lfe file.conf my-code.lfe
Try some examples:
make lfe-test
Check:
rebar3 escriptize
cp _build/default/bin/efe .
The general format is:
efe pp file.conf file.erl+
where file.conf is a config file with the following format:
#{
% blobs, if relative (start with .) are joined with current erlang file directory
includes => [".", "../../*/include", "../../*/src"],
% map of macro names and what they should expand to
macros => #{'VSN' => '1.0', 'COMPILER_VSN' => '2.0'},
encoding => latin1, % or utf8
output_dir => "./out",
% prefix to add to compiled modules, useful when transpiling otp to avoid
% conflicts
mod_prefix => "m_"
}.
Here is the config used to transpile cowboy
#{
includes => [".", "../include", "../../"],
macros => #{},
encoding => utf8,
output_dir => "./out"
}.
git clone git@github.com:erlang/otp.git
mkdir -p out
./efe pp otp.conf otp/lib/*/src/*.erl otp/erts/preloaded/src/.erl
Results in out/otp/
git clone https://github.com/ninenines/cowboy.git
# need header files from cowlib
git clone https://github.com/ninenines/cowlib.git
mkdir -p out
./efe pp cowboy.conf cowboy/src/*.erl
Results in out/cowboy
72 commits
2 commits
Erlang
98.1%
Makefile
1.4%