$ rlwrap scsh
Welcome to scsh 0.6.7 (R6RS)
Type ,? for help.
> (run (date))
Fri Mar 30 00:10:46 PDT 2012
0
> (run (| (ls) (grep -P ".tar.(gz|lrz)$")))
comments.tar.gz
comments.tar.lrz
pings.tar.lrz
pings0.tar.lrz
pings1.tar.lrz
pings2.tar.lrz
pings3.tar.lrz
0
The 0 is the return value of the program. [One thing that threw me was that -i is read as the complex number that Racket would call 0-1i; you would have to type "-i" with quotes around it, or (lolololololz) -ii if your program handles multiple instances of the same switch fine.]
The author, Olin Shivers, has a paper[1] that describes the process control notation demonstrated above, and an awk-like notation, both written essentially as Scheme macros. (Actually, I think they are Scheme macros.) "Whenever necessary, the user can break out of the special-purpose notation and express complex computations in a general-purpose programming language. The Scheme embedding makes simple things easy, and complex things possible. The standalone little language only provides the former."
Yeah I am aware of scsh; I was thinking of it when I referred to fewer parens :)
Here's wart's equivalent for the first command:
wart> date.
Or
wart> run date.
I want support for infix pipes and redirection operators. No matter how much lisp I use I can't get used to putting the pipe before different commands.
An alternative is to double down on lisp syntax but make the line editing much nicer. As nice as an emacs buffer.
In it Steve starts off by emphasizing the importance of learning regex to handle text processing in support of the assertion that Lisp isn't particularly good at it (text manipulation), while at the same time noting that Lispers look askance at regex itself.
He goes on to look at the issue from these two vantage points and states:
"How did I get so far off the original track of text processing? Well, that's the punch line of this shaggy-dog story: it's all text processing! Log files, configuration files, XML data, query strings, mini-languages, programming languages, transformers, web pages, word documents, everything... the vast majority of your programming work involves text processing somehow.
What would you rather do? Learn 16 different languages and frameworks in order to do "simple" log-file and configuration-file processing? Or just buckle down, learn Lisp, and have all of these problems go away forever?"
Wow. I already like Lisp, but that really had my attention.
Nice article. I agree that if a variant of Lisp is to step up to the plate along the lines mentioned in the article, Clojure can't be it. It's heavy with Java, and the setup isn't straight forward. This review of Land of Lisp by Conrad Barski suggests that older variants of Lisp like Common Lisp might do a better job, if not for systems scripting at least for providing a solid introduction to programming: http://books.slashdot.org/story/10/11/03/1238213/Land-of-Lis...