Does Lisp Flavored Erlang (LFE) work on Windows? I am using LFE 0.6/Erlang 5.8.2/Windows 7 32-bit. I copied the lfe shell script as a batch file (replacing $@ with %1 %2 %3 %4) and it gives me this:
D:\projects\checkout\lfe>lfe
{"init terminating in do_boot",{undef,[{lfe_boot,start,[]},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
The problem here is that Erlang can't find the LFE ebin directory. Two ways to solve this problem are:
Use an explicit
-pa <lfe ebin dir>argument when starting LFE, either in thelfe.batscript or when you call it. Simple but hard wired.Use the
ERL_LIBSenvironment variable. This is described in thecodemodule documentation, http://erlang.org/doc/man/code.html. If you create an extra Erlang library directory, sayc:\projects\erlang, drop Erlang apps which follow the Erlang application directory structure as LFE does, and pointERL_LIBSat it then the code server will automatically add ebin directories it finds there to its code path.This is also described in How do I install LFE on Ubuntu Karmic? but in a UNIX context.
The
ERL_LIBSfeature should definitely be better advertised.EDIT: Replying to @Shantanu Kumar's comment.
I don't have access to a Windows machine so I can't test it properly. The problem seems to be that using
lfe_boottries to start the port programttyslwhich doesn't seem to work on Windows, at least not when runningerl.exe. Some solutions to try:Use
werl.exeinstead. This may work, but I would do it anyway.Try starting Erlang in the normal way with
werl.exe -pa ebin(to get the right load path) and manually starting the LFE shell withlfe_shell:server().Try starting Erlang with
werl.exe -pa ebin -noshell -s lfe_shell start. This will runlfe_shellas the shell but the^Gwon't be available.Also while it is nice to use it you don't need to use the LFE shell to run LFE, you can use the normal Erlang shell and just call the LFE functions in the "normal" way. You might become a little schizophrenic with two io formats, but there are no problems. :-)
Hope this helps.