The is an follow on to the discussion about extensions, if any, for LFE file and script files. In that discussion I also took up which startup files we should have, their names and where they should lie. It is this discussion I have broken out into a separate thread.
One suggestion we are working with is that we have a ~/.lfe *directory* where could have LFE files/libraries/etc which LFE would automatically find by default. This is useful. Some of these files could be init files. It has also been discussed that we could have multiple init files, both local to one LFE app and "global" to all LFEs run by a user. I think that this a good idea. We also have the user_default.erl module in which you can define your own shell functions. There is also the ~/.erlang file which erlang reads when it starts.
I think there should be 2 levels of initialisation for LFE: one level is for the LFE system which is always run; and one for each LFE shell. To support this I suggest we mirror emacs and have a ~/.lfe file for the LFE system
with commands when LFE are started, and have a ~/.lfe.d directory
where we can keep libraries and other initialisation files. The ~/.lfe file is similar to the ~/.erlang file and the ~/.emacs file and would contain expressions which are evaluated at LFE startup. There should also be startup files for the LFE shell which are run for every shell called 'lferc' or maybe 'lfeshrc'. There could a "global" one in the ~/.lfe.d directory and a local one in your current directory/application. Both would be loaded but the local one would shadow the global one. Maybe there should be a settable search path for the lferc files. The lferc files would contain general LFE shell commands not just LFE expressions so they would be more similar to .basrc files than to .erlang files.
I have always had the ideal that you can multiple shells which do different things and need different initialisation.
Unfortunately parts of the erlang system don't support this, for example there is only one cwd, and there is not much to do about this. The user_default module has the same problem. Have local LFE shell initialisation files would at least allow you to have different per shell commands.
Maybe this is just over engineering and adds to many layers so it becomes difficult to keep track of what is going on?
This is just me thinking out aloud so I can judge my own ideas and get some feed-back. Please comment,
Robert
--
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.
On Sat, Feb 14, 2015 at 11:57 AM, Robert Virding <rvir...@gmail.com> wrote:The is an follow on to the discussion about extensions, if any, for LFE file and script files. In that discussion I also took up which startup files we should have, their names and where they should lie. It is this discussion I have broken out into a separate thread.
One suggestion we are working with is that we have a ~/.lfe *directory* where could have LFE files/libraries/etc which LFE would automatically find by default. This is useful. Some of these files could be init files. It has also been discussed that we could have multiple init files, both local to one LFE app and "global" to all LFEs run by a user. I think that this a good idea. We also have the user_default.erl module in which you can define your own shell functions. There is also the ~/.erlang file which erlang reads when it starts.
I think there should be 2 levels of initialisation for LFE: one level is for the LFE system which is always run; and one for each LFE shell. To support this I suggest we mirror emacs and have a ~/.lfe file for the LFE systemWhat about ~/.lfe/system (file)with commands when LFE are started, and have a ~/.lfe.d directoryCouldn't that just use the ~/.lfe directory?It might be worth cataloging what files/directories we'll want to be using ... for starters:* ~/.lfe* ~/.lfe/libs - global, user-level libraries for projects, shells, etc.; used by lfetool)* ~/.lfe/lfe.config - defaults for LFE configs, rebar overrides, rebar and relx configs, etc.* lfe.config - same as the previous, but per-project* ~/.lfe?rc - a run control config file for LFE shells (we could even do ~/.lfe/rc or ~/.lfe/shrc ...)
I don't think you missed anything. Your thoughts sound very similar to those that I've had and some other folks' too. I think there's general agreement on these matters and now it's a matter of trying ideas out.From what I gather, Robert's got a branch where he's working on some of this stuff.A couple of random notes:* I'm not sure how possible it would be to run a module as a script, or treat a script as a module -- these are handled quite differently right now, and may hinge on Erlang internals.* Your thoughts on the responsibilities of LFE vs. lfetool are *very* close to what Robert and I have been discussing (possibly identical)I did read your emails when they came in, but I didn't feel I had anything else to add -- you had stated things well. When Robert has something ready to test, we can try it out and provide feedback on our experiences, and he can then better help us adapt our workflows to what is possible with LFE.Thanks!d
On Mon, Feb 16, 2015 at 5:28 PM, Mário Guimarães <mario.luis.guimaraes@gmail.com> wrote:
Hi,
I was expecting some comments to my last two messages ... did I miss something?
-mg
--
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-erlang+unsub...@googlegroups.com.
To post to this group, send email to lisp-flavoured-erlang@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lisp-flavoured-erlang/5oegsRQqjeU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lisp-flavoured-e...@googlegroups.com.
fine :-)Regarding the module vs script dichotomy, it simply shouldn't exist.For example, a script could be a module without an explicit module definition, and whose module name is that of the script, and it would not export any function, but when passed to the "lfe" command line this will search for a function named main and execute it, and if the main function does not exist nothing happens and "lfe" ends doing nothing or warns "main not found"Now for a module to be executed in script mode the "lfe" command just needs to search for a main function and execute it, and this would not even need to be exported!In fact, the "lfe" command would execute by default the main function, but is another's function name is given then it will search for this one to run.So, module and script seems to me an unnecessary distinction, thus simplifying LFE.-mg
I don't think you missed anything. Your thoughts sound very similar to those that I've had and some other folks' too. I think there's general agreement on these matters and now it's a matter of trying ideas out.From what I gather, Robert's got a branch where he's working on some of this stuff.A couple of random notes:* I'm not sure how possible it would be to run a module as a script, or treat a script as a module -- these are handled quite differently right now, and may hinge on Erlang internals.* Your thoughts on the responsibilities of LFE vs. lfetool are *very* close to what Robert and I have been discussing (possibly identical)I did read your emails when they came in, but I didn't feel I had anything else to add -- you had stated things well. When Robert has something ready to test, we can try it out and provide feedback on our experiences, and he can then better help us adapt our workflows to what is possible with LFE.Thanks!d
On Mon, Feb 16, 2015 at 5:28 PM, Mário Guimarães <mario.luis.guimaraes@gmail.com> wrote:
Hi,
I was expecting some comments to my last two messages ... did I miss something?
-mg
--
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-erlang+unsub...@googlegroups.com.
To post to this group, send email to lisp-flavoured-erlang@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 a topic in the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lisp-flavoured-erlang/5oegsRQqjeU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lisp-flavoured-erlang+unsub...@googlegroups.com.
To post to this group, send email to lisp-flavoured-erlang@googlegroups.com.