A few weeks ago, I noted the appearance of
georgestagg/webR, an R distribution compiled to WASM that runs completely in the browser. The environment is served from a simple webserver, and requires no installation of R onto a back-end server or onto your own desktop. Instead, the environment runs inside a virtual machine inside your browser (try it here):
For an iframe embeddable Python REPL running in the browser, see for example
At the moment, in WebR, I can’t see a direct way of displaying graphical (chart) output, (there appear to be various blockers with the handling of bitmap images?), although I note that the
svglite package is installed and seems to work…
WebR appears to be using https://terminal.jcubic.pl/ for the terminal UI, which in turn appears to support the definition of custom terminal functions; it also looks from jcubic/jquery.terminal#278 that the terminal can output and render images via HTML
<img /> tags, so presumably it could also add
<svg /> tags to the DOM. Which makes me wonder: could a custom function be defined that will read the contents of the SVG file and display it via an HTML
webR now has a chart display area:
I also wonder if the rendering machinery of JuptyerLite could be used to support the rendering of graphical output (though some magic may need to be involved?). There are several demos of JupyterLite kernels built using the Xeus Jupyter kernel framework, (which includes an early demo of an R kernel, Juniper Kernel), which makes me think; what would be involved in co-opting the WebR build process for use in a Xeus context to create a Xeus JupyterLite R kernel?
In passing, I also note there is a full Debian installation available running via WASM in the browser: WebVM: server-less x86 virtual machines in the browser (try it here: webvm.io ).
See also: jupyterlite — “serverless” Jupyter In the Browser Using Pyodide and WASM and SQL Databases in the Browser, via WASM: SQLite and DuckDB.