"sh" [1] by amoffat did something similar to this in python. It's so marvelous I've also ported the same ideas to "gosh" [2] for use in golang and "josh" [3] for use in java. There's probably others as well -- I'd love to hear about more options in other languages. [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 impleme…
Scsh – Scheme as a Unix shell
11–20 of 20 posts
Re: Scsh – Scheme as a Unix shell
#12I'd love to see something a bit less trivial, like iterating over the output of another command to run some other commands for i in `bin/hosts`; do ssh $i uptime; done
(for-each (lambda (x)
(run (ssh ,x uptime)))
(run/strings (cat /etc/hosts)))Re: Scsh – Scheme as a Unix shell
#13* Geiser integration that (mostly!) works: https://github.com/rmloveland/geiser-scsh
* The manual in Texinfo format: https://github.com/rmloveland/scsh-manual-texinfo
Re: Scsh – Scheme as a Unix shell
#14That example looked like it would be hell to write from the tip of the tounge.
Re: Scsh – Scheme as a Unix shell
#15"sh" [1] by amoffat did something similar to this in python. It's so marvelous I've also ported the same ideas to "gosh" [2] for use in golang and "josh" [3] for use in java. There's probably others as well -- I'd love to hear about more options in other languages. [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 impleme…
Re: Scsh – Scheme as a Unix shell
#16"sh" [1] by amoffat did something similar to this in python. It's so marvelous I've also ported the same ideas to "gosh" [2] for use in golang and "josh" [3] for use in java. There's probably others as well -- I'd love to hear about more options in other languages. [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 impleme…
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.
Re: Scsh – Scheme as a Unix shell
#17Earlier quoted context omitted.
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
#18This is certainly an interesting use of Scheme macros for a shell-like DSL. For a long time I've mused over ideas for a Unix-ish shell that embeds first-class access to a richer scripting language than typical shell scripting. In this light, Scsh is similar to many other projects I've seen over the years in various languages, in that its effective aim is more about shell-like scripting in an alternate language. For m…
Re: Scsh – Scheme as a Unix shell
#19Earlier quoted context omitted.
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.
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 languag…
Re: Scsh – Scheme as a Unix shell
#20I love sexprs. In fact, I generally prefer prefix notation with the extra parens. However, for such a high frequency interactive use case, it really does meet the cost/benefit requirements to have specialized syntax...
Maybe it's just a matter of getting used to s-expr in that context, but after a few decades learning the classic command-line syntax, making that change could be hard.
OTOH the ability to use low level OS functions at the shell prompt or in a script might compensate for the trouble. Giving it a try would be the only way to find out. I might just do that and see what happens.