LinuxCommandLibrary

racket

TLDR

Start REPL

$ racket
copy
Run script
$ racket [script.rkt]
copy
Evaluate expression
$ racket -e "(+ 1 2 3)"
copy
Run with specific language
$ racket -l [typed/racket] [script.rkt]
copy
Interactive with file
$ racket -it [script.rkt]
copy
Compile to bytecode
$ raco make [script.rkt]
copy
Create executable
$ raco exe [script.rkt]
copy

SYNOPSIS

racket [-e expr] [-l lang] [-it] [options] [file] [args]

DESCRIPTION

racket is the main implementation of Racket, a general-purpose programming language in the Lisp/Scheme family.
The language emphasizes language-oriented programming. The #lang directive at file start selects the language: racket, typed/racket, scribble, and many others.
The REPL provides interactive development. Tab completion, history, and inline documentation support exploratory programming.
raco is the Racket command tool for package management, compilation, documentation, and other tasks. It extends Racket's capabilities.
Typed Racket adds optional static typing. Type annotations catch errors at compile time while maintaining Racket's expressiveness.
The DrRacket IDE provides a graphical environment with debugging, profiling, and educational features.

PARAMETERS

-e EXPR

Evaluate expression.
-l LANG
Use language.
-f FILE
Load file.
-t FILE
Require file.
-i
Interactive mode.
-it FILE
Load and interact.
-I LANG
Set language and interact.
-m, --main
Run main submodule.
-v, --version
Show version.
-h, --help
Show help.
--
End options.

CAVEATS

Different from standard Scheme in some areas. Package system requires network access. Large standard distribution.

HISTORY

Racket evolved from PLT Scheme, which began at Rice University in 1995. The name changed to Racket in 2010 to reflect its evolution beyond Scheme. It's widely used in programming language research and education.

SEE ALSO

raco(1), drracket(1), scheme(1), guile(1)

Copied to clipboard