Running LFE on Windows

251 views
Skip to first unread message

Duncan McGreggor

unread,
Aug 19, 2015, 12:02:53 PM8/19/15
to Lisp Flavoured Erlang
Hey all,

I'm trying to get LFE running on Windows in as few steps as possible, and this task is turning out to be peculiarly difficult. Would love any insights you may have.

The only way I've been able to get an LFE prompt has been to do this:

Administrator@WIN-6GQCM1RMAPF ~
$ erl -pa "C:\\Program Files\lfe\ebin"
Eshell V7.0  (abort with ^G)
1> lfe_shell:server().
LFE Shell V7.0 (abort with ^G)
>

Using the standard lfe script that ships with LFE won't work because of the behaviour differences between Windows and POSIX exec. At least, that's what I *thought* the problem was after doing lots of reading.

Then I tried doing this:

Administrator@WIN-6GQCM1RMAPF ~
$ erl -pa "C:\\Program Files\lfe\ebin" -user lfe_init -extra
Eshell V7.0  (abort with ^G)
1>

Seeing that that didn't work, I can't really make assumptions about lfe's use of exec (yet).

With the above call, the lfe_init/0 function is found (otherwise the Erlang shell wouldn't start and there'd be an undef which would cause a crash dump to be created). Everything in the init args is as expected:

1> init:get_arguments().
[{root,["C:\\Program Files\\erl18"]},
 {progname,["erl"]},
 {home,["C:\\Users\\Administrator"]},
 {pa,["C:\\Program Files\\lfe\\ebin"]},
 {user,["lfe_init"]}]
2>

I tried looking up the -user flag, but didn't see it in the erl docs online. I guess if I knew how that behaved, I'd be an important step closer to understanding why Windows isn't starting the REPL ...

Any pointers would be greatly appreciated!

d

Robert Virding

unread,
Aug 19, 2015, 7:00:32 PM8/19/15
to Lisp Flavoured Erlang
I have cut and pasted my comment from the lfe issue:

About windows I can't help you but with -user I can. -user is used to specify which top-level user interface to start. If you don't give the flag then the default with the ^G and multishell version is used.


lfe does a -user lfe_init which means that lfe_int:start/0 will be called. lfe_init:start/0 first checks if we want to evaluate a string, given with -lfe_eval, or run a script. When running a script you don't want the default terminal interface but a simpler one which is started with user:start(). If neither then it calls the default top-level terminal interface, the one with ^G handling, but with the LFE shell instead of the normal erlang shell. The 'tty_sl -c -e' means start up a character based terminal input, again this is the same as the default.


The whole startup mechanism is a bit messy because there are no clear orthogonal but a mishmash of overlapping options with a lot of "extra" functionality.

My guess is that somehow the windows erl doesn't "see" the -user option so it goes into the default handling with the erlang shell. We clearly need a proper .bat file for this or we fix up lfeexec. I can do the lfeexec if necessary but .bat help is definitely needed. First step what do the startup files look like under windows? Maybe we can copy them. Unfortunately I don't have access to a windows I can play with but I will try and fix this.


Shall we have the discussion here, or there?

Robert

Eric Bailey

unread,
Aug 19, 2015, 7:41:07 PM8/19/15
to lisp-flavo...@googlegroups.com
I've got a Windows 10 box and access to a Win8 VM and can help test.

I vote for discussion on the issue since there may be Windows users who aren't subscribed to this list.


Eric
--
You received this message because you are subscribed to the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
Visit this group at http://groups.google.com/group/lisp-flavoured-erlang.
For more options, visit https://groups.google.com/d/optout.

Paul Goins

unread,
May 4, 2016, 4:15:06 PM5/4/16
to Lisp Flavoured Erlang
Not sure if this discussion went on in another place or what, but I've been toying with this a bit as of late and thought I'd chime in.  (Plus Duncan pointed me towards this group as well via Twitter.)

Based upon discussion in some of threads here and GitHub issues #138 and #143, I made a minor tweak to lfeexec.c to make it use werl.exe on Windows instead of erl.exe, and added a trivial lfe.bat file to the bin directory.  This lets me easily run LFE on Windows.

I forked the LFE repo here for the purpose of sharing the change: https://github.com/Vultaire/lfe
There's an Win64 "binary" release included: https://github.com/Vultaire/lfe/releases/tag/1.0.3-pdgoins.

My changes were trivial and made with no real tribal knowledge regarding LFE, so...  let me know if this is of interest.

- Paul Goins
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-erlang+unsub...@googlegroups.com.

Eric Bailey

unread,
May 4, 2016, 4:44:14 PM5/4/16
to lisp-flavo...@googlegroups.com
I don't think there's been further discussion and this is definitely interesting. We're not really Windows users so any help on that front is greatly appreciated. Maybe we can bake these changes into the next release (with docs support).

Any chance you could take a look at the commented out Windows config for tests in rebar.config in the develop branch?

If you join the Slack and @yurrriq, perhaps we could iterate on this faster.



Thanks for your efforts!

Eric




To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.

To post to this group, send email to lisp-flavo...@googlegroups.com.

Paul Goins

unread,
May 5, 2016, 1:21:07 AM5/5/16
to lisp-flavo...@googlegroups.com
Certainly; I'll take a peek.

Joined the Slack; will follow up with you on there when I've had time to take a look.

- Paul

To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
Visit this group at http://groups.google.com/group/lisp-flavoured-erlang.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
Visit this group at https://groups.google.com/group/lisp-flavoured-erlang.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages