You need to install Racket and the beautiful-racket package to complete the tutorials in this book. They’ll run on Mac OS, Linux, or Windows.
You need an internet connection to complete this setup. Once installed, you don’t need a connection to use Racket or its documentation.
If you already have Racket v.6.7 or later installed, you can just install the beautiful-racket package.
This easy but minimal setup will get you through the first set of tutorials: stacker, funstacker, stackerizer, and most of bf. You can also try any of the examples in the explainers. After that, you’ll have to complete the full setup shown below.
Download and install Racket, which includes DrRacket. (Though you can edit source files using any text editor, the tutorials will assume you’re using DrRacket.)
Launch DrRacket. Use the File → Install Package ... command to install beautiful-racket.
The terminal commands you’ll be using in this book are simple. But if you haven’t used your terminal window before, this is the moment to learn where it is. (On Mac OS, your terminal window is called Terminal; on Windows 7 it’s called the Windows Command Processor; on Windows 10, the Windows Command Prompt.)
Download and install Racket, which includes DrRacket. (Of course, you’re welcome to use your preferred text editor, but the tutorials will assume you’re using DrRacket.)
Update the PATH environment variable on your system to include the directory that holds the racket application. On Mac OS and Linux, this path will be something like "/path/to/racket/bin". On Windows, it’ll be something like "C:\Program Files\Racket". Then, from the terminal, you’ll be able to run racket and raco.
Mac OS users who haven’t altered your PATH before: don’t panic. Follow the instructions in setting the Mac OS PATH.
Windows users who haven’t altered your
From the command line, install beautiful-racket:
sh$ raco pkg install --auto beautiful-racket
To check that it worked, try this on the command line (the -l switch tells racket to start with a particular module):
sh$ racket -l br/test
You should see this:
You installed beautiful-racket v1.6 correctly.
But if you see this:
1 2 3 4
open-input-file: cannot open module file module path: (lib "br/test") path: ··· system error: no such file or directory; rktio_err=3
Then beautiful-racket was not installed correctly. You’ll need to fix the problem before proceeding, most likely by reinstalling beautiful-racket.
If Racket is still running, type ctrl+D or (exit) to quit.
Except where otherwise noted, all code samples in the book rely on #lang br. But after installation, DrRacket will use #lang racket as the default language in new documents.
To change this setting, select Language → Choose Language in DrRacket. Make sure The Racket Language is selected, and then click the Show Details button at the bottom. In the section called Automatic #lang line, in the field labeled Always use the same #lang line, put #lang br as the value.
After that, new windows in DrRacket will start with #lang br already at the top.
In the future, I will release improvements to the beautiful-racket software. When that happens, you can update your copy of beautiful-racket from the command line:
sh$ raco pkg update --update-deps beautiful-racket