Arc Forumnew | comments | leaders | submitlogin
Lisp shell, anyone? Fewer parens would help there. (newcome.wordpress.com)
4 points by akkartik 4413 days ago | 4 comments


3 points by waterhouse 4408 days ago | link

You might try looking at scsh, which is famous for its "Acknowledgments" section. It provides a convenient interface to Unix within Scheme 48.

  http://www.scsh.net/
  http://www.scsh.net/docu/html/man.html
Usage looks like this:

  $ 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."

[1] A Universal Scripting Framework, or: Lambda: the ultimate "little language". http://www.ccs.neu.edu/home/shivers/citations.html#ll

-----

1 point by akkartik 4408 days ago | link

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.

-----

2 points by kinleyd 4411 days ago | link

In the HN comments on the post, there was an interesting link to an old Steve Yegge post titled The Emacs Problem (https://sites.google.com/site/steveyegge2/the-emacs-problem)

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.

-----

2 points by kinleyd 4412 days ago | link

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...

-----