
Hi all, I've been studying Haskell for about a year now, and I've really come to like it. In my daily work I write a lot of BASH shell scripts and I thought I'd try add some of the haskell features and constructs to BASH to make my scripting life a bit easier. So I've been working on a small BASH function library that implements some basic functional programming building blocks. Note: There is no actual Haskell code involved here. I put up the full manpage here: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=24564 Source is here: http://svn.solucorp.qc.ca/repos/solucorp/bashkell/trunk/trunk/ All this is very prototypical, but here is an example of some of the stuff I've got so far (map, filter, foldr): $ ls data 1.txt 2.txt # basic map, argument goes on the command line $ ls -d data/* | map basename 1.txt 2.txt # map with lambda expression $ ls -d data/* | map '\f -> basename $f .txt' 1 2 # simple filter, also works with lambda $ ls -d data/* | map basename | filter 'test 1.txt =' 1.txt # sum $ ls -d data/* | map '\f -> basename $f .txt' | foldr '\x acc -> echo $(($x + $acc))' 0 3 Basically I'm looking for a bit of feedback/info: - Does anyone know if there are already similar projets out there? - Does anyone find this interesting? - Any other comment/suggestion/feedback - Where's a good place to promote such a project? Thanks a lot, Patrick LeBoutillier -- ===================== Patrick LeBoutillier Rosemère, Québec, Canada

On 1 April 2010 11:05, Patrick LeBoutillier
Basically I'm looking for a bit of feedback/info: - Does anyone know if there are already similar projets out there?
On Hackage: LambdaShell, language-sh, HSH, Hashell (dead), only, Shellac Note that not all of these might be directly similar: I found them by doing a quick search for shell and looking in the console section. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

Hi, Am Mittwoch, den 31.03.2010, 20:05 -0400 schrieb Patrick LeBoutillier:
Basically I'm looking for a bit of feedback/info: - Does anyone know if there are already similar projets out there?
just similar, not the same: https://www.joachim-breitner.de/blog/archives/156-Haskell-on-the-Command-Lin... Greetings, Joachim -- Joachim "nomeata" Breitner mail: mail@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C JID: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/ Debian Developer: nomeata@debian.org

How about: http://www.cse.unsw.edu.au/~dons/h4sh.html It brings a lot of familiar Haskell functions to the command-line. And *is* actually written in Haskell ;) - jeremy On Wed, Mar 31, 2010 at 6:05 PM, Patrick LeBoutillier < patrick.leboutillier@gmail.com> wrote:
Hi all,
I've been studying Haskell for about a year now, and I've really come to like it. In my daily work I write a lot of BASH shell scripts and I thought I'd try add some of the haskell features and constructs to BASH to make my scripting life a bit easier. So I've been working on a small BASH function library that implements some basic functional programming building blocks.
Note: There is no actual Haskell code involved here.
I put up the full manpage here: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=24564 Source is here: http://svn.solucorp.qc.ca/repos/solucorp/bashkell/trunk/trunk/
All this is very prototypical, but here is an example of some of the stuff I've got so far (map, filter, foldr):
$ ls data 1.txt 2.txt
# basic map, argument goes on the command line $ ls -d data/* | map basename 1.txt 2.txt
# map with lambda expression $ ls -d data/* | map '\f -> basename $f .txt' 1 2
# simple filter, also works with lambda $ ls -d data/* | map basename | filter 'test 1.txt =' 1.txt
# sum $ ls -d data/* | map '\f -> basename $f .txt' | foldr '\x acc -> echo $(($x + $acc))' 0 3
Basically I'm looking for a bit of feedback/info: - Does anyone know if there are already similar projets out there? - Does anyone find this interesting? - Any other comment/suggestion/feedback - Where's a good place to promote such a project?
Thanks a lot,
Patrick LeBoutillier
-- ===================== Patrick LeBoutillier Rosemère, Québec, Canada _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Unfortunately though, h4sh seems to be broken, for one, there's no fps package (apparently required), and hsplugins won't build with 6.12.1. Bob On 1 Apr 2010, at 15:41, Jeremy Shaw wrote:
How about:
http://www.cse.unsw.edu.au/~dons/h4sh.html
It brings a lot of familiar Haskell functions to the command-line. And *is* actually written in Haskell ;)
- jeremy
On Wed, Mar 31, 2010 at 6:05 PM, Patrick LeBoutillier
wrote: Hi all, I've been studying Haskell for about a year now, and I've really come to like it. In my daily work I write a lot of BASH shell scripts and I thought I'd try add some of the haskell features and constructs to BASH to make my scripting life a bit easier. So I've been working on a small BASH function library that implements some basic functional programming building blocks.
Note: There is no actual Haskell code involved here.
I put up the full manpage here: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=24564 Source is here: http://svn.solucorp.qc.ca/repos/solucorp/bashkell/trunk/trunk/
All this is very prototypical, but here is an example of some of the stuff I've got so far (map, filter, foldr):
$ ls data 1.txt 2.txt
# basic map, argument goes on the command line $ ls -d data/* | map basename 1.txt 2.txt
# map with lambda expression $ ls -d data/* | map '\f -> basename $f .txt' 1 2
# simple filter, also works with lambda $ ls -d data/* | map basename | filter 'test 1.txt =' 1.txt
# sum $ ls -d data/* | map '\f -> basename $f .txt' | foldr '\x acc -> echo $(($x + $acc))' 0 3
Basically I'm looking for a bit of feedback/info: - Does anyone know if there are already similar projets out there? - Does anyone find this interesting? - Any other comment/suggestion/feedback - Where's a good place to promote such a project?
Thanks a lot,
Patrick LeBoutillier
-- ===================== Patrick LeBoutillier Rosemère, Québec, Canada _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

fps is what we now call bytestring. Alas, hsplugins is dead. hsplugins is
useful, but needs to be rewritten for modern GHC :(
- jeremy
On Thu, Apr 1, 2010 at 9:02 AM, Thomas Davie
Unfortunately though, h4sh seems to be broken, for one, there's no fps package (apparently required), and hsplugins won't build with 6.12.1.
Bob
On 1 Apr 2010, at 15:41, Jeremy Shaw wrote:
How about:
http://www.cse.unsw.edu.au/~dons/h4sh.html
It brings a lot of familiar Haskell functions to the command-line. And *is* actually written in Haskell ;)
- jeremy
On Wed, Mar 31, 2010 at 6:05 PM, Patrick LeBoutillier < patrick.leboutillier@gmail.com> wrote:
Hi all,
I've been studying Haskell for about a year now, and I've really come to like it. In my daily work I write a lot of BASH shell scripts and I thought I'd try add some of the haskell features and constructs to BASH to make my scripting life a bit easier. So I've been working on a small BASH function library that implements some basic functional programming building blocks.
Note: There is no actual Haskell code involved here.
I put up the full manpage here: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=24564 Source is here: http://svn.solucorp.qc.ca/repos/solucorp/bashkell/trunk/trunk/
All this is very prototypical, but here is an example of some of the stuff I've got so far (map, filter, foldr):
$ ls data 1.txt 2.txt
# basic map, argument goes on the command line $ ls -d data/* | map basename 1.txt 2.txt
# map with lambda expression $ ls -d data/* | map '\f -> basename $f .txt' 1 2
# simple filter, also works with lambda $ ls -d data/* | map basename | filter 'test 1.txt =' 1.txt
# sum $ ls -d data/* | map '\f -> basename $f .txt' | foldr '\x acc -> echo $(($x + $acc))' 0 3
Basically I'm looking for a bit of feedback/info: - Does anyone know if there are already similar projets out there? - Does anyone find this interesting? - Any other comment/suggestion/feedback - Where's a good place to promote such a project?
Thanks a lot,
Patrick LeBoutillier
-- ===================== Patrick LeBoutillier Rosemère, Québec, Canada _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Thu, Apr 1, 2010 at 11:13 AM, Jeremy Shaw
fps is what we now call bytestring. Alas, hsplugins is dead. hsplugins is useful, but needs to be rewritten for modern GHC :( - jeremy
I never looked into hsplugins too carefully. Did it offer anything that Hint doesn't now offer? -- gwern

On Thu, Apr 1, 2010 at 10:59 AM, Gwern Branwen
On Thu, Apr 1, 2010 at 11:13 AM, Jeremy Shaw
wrote: fps is what we now call bytestring. Alas, hsplugins is dead. hsplugins is useful, but needs to be rewritten for modern GHC :( - jeremy
I never looked into hsplugins too carefully. Did it offer anything that Hint doesn't now offer?
The ability to load and unload compiled code in a running application? Perhaps hint offers that now ? Specifically, I believe you could have a function 'foo', and you could load a new version of 'foo' while the programming was running, and the running code would start using the new version instead.. I can't quite remember the details though. 'runtime linking' might be a term to describe it.. - jeremy

Patrick LeBoutillier wrote:
... Basically I'm looking for a bit of feedback/info: - Does anyone know if there are already similar projets out there?
You've already got some references, you can also look at http://hackage.haskell.org/package/scc which includes a shell language.
- Does anyone find this interesting?
I do.
- Any other comment/suggestion/feedback
It would be interesting to compare the speed of your Bash functions with the h4sh executables written in Haskell. Your solution has the source platform independence on its side, of course. A question of my own: is there any written design (an academic paper would be perfect) of a functional shell language?

A question of my own: is there any written design (an academic paper would be perfect) of a functional shell language?
A few: http://www.citeulike.org/user/spl/tag/shell More resources: http://www.cse.unsw.edu.au/~pls/thesis-topics/functionalshell.html Regards, Sean

On 6 April 2010 15:09, Mario Blažević
A question of my own: is there any written design (an academic paper would be perfect) of a functional shell language?
Olin Shivers has written a detailed paper on Scsh. ftp://www-swiss.ai.mit.edu/pub/su/scsh/scsh-paper.ps The link might be down permanently (it is for me at the moment), maybe the paper is on Citeseer or similar. There is also the Scsh manual. Best wishes Stephen

On Tue, Apr 6, 2010 at 11:17 AM, Stephen Tetley
On 6 April 2010 15:09, Mario Blažević
wrote: A question of my own: is there any written design (an academic paper would be perfect) of a functional shell language?
Olin Shivers has written a detailed paper on Scsh.
ftp://www-swiss.ai.mit.edu/pub/su/scsh/scsh-paper.ps
The link might be down permanently (it is for me at the moment), maybe the paper is on Citeseer or similar. There is also the Scsh manual.
Best wishes
Stephen
The Scsh manual is worth reading just for the introductory material. Part of the problem is that both Clean and Scheme have relatively easy and powerful 'eval' ability. (Esther exploits the interesting feature of Clean that lets you serialize functions to disk.) Haskell doesn't, so much. The GHC API isn't too great to work with here; it's hard enough to evaluate straight Haskell fragments, and to serve as a shell, you really need new syntax; for example, you want literals for program names. (Who would use a shell which forces you to write 'run "ghci" ["foo.lhs"]', instead of 'ghci foo.lhs'?) But many filenames break in Haskell; 'ssh-agent', 'g++-4.4', 'bf_tar', etc. -- gwern

On 6 April 2010 16:56, Gwern Branwen
The Scsh manual is worth reading just for the introductory material.
Hi Gwern The Scsh manual is worth reading for the Acknowledgements section - which is somewhat famous. Looking over them both it seems most of the material in the paper is covered in the manual. Esther is shipped as a project with Clean2.2 although I think it only works on Windows - the last time I looked at the code I got the impression that it had diverged a bit from the the Famke / Esther papers. Best wishes Stephen
participants (9)
-
Gwern Branwen
-
Ivan Miljenovic
-
Jeremy Shaw
-
Joachim Breitner
-
Mario Blažević
-
Patrick LeBoutillier
-
Sean Leather
-
Stephen Tetley
-
Thomas Davie