On this page:
1.1 Installation
1.2 Command line
1.3 Shell

1 Getting started

This chapter shows you how to get Rain and introduces some basic features. For more in-depth resources read on to the next chapters.

1.1 Installation

Rain requires a Unix environment. It currently is only tested on the Windows Subsystem for Linux, but should work for any *nix. If you want to use it with WSL, make sure you have the creators update as it substantially improved WSL.

Open bash and get the latest release from github:

wget https://github.com/patrick-lafferty/rain/releases/download/0.3.0/rain.tar.xz

Then extract Rain some place you want. To put Rain in your home dir:

tar xf rain.tar.xz

Now you can run Rain:

~/rain/bin/rain

1.2 Command line

After starting Rain you are in the command line. By default anything you enter will be interpreted as Racket code. As soon as Rain can parse something (ie once the brackets are balanced) it will interpret the code. Try it out:

(displayln "hello, world")

Rain supports multi-line editing. For example to write a multi-line function, simply omit the closing bracket and press enter. You can keep entering new lines and once Rain detects the last closing bracket, it joins all the lines you entered and interprets it.

(define (greet name)
    (printf "hello, ~a" name))

Rain won’t create the greet function until the last ). If you want to cancel input simply press Ctrl+D.

1.3 Shell

You can run commands similar to a Unix shell like Bash. To do so, wrap your commands inside curly braces like so:

{ls}

Rain supports redirects:

{ls > output.txt}

as well as piping:

{ls | grep rkt | sort | uniq -c}

For more information on the shell see Shell.