Skip to content

Console ​

Romain CasatiOctober 17, 2026· in Python, Console, Notebook· 1 min read

Express restarts for Python ​

Restarting Basthon's Python kernel is now almost instant: about half a second, against three seconds before. You can start again from a clean state as often as needed, without waiting, in the console as in the notebook.

To achieve it, Basthon takes a snapshot of Python's memory just after it is loaded, before running a single line of code. At each restart, it starts again from this snapshot instead of reloading everything. Nothing of your code or your variables is in it: the kernel really restarts afresh.

The browser also keeps this snapshot from one visit to the next. From the second visit on, the kernel is ready in less than a second, instead of two and a half.

These speed-ups concern the isolated kernels, used by default. The legacy mode starts as before.


Romain CasatiOctober 16, 2026· in R, Notebook, Console· 1 min read

An R kernel in Basthon ​

After C, a new language arrives in Basthon: R! The reference language of statistics now works directly in the browser, with no installation nor server, thanks to the webR project.

Everything you expect from R is there:

  • results are shown as in the R console;
  • charts (plot, hist, barplot…) appear directly next to the console or below the cell;
  • missing packages (dplyr, ggplot2…) are downloaded automatically at the first library();
  • the help is still available with ?mean or help("mean");
  • readline() asks the user for an input.

It is available in the console and in the notebook, and the gallery already offers a few examples.

Play with it!

The R kernel in the console


Romain CasatiOctober 14, 2026· in C, Notebook, Console· 1 min read

A C kernel in Basthon ​

Big news: Basthon now speaks C! The code is compiled to WebAssembly directly in the browser, with no installation nor server, thanks to the xcc compiler.

The kernel is designed for learning:

  • no need for main: statements run directly, and everything declared stays available for what follows;
  • the last expression, without a semicolon, is shown with its type;
  • scanf works like Python's input;
  • the formats of printf and scanf, NULL pointers and array overflows are reported.

It is available in the console and in the notebook.

Play with it!

The C kernel in the console


Romain CasatiOctober 13, 2026· in OCaml, Notebook, Console· 1 min read

Interactive and animated OCaml canvases ​

In Basthon's OCaml kernel, a Graphics_js canvas once shown stays alive after the cell has run. It reacts to the mouse and the keyboard with loop, mouse_pos or read_key, and can be animated with Lwt.

It works in the console as in the notebook, including with isolated kernels.

Play with it!

An OCaml canvas that reacts to clicks and to the keyboard


Romain CasatiOctober 12, 2026· in Python, Notebook, Console· 1 min read

Interactive matplotlib figures ​

With isolated kernels, Basthon's matplotlib figures become interactive: zoom, pan, back to previous views, coordinates shown under the mouse… The figure is computed in the kernel, then shown in an isolated frame, with its toolbar.

Mouse and keyboard events (mpl_connect) and animations work too, and the figure is exported as PNG, SVG or PDF with the download button.

Play with it!

Zoom on a matplotlib figure