Re:Scsh – Scheme as a Unix shell
by simcop2387 on Tuesday September 02, 2014 @06:22PM
(#8260527)
The grandaddy of all of those is probably the http://perldoc.perl.org/Shell.html module in Perl. The idea is really nice for a lot small scripts but can seem to hide some magic because you're treating commands as functions.
I can't imagine why you'd think that. SCSH predates Perl Shell (1993 v. 1994?), and things like CLASH are almost as old. GNU Emacs has been usable for a login shell for almost that long, as I recall.
Re:Scsh – Scheme as a Unix shell
by simcop2387 on Tuesday September 02, 2014 @09:15PM
(#8261078)
I meant the modules that were talked about in the parent comment. Not as a predecessor to scsh. The Perl module I referenced isn't to use Perl as a shell and neither are the modules mentioned by heavenlyhash. They instead allow one to use system commands as if they were previously declared functions. While scsh and clash both do this to allow you to use it as an interactive shell they do not extend the parent language (as far as I can see) to be used like a shell scripting replacement. Emacs is a slightly different case as im not sure where the line between elisp and emacs should be drawn. If yiliu look at the modules in the other comments you'll see they all have roughly the same interface as the Perl module from 1994, before many of the languages, python, go, java existed or were really used by then.
If "allow one to use system commands as if they were previously declared functions" is your criteria, then things like Symbolics Genera, PERQ POS and Xerox Star/Alto predate it by even more. This is not a new or original idea to Perl.
ShellJS [1] for Javascript
Re:Scsh – Scheme as a Unix shell
by saidajigumi on Tuesday September 02, 2014 @08:15PM
(#8260895)
Fantastic and new to me, thanks. I love amoffat's approach to creating a Python DSL for command-line app interaction.
[1] https://github.com/amoffat/sh/
[2] https://github.com/polydawn/pogo/blob/master/gosh-demo.go
[3] https://github.com/polydawn/josh/
(The golang implementation is probably my favorite of these, since pipelining the output is by far the most pleasant experience there, and channels actually provide parallelism in a similar way what one expects from unix pipes. I'll admit I haven't benchmarked, but I suspect pipelining a lot of information in the python one is going to encounter the GIL; and as for the java one, well, let's just say I'd like to have a word with the authors of the current java subprocess invocation APIs.)