A Jupyter Kernel is a background process that runs your code and communicate with the frontend (Notebook / Editor). There can be many frontends like VS Code, Quarto, Jupyter, etc.

The kernel is the brain / engine doing the code execution. A Jupyter kernel will:

  • Run code in the supported programming language,
  • Manage state (variables, imports, etc.) during a session,
  • Send rich outputs to frontend (plots, tables, etc.)

How the Jupyter Kernel Works

Kernel Layer

There is a list of available Jupyter kernels. You can even write your own custom kernel.

Xeus

xeus is a framework that helps with implementation of Jupyter kernels for programming languages. Instead of writing everything from scratch, xeus gives you:

  • messaging protocol implementation
  • kernel infrastructure
  • integration with Jupyter

Open-source community built Jupyter kernels for languages other than Python using xeus, for example:

You can read more about xeus here.

Communication Layer

jupyter-client is the communication layer (protocol + messaging system). Think of it like the language both frontend (UI) and kernel agrees to speak.

It defines:

  • how messages are sent
  • what format they use
  • how results/errors are returned

You can read more about it here.

flowchart TD
    U["User in Notebook / Editor UI"] --> A["Write code in a cell"]
    A --> B["Frontend / UI: JupyterLab / Notebook / VS Code"]
    B --> C["jupyter-client"]

    C --> K["Connected Kernel: ipykernel or xeus-cling or evcxr"]

    K --> E["Kernel process executes code"]
    E --> F["Maintains session state: variables, imports, memory"]
    F --> G["Produces output: text, tables, plots, errors"]

    G --> C
    C --> B
    B --> H["Rendered output shown in UI"]

    subgraph KernelOptions["Kernel Options"]
        P["ipykernel: Python"]
        CPP["xeus-cling: C++"]
        SQL["xeus-sql: SQL"]
        RUST["evcxr: Rust"]
        GO["gophernotes: Go"]
    end

    X["xeus"] -. "used to build" .-> CPP
    X -. "used to build" .-> SQL