IRacket:   Racket Kernel for Jupyter
1 Installing the IRacket Jupyter Kernel
1.1 IRacket Installation API
install-iracket!
7.7

IRacket: Racket Kernel for Jupyter

Ryan Culpepper <ryanc@racket-lang.org>

This library provides a Racket kernel for Jupyter, enabling interactive notebook-style programming with Racket.

1 Installing the IRacket Jupyter Kernel

After installing the iracket package, you must register the IRacket kernel with Jupyter. Kernel registration can be done either through the raco iracket install command or by using the iracket/install module.

If racket and jupyter are both in your executable search path, then you can register the kernel by either of the following:

If the jupyter command is not in your executable search path, you must tell the installer the absolute path to the jupyter executable using the --jupyter-exe flag or #:jupyter-exe keyword argument. The installer runs jupyter --data-dir to find the directory where it should install the IRacket kernel.

If the racket command is not in your executable search path, or if you want to register a kernel that uses a specific version of Racket, then you must tell the installer the path to the executable to use. The executable must support the same command-line interface that the racket executable supports, but it does not have to be named racketfor example, a racketcgc or racketcs executable would also work. See the output of raco iracket install --help or the documentation for install-iracket! for details.

Note that if you register the kernel with a non-version-specific Racket command (the default) and then change that command to run a different version of Racket (for example, by changing your PATH or by installing a new version of Racket over the old one), then Jupyter will try to use the new version of Racket to run the IRacket kernel. If the iracket package is not installed in the new version, this typically results in an error like “collection not found for module path: (lib "iracket/iracket")”. The same error will occur if you try to run the kernel after removing the iracket package.

Changed in version 1.1: Added raco iracket command.

1.1 IRacket Installation API

 (require iracket/install) package: iracket

procedure

(install-iracket! [#:jupyter-exe jupyter-exe    
  #:racket-exe racket-exe])  void?
  jupyter-exe : (or/c (and/c path-string? complete-path?) #f)
   = #f
  racket-exe : (or/c path-string? 'auto 'this-version) = #f
Registers the IRacket kernel in the location reported by jupyter-exe (with the --data-dir flag). If racket-exe is a path or string, then it is included in the kernel registration as the command Jupyter should use to run the kernel. If racket-exe is #f, then the registration uses the generic racket command, but only if it is included in the current executable search path; otherwise, an error is raised. If racket-exe is 'this-version, then the absolute path to the currently running version of Racket is used.

Added in version 1.1 of package iracket.