24.1 Command-Line Tools

► |  | The Racket Guide

1 | Welcome to Racket
2 | Racket Essentials
3 | Built-In Datatypes
4 | Expressions and Definitions
5 | Programmer-Defined Datatypes
6 | Modules
7 | Contracts
8 | Input and Output
9 | Regular Expressions
10 | Exceptions and Control
11 | Iterations and Comprehensions
12 | Pattern Matching
13 | Classes and Objects
14 | Units
15 | Reflection and Dynamic Evaluation
16 | Macros
17 | Creating Languages
18 | Concurrency and Synchronization
19 | Performance
20 | Parallelism
21 | Running and Creating Executables
22 | More Libraries
23 | Dialects of Racket and Scheme
24 | Command-Line Tools and Your Editor of Choice
| Bibliography
| Index

▼ | 24 | Command-Line Tools and Your Editor of Choice

24.1 | Command-Line Tools
24.2 | Emacs
24.3 | Vim
24.4 | Sublime Text
24.5 | Visual Studio Code

► | 24.1 | Command-Line Tools

24.1.1 | Compilation and Configuration: raco
24.1.2 | Interactive evaluation
24.1.3 | Shell completion

On this page:

24.1.1`` Compilation and Configuration: raco
24.1.2`` Interactive evaluation
24.1.3`` Shell completion

8.17
top contents ← prev up next →

#### 24.1`` Command-Line Tools🔗ℹ

Racket provides, as part of its standard distribution, a number of command-line tools that can make racketeering more pleasant.

##### 24.1.1`` Compilation and Configuration: raco🔗ℹ

The raco (short for “Racket command”) program provides a command-line interface to many additional tools for compiling Racket programs and maintaining a Racket installation.

- raco make compiles Racket source to bytecode.

  For example, if you have a program "take-over-world.rkt" and you’d like to compile it to bytecode, along with all of its dependencies, so that it loads more quickly, then run

  raco make take-over-the-world.rkt

  The bytecode file is written as "take-over-the-world_rkt.zo" in a "compiled" subdirectory; ".zo" is the file suffix for a bytecode file.

- raco setup manages a Racket installation, including manually installed packages.

  For example, if you create your own library collection called "take-over", and you’d like to build all bytecode and documentation for the collection, then run

  raco setup take-over

- raco pkg manages packages that can be installed through the Racket package manager.

  For example, to see the list of installed packages run:

  raco pkg show

  To install a new package named <package-name> run:

  raco pkg install <package-name>

  See Package Management in Racket for more details about package management.

For more information on raco, see raco: Racket Command-Line Tools.

##### 24.1.2`` Interactive evaluation🔗ℹ

The Racket REPL provides everything you expect from a modern interactive environment. For example, it provides an ,enter command to have a REPL that runs in the context of a given module, and an ,edit command to invoke your editor (as specified by the EDITOR environment variable) on the file you entered. A ,drracket command makes it easy to use your favorite editor to write code, and still have DrRacket at hand to try things out.

For more information, see XREPL: eXtended REPL.

##### 24.1.3`` Shell completion🔗ℹ

Shell auto-completion for bash and zsh is available in "share/pkgs/shell-completion/racket-completion.bash" and "share/pkgs/shell-completion/racket-completion.zsh", respectively. To enable it, just run the appropriate file from your .bashrc or your .zshrc.

The "shell-completion" collection is only available in the Racket Full distribution. The completion scripts are also available online.

top contents ← prev up next →