Racket Environment

This notebook creates the default Racket environment in Nextjournal.

Setup

Build Environment

Install one dependency.

apt-get -qq update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends \
  libjpeg-dev
apt-get clean
rm -r /var/lib/apt/lists/* # Clear package list so it isn't stale
9.9s
Racket (Bash)

Download Racket installer.

FILENAME="racket-${RACKET_VERSION}-x86_64-linux.sh"
FILEURL="https://mirror.racket-lang.org/installers/${RACKET_VERSION}/${FILENAME}"
wget --progress=bar:force -O /results/${FILENAME} ${FILEURL}
5.1s
Racket (Bash)
racket-7.5-x86_64-linux.sh

Install Racket.

bash NJ__REF_ --unix-style --dest /opt/racket --create-dir
12.1s
Racket (Bash)

Use the package manager to install IRacket and a few extra packages, then install the Jupyter kernel.

raco pkg install --installation --deps search-auto iracket \
  sicp pict plot 2htdp-typed
raco iracket install
90.5s
Racket (Bash)

Print info.

du -hsx /
racket -V
jupyter kernelspec list
2.7s
Racket (Bash)

Test

(+ 1 2)
0.1s
Racket Test (Racket)
Racket
3

SICP

(read-accept-reader #t)
0.0s
Racket Test (Racket)
Racket
#lang sicp
0.9s
Racket Test (Racket)
Racket
(require pict)
(circle 10)
0.5s
Racket Test (Racket)
Racket
(list (circle 10) (rectangle 10 20))
0.0s
Racket Test (Racket)
Racket
(list )
Runtimes (2)
Runtime Languages (1)