Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Mar 15th, 2007, 8:02 PM   #1
Mad_guy
Hobbyist Programmer
 
Mad_guy's Avatar
 
Join Date: Oct 2004
Location: Sandstorm, Techno Club
Posts: 239
Rep Power: 4 Mad_guy is on a distinguished road
Send a message via AIM to Mad_guy Send a message via MSN to Mad_guy
Haskell fun: hsh -- a busybox spinoff in haskell

So I was trying to figure out exactly what to do with Haskell, as I wanted to experiance the language. I read Don Stewarts excellent "Programming Haskell" 3 part series and it lead me to try and write clones of unix commands in Haskell. So far my program implements roughly 11 commands.

Examples:
[austin@continuum ~]$ hsh -v
haskell hsh v0.4, compiled with ghc-6.6, on linux-i386
[austin@continuum ~]$ hsh cat < dummy.txt
hi
i'm austin
[austin@continuum ~]$ hsh tac < dummy.txt
i'm austin
hi
[austin@continuum ~]$ hsh wc < dummy.txt
2
[austin@continuum ~]$ hsh uname
Linux continuum 2.6.20-ARCH #1 SMP PREEMPT Sat Mar 10 10:12:25 CET 2007 i686
[austin@continuum ~]$ hsh whereis gcc
gcc: /usr/bin/gcc
[austin@continuum ~]$ hsh ls /tmp
...
[austin@continuum ~]$ echo -e "dont mess with me\ndue" | hsh grep "do"
dont mess with me
[austin@continuum ~]$

It also implements other commands such as rmdir, cp, rm, mv, mvdir (had to seperate the two), etc. (grep is my favorite.)

For anybody just wanting the source code:
http://paste.lisp.org/display/37726#4

If anybody would like to try it out, especially on other compilers (which I would appreciate,) you can get a source tarball here:
http://austin.youareinferior.net/scr...0070315.tar.gz (linux/bsd only)

If you try it, tell me what haskell compiler and version you use; I have only tested this on GHC 6.6 (so any hugs98 or nhc98 users are appreciated.) Compilation instructions are included in the README file, all you need is a Compiler and Cabal (I decided to try it for this and absolutely loved it as a build system. I wish more were like it.)


If anybody wants to try it but doesn't have a Haskell compiler, I'm not giving out binaries right now. I need to clean up the option code *a lot* (I figured out Haskell's Getopt, so I'll use that for the option code in the v0.5 release.) Otherwise, you wouldn't probably really know how to work it without looking at the source (at least that's how I feel.) If anybody wants to upload a .tar.gz with it in the topic, that'd be fine as well.
__________________
os: mac os 10.5.4
revision control: git
editor: emacs

site
Mad_guy is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Haskell Arevos Other Programming Languages 25 Jun 3rd, 2007 4:34 PM
Haskell ideas? Mad_guy Other Programming Languages 3 Feb 5th, 2007 9:16 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:59 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC