The BeakerX kernels have magics to run other kernels, including %%python
. There are magics for each BeakerX langage: %%groovy
, %%java
, %%scala
, %%sql
, %%clojure
, and %%kotlin
. There is also a %%kernel
magic to access any kernel available to Jupyter. Widgets work through these magics. These magics give access to Python from the JVM.
There are also Groovy Magics magics for accessing the JVM from Python.
Fleshing out the polyglot support in BeakerX with communication between languages (#5039) is on the agenda.
For example, even though this is a Groovy notebook, you can run Python code:
%%python
print("regular")
{"output": "works"}
%%python
import ipywidgets as widgets
w = widgets.IntSlider()
w
%%python
w.value
%%scala
new TableDisplay(Seq(Map("a" -> 1, "b" -> 2, "c" -> 3),
Map("a" -> 4, "b" -> 5, "c" -> 6),
Map("a" -> 7, "b" -> 8, "c" -> 8)))
Access any kernel available to Jupyter by name:
%%kernel ir
x <- rnorm(1000)
plot(x)
%%kernel julia-0.6
(1 + 1im) * (1 - 1im)