Re: Lush as a shell
Raymond Martin <[email protected]> Sun, 12 Feb 2006 19:42:42 +0000
| Newsgroups | gmane.lisp.lush.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Yann, On Sunday 12 February 2006 17:21, Yann LeCun wrote: > You can easily write (in Lush) a new read-eval-print loop that doesn't > require parentheses and double quotes, so that you could type: > > cd /usr/local > > instead of: > > (cd "usr/local") > Right. So you would be in favor of Lush being started in a special shell mode for this? > People tend to dislike having to type extra character at the shell > prompt. So I don't think you can ask them to type #$ in front of every > command or (cmd "args") around every command at the prompt. > Yeah, I had thought about that, wasn't sure how far you would want to go away from Lush syntax. > On the other hand, people don't mind (too much) typing extra stuff > when they are programming, because it improves readability and > maintainability. > > So, writing stuff on the command line might require a new, more > compact syntax. But writing scripts can be done with the usual Lush > REPL syntax. What we need is more functions and macros to support > that. The function "sh" and all the functions defined in > libc/shell.lsh are helpful, but probably not sufficient. > This raises some questions for me: At what point do you decide that the commands should be in a Lush script as opposed to in shell command line syntax? It is possible in bash, for instance, to type everything that would go into a script directly onto the command line. Everything that is in a bash script is the same as the command line. Shouldn't Lush exhibit the same consistency? How much of the underlying Lush functionality should be useable from the command line? Should the syntaxes mix? Will Lush scripts be runnable within the command line mode? Can other shell scripts be handled (fed through to the appropriate shell internally)? This functionality would go a long way to making Lush a true universal shell. Insert your own questions here... A somewhat similar example of what might be implemented is contained in the Gamma programming language. Gamma presents a C-like scripting syntax for what is actually a front end on top of a real-time lisp variant (SCADALisp). The two syntaxes do not mix, but you can load scripts written in the Gamma syntax or SCADALisp syntax at any time in Gamma (see Cogent Realtime Systems http://www.cogent.ca for details). I'd suggest that approach, but with a reduced subset of Lush functionality from the command line syntax/shell, at least to begin with. To get more functionality from the shell mode load a regular Lush script, will run faster because Lush is already running at this point. A way to switch modes back and forth will be useful also. Raymond __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642