erl_wrap advice

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

erl_wrap advice

Petrica Clement Chiriac (Tica2)
Hi list,

I working to have one erlang wrapper similar how freewrap[1] is working for TCL.
Ideea is simple to bundle all in one exec file (Erlang VM, beam files, boot script)

Example usage can be:
erl_wrap.exe -out my_app.exe -wrap my_erlang_app

That works simple:
1) copy erl_wrap.exe to my_app.exe
2) append all Erlang app (beam files, boot script, ...) to my_app.exe file as resources.
3) And job done. Simple click to my_app.exe (On windows) or in console

It is still at an early stage, but I have results and I want to continue.
I know the work is dirty now but in final I want to be crazy simple.

Now I looking for advice how to integrate this erl_wrap library in one current ERLANG dev environment.
To do this hack I changed erlang/otp repo but I want to be able to build
erl_wrap.exe only based ERLANG dev environment based on compiled lib files and .h files.
What is need is a way to link erts (Erlang Runtime) and to alter preload beam files add wrap NIF files and output to erl_wrap.exe (all staticaly linked)
In this way erl_wrap can be independently and can integrated by anyone want to use.
Now I ask for advice to have this erls.lib (beam only) and separate lib for preload beam files. It this viable method? Do erlang team accept this work patch?

Second advice is what I can miss in this design, problems are many (ports from priv diretory, hot updates) but for my usecase to have one file is big win.

Now if this erl_wrap is call erl (erl.exe) and is someware in path all Elixir stuf is working (mix, iex, elixir), released not, but looks good.

Also EMU,ROOTDIR,BINDIR,PROGNAME do not have any utility now,
and are very used inside code.
On Unix we have erl script that set env vars and launch erlexec that parse
all arguments and exec beam VM (Erlang VM), final process is beam.smp
On Windows we have erl.exe that read erl.ini and use erlexec.dll to parse arguments and start Erlang VM from beam.smp.dll, final process is erl.exe
In our wrap example final process is my_app.exe (my_app on unix)
and because all arguments are bundle startup is simple but env vars
EMU,ROOTDIR,BINDIR,PROGNAME do not have a meaning

If I have good results I will share as open source library.


Thanks!
--
Petrica Clement Chiriac


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions