From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.

Racket is a general-purpose programming language designed for language-oriented programming, that is, the ability to implement other programming languages and DSLs. Racket is a descendant of Scheme which is itself a dialect of Lisp that began development in 1995 and continues to this day.


Racket is considered to be an excellent language for learning computer science, specifically the discipline of compiler design. The language has both a runtime and a JIT (just in time) compiler. It has a very expressive macro engine that goes well beyond the typical text-replacement macros common to the C preprocessor. Rather, racket macros are baked into Racket parser itself and can be used to extend the language and add new features on the fly.

Racket has its own package manager, raco.


USE flags

USE flags for dev-scheme/racket General purpose, multi-paradigm Lisp-Scheme programming language

chez Build Racket on Chez (Racket CS)
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
futures Enable racket/future library for fine-grained hardware parallelism
iconv Enable support for the iconv character set conversion library
jit Enable just-in-time compilation for improved performance. May prevent use of some PaX memory protection features in Gentoo Hardened.
minimal Install a very minimal build (disables, for example, plugins, fonts, most drivers, non-critical features)
ncurses Add ncurses support for expeditor (REPL expression editor)
places Enable racket/place library for share-nothing parallelism and message-passing communication. Compared to futures, places are heavyweight, but they have a simpler performance model.
threads Enable support for green threads


root #emerge --ask dev-scheme/racket



root #emerge --ask --depclean --verbose dev-scheme/racket


If manually installing any Racket packages in the installation scope, then they might have created some files inside /usr/share/racket/pkgs.

Those files can be cleaned up by removing them with rm as follows:

root #rm -r /usr/share/racket/pkgs

Installing Racket packages

Natively via Portage

To install Racket packages in the installation scope in a more controlled way, users may wish to use Portage for this task. Currently this is one of the aims of the "Gentoo-Racket" project.

Gentoo-Racket is maintaining the "Gentoo-Racket overlay" on the official GitLab instance.

The overlay can be installed by using the "Eselect/Repository eselect-repository" tool:

root #eselect repository enable racket-overlay

Via Racket's Package Manager, Raco

Raco is the built-in package manager of Racket, it can install packages via the following:

user $raco pkg install --user

Please use the switch --user to install packages in the user scope. Installation in user scope should be the default but it can be also configured to install packages globally, in the installation scope.

See Also

  • Raku — a high-level, general-purpose, and gradually typed programming language with low boilerplate objects, optionally immutable data structures, and an advanced macro system.

External resources

Racket Community

Resources for Learning Racket