Hiss - The Hintz CHICKEN Scheme Shell

Hiss is a system shell written in Scheme that is also a Scheme REPL. It is very minimal to start but is very easily extensible. It allows for piping in system shell commands and converting them to scheme data structures for use in scheme.

Getting

You can get the latest version on GitHub

Installing

Hiss is built on CHICKEN Scheme. Currently only Linux and Linux like systems are supported (basically anything that can run CHICKEN and use the posix egg).

To set it up install CHICKEN. Then use chicken-install to install shell and readline.

sudo chicken-install shell readline

See the readline egg wiki page for details on setting up GNU readline.

Building

Run it through csc:

csc shell.scm

Or use chicken-install:

sudo chicken-install hiss.setup

Using

To run it just run the executable:

./hiss

You can execute commands like you would in a normal bash prompt except by using the _raw macro. So to run ls, type (_raw ls) and hit enter (you can easily pass args too: (_raw ps -A)).

(_raw ls)
=> foo bar baz

Hiss also comes with a few helper functions for converting between shell output and scheme data structures.

(%run-cmd cmd) [function] Runs cmd through a pipe and returns the result of passing it through read-file which usually gathers up the results into a scheme list.

(%run-cmd "ls")
=> (foo bar baz)

(cmd->list cmd read-func) [function] Runs cmd and gathers the output into a list based on repeatedly calling read-func until the EOF.

(cmd->list "ls" read-line)
=> (foo bar baz)

(_ . r) [function] Runs the result of combining its arguments and returns a list of the results split by newline: \n. It is a short form of the above example.

(_ "ls" "-a")
=> (foo bar baz .hidden)

(run cmd) [function] Runs cmd in a separate system shell process and waits for the process to finish.

Configuring

Hiss will load ~/.hiss by default on startup. You can put your configuration expressions in this file. You can run arbitrary scheme code and even import extensions and eggs.

Checkout an example.

I usually redefine _raw as !.

Bugs? Questions?

Please contact me.

License

Hiss is released under the 2-clause BSD/FreeBSD license.