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.
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.)
Linux and Mac OS users: update your system PATH variable to include "/path/to/racket/bin". 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.
Mac OS with Homebrew: you can install Racket and automatically configure PATH with one command:
sh$ brew cask install racket
Windows users: when you see instructions that reference racket or raco, I’ll trust you to convert into the appropriate command for your system. Assuming defaults, it’s likely to be "C:\Program Files\Racket\racket" (include the surrounding quotes in the command). Once you start Racket on the command line, you can quit by typing (exit).
Linux, Mac OS, and Windows users: 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.0 correctly.
But if you see this:
default-load-handler: cannot open module file module path: (lib "br/test")
Then beautiful-racket was not installed correctly. You’ll need to fix the problem before proceeding, most likely by reinstalling beautiful-racket.
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 and then click the Show Details button at the bottom. In the field under Automatic #lang line, put #lang br.
After that, new windows in DrRacket will start with #lang br.
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