0
votes

My understanding is that a kernel executes code and a CLI is the GUI that allows the user to access the kernel. Jupyter Notebook is said to have an enhanced REPL. I am trying to understand conceptually where that enhanced interactive shell sits within the three components that make up the Jupyter Notebook environment: the web app, kernels, notebook documents.

From the docs: The Jupyter Notebook combines three components:

The notebook web application: An interactive web application for writing and running code interactively and authoring notebook documents.

Kernels: Separate processes started by the notebook web application that runs users’ code in a given language and returns output back to the notebook web application. The kernel also handles things like computations for interactive widgets, tab completion and introspection.

Notebook documents: Self-contained documents that contain a representation of all content visible in the notebook web application, including inputs and outputs of the computations, narrative text, equations, images, and rich media representations of objects. Each notebook document has its own kernel.

It sounds like the Python kernel for Jupyter Notebook is IPython which is also described as both a kernel and shell.

From Wikipedia: IPython continues to exist as a Python shell and a kernel for Jupyter, while the notebook and other language-agnostic parts of IPython moved under the Jupyter name.

I'm also wondering if the kernel-shell-app diagram below can be applied to the Jupyter Notebook environment as kernel-Notebook document- the notebook wed application. Source enter image description here

1
CLI ≠ GUI!! CLI = command line interpreter; GUI = graphical user interface. Both are user interfaces but of different nature: Kind of by definition the CLI is not graphical. So right there might be the start of your confusion. Now it is true that you type "command lines" into your Jupyter notebook - the GUI - and stuff gets passed to the kernel and results get returned and displayed in your notebook. So you might consider where the "command line" is being understood, and how it is passed. - davidbak

1 Answers

0
votes

The REPL interacts through the kernel, as it states

runs users’ code in a given language and returns output

For your later image, OS kernel is not equivalent to the definition of the IPython kernel, which itself is an application from the OS point of view