Arc Forumnew | comments | leaders | submitlogin
3 points by waterhouse 4382 days ago | link | parent

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

-----