Working with Jupyter Kernels
Nextjournal already offers several Jupyter kernels in addition to native support for R, Python, Julia, Clojure, and Bash. A new experimental feature makes it easy to add new Jupyter runtimes.
Adding a Jupyter Runtime Language
Nextjournal already supports IPython, IJulia, and IRkernel. The team has recently added F#, Scala, Agda, Scheme, and Haskell Jupyter kernels as reusable environments.
Run Nextjournal in experimental mode by appending
?experimental=1to the end of your url and reloading the page.Click the + button between nodes and select Jupyter Runtime Language. For more information about working with the insert menu, see Adding Nodes.
You will be taken to a special cell called Add a Jupyter runtime language. Select an environment from the list. You may be asked to also select which version of the language you prefer.
Press Save & Add [Language] Code Cell where [Language] is the new Jupyter runtime environment.
Click the + button between nodes and select Code Cell: [Language]. For more information about working with code cells, see Code Cells.
Showcase: IHaskell
import IHaskell.Displayhtml "<h1>I 💜 Haskell</h1>"Kernel detection is done by searching for kernel specification files in usual system folders, the script we're using to find such files is a nextjournal notebook itself.
Adding a Jupyter Image Using Docker
We baked new default nextjournal environments for F#, Scala and Haskell but any Nextjournal environment with a kernel installed will do. You can for instance download an arbitrary Docker image via Import Docker Environment option in the insert menu. Let's try with the Calysto Scheme image:

Now add a new Jupyter Runtime Language node, select the Scheme environment, save and add a scheme cell:
(define filter-map (lambda (f pred? values) (if (null? values) '() (if (pred? (car values)) (cons (f (car values)) (filter-map f pred? (cdr values))) (filter-map f pred? (cdr values))))))(define-syntax collect [(collect ?exp for ?var in ?list if ?condition) (filter-map (lambda (?var) ?exp) (lambda (?var) ?condition) ?list)])After this step you can add new scheme cells as usual via insert menu (or command+shift with an existing cell focused).
(collect (* n n) for n in (range 1 5) if odd?)%latex x_1 = \dfrac{a}{b}Known Caveats
While we do support Jupyter rich display system (via MIME bundles) and IPyWidgets, we cannot install custom frontend extensions and in general we can't support the client-side of jupyter custom communication layer yet. We're happy to hear feedback from our users and to solve issues with specific kernels.