<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Jupyter Blog - WebAssembly</title><link href="https://jasongrout.github.io/medium-archive/pelican/" rel="alternate"/><link href="https://jasongrout.github.io/medium-archive/pelican/feeds/tag-webassembly.atom.xml" rel="self"/><id>https://jasongrout.github.io/medium-archive/pelican/</id><updated>2026-07-10T05:49:00+00:00</updated><subtitle>The Project Jupyter blog: news, releases, and community stories, archived from blog.jupyter.org.</subtitle><entry><title>JupyterLite 0.8 is released! 🎉</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/" rel="alternate"/><published>2026-07-10T05:01:00+00:00</published><updated>2026-07-10T05:49:00+00:00</updated><author><name>Jeremy Tuloup</name></author><id>tag:jasongrout.github.io,2026-07-10:/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/</id><summary type="html">&lt;p&gt;JupyterLite is a Jupyter distribution that runs entirely in the web browser without any server components. Deployment and hosting are easy…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;a href="https://jupyterlite.readthedocs.io/"&gt;JupyterLite&lt;/a&gt; is a Jupyter distribution that runs entirely in the web browser without any server components. Deployment and hosting are easy as JupyterLite sites are just static websites.&lt;/p&gt;
&lt;p&gt;The new 0.8 release includes a number of new features, bug fixes, and enhancements. This release also brings significant improvements to the user experience and new customization options for JupyterLite deployments.&lt;/p&gt;
&lt;h2 id="sharing-a-repl"&gt;Sharing a REPL&lt;/h2&gt;
&lt;p&gt;When the &lt;a href="https://jupyterlite.readthedocs.io/en/stable/quickstart/embed-repl.html#enable-the-toolbar"&gt;REPL toolbar&lt;/a&gt; is enabled, it now includes a &lt;strong&gt;Copy Shareable Link&lt;/strong&gt; button. Clicking it captures the current state of the REPL, the prompt content, the selected kernel and theme, and any non-default options, into the page URL, and copies the resulting link to the clipboard. A notification confirms the link was copied, making it easy to share a ready-to-run REPL with others.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/images/001-1_nj2zTCdB_5ZOP9UpQ1q_yg.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;h2 id="refreshed-loading-screen"&gt;Refreshed Loading Screen&lt;/h2&gt;
&lt;p&gt;The loading indicator shown while JupyterLite starts up has been redesigned to match the JupyterLab splash screen to make the transition from the initial loading screen to the fully loaded application feel more seamless.&lt;/p&gt;
&lt;p&gt;The loading indicator remains configurable, and can be enabled or disabled for specific applications. See the &lt;a href="https://jupyterlite.readthedocs.io/en/stable/howto/configure/loading_indicator.html"&gt;loading indicator guide&lt;/a&gt; for more details.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/images/002-1_EFPxwNDTRN3933qULcA3Rg.mp4" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;h2 id="file-system-reliability-improvements"&gt;File System Reliability Improvements&lt;/h2&gt;
&lt;p&gt;JupyterLite 0.8 includes many fixes to the in-browser file system used to store your notebooks and files. Creating files and directories is now faster and more reliable, saving a file to a directory that does not exist is now rejected with a clear error rather than failing silently, and files are no longer opened twice on startup when using query parameters. These changes make working with files in JupyterLite smoother and more dependable.&lt;/p&gt;
&lt;h2 id="jupyterlab-46-and-notebook-76"&gt;JupyterLab 4.6 and Notebook 7.6&lt;/h2&gt;
&lt;p&gt;JupyterLite 0.8 is built on top of JupyterLab 4.6 and Notebook 7.6, and brings many of the respective improvements and bug fixes. Check out the &lt;a href="/posts/2026/jupyterlab-4-6-and-notebook-7-6-are-out/"&gt;announcement post&lt;/a&gt; to learn more about these new releases.&lt;/p&gt;
&lt;p&gt;This JupyterLite release includes 9 new features and enhancements, 11 bug fixes, and 5 documentation improvements. 13 people contributed to this release. Across 85 maintenance tasks and dependency updates, we kept JupyterLite up to date with the latest JupyterLab and Notebook releases.&lt;/p&gt;
&lt;h2 id="a-terminal-in-the-browser"&gt;A Terminal in the Browser&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://github.com/jupyterlite/terminal"&gt;JupyterLite Terminal&lt;/a&gt; adds a fully in-browser command-line terminal to JupyterLite, powered by the &lt;a href="https://github.com/jupyterlite/cockle"&gt;cockle&lt;/a&gt; shell. Commands run as WebAssembly directly in the browser, with no server involved. Version 1.5 adds compatibility with JupyterLite 0.8, and recent releases include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A growing set of familiar command-line tools compiled to WebAssembly, including &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;cp&lt;/code&gt;, &lt;code&gt;mv&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;sed&lt;/code&gt;, &lt;code&gt;tree&lt;/code&gt;, &lt;code&gt;git&lt;/code&gt;, and the &lt;code&gt;vim&lt;/code&gt; and &lt;code&gt;nano&lt;/code&gt; editors.&lt;/li&gt;
&lt;li&gt;Tab completion for commands, arguments, and file names, with a confirmation prompt before listing a very large number of matches.&lt;/li&gt;
&lt;li&gt;New JupyterLab commands for running shell commands programmatically and capturing their output, without opening a terminal panel.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
&lt;img alt="Running terminal commands in the browser" src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/images/003-0_Zdo8FbjAiAGkh3IH.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Running terminal commands in the browser&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="more-kernels-with-jupyterlite-xeus"&gt;More Kernels with jupyterlite-xeus&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://jupyterlite-xeus.readthedocs.io/"&gt;jupyterlite-xeus&lt;/a&gt; builds JupyterLite deployments around &lt;a href="https://xeus.readthedocs.io/"&gt;Xeus&lt;/a&gt;-based kernels and lets you pre-install packages from &lt;a href="https://conda-forge.org/"&gt;conda-forge&lt;/a&gt; and emscripten-forge straight into the browser environment through an &lt;code&gt;environment.yml&lt;/code&gt; file. Its recent releases (the 4.5 series and the new 5.0) are compatible with JupyterLite 0.8 and add a number of improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A growing list of supported kernels, including &lt;code&gt;xeus-python&lt;/code&gt;, &lt;code&gt;xeus-r&lt;/code&gt;, &lt;code&gt;xeus-cpp&lt;/code&gt;, &lt;code&gt;xeus-lua&lt;/code&gt;, &lt;code&gt;xeus-nelson&lt;/code&gt;, &lt;code&gt;xeus-octave&lt;/code&gt;, and &lt;code&gt;xeus-javascript&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Installing packages at runtime now feels more natural: you can run &lt;code&gt;pip install&lt;/code&gt;or &lt;code&gt;conda install&lt;/code&gt;directly in a cell, with the leading &lt;code&gt;%&lt;/code&gt; or &lt;code&gt;!&lt;/code&gt; now optional.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To learn more about pre-installing packages, mounting files, and the available kernels, see the &lt;a href="https://jupyterlite-xeus.readthedocs.io/"&gt;jupyterlite-xeus documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="python-314-with-the-pyodide-kernel"&gt;Python 3.14 with the Pyodide Kernel&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://github.com/jupyterlite/pyodide-kernel"&gt;Pyodide kernel&lt;/a&gt; has been updated to version 0.8.0. It bundles the latest &lt;a href="https://pyodide.org/"&gt;Pyodide&lt;/a&gt; release, which upgrades the in-browser Python interpreter to &lt;strong&gt;Python 3.14&lt;/strong&gt;. Notebooks and consoles running on the Pyodide kernel now use the newest Python version, including recent standard library additions such as the new &lt;code&gt;compression.zstd&lt;/code&gt; module.&lt;/p&gt;
&lt;p&gt;For deployments that pre-compute the set of packages to ship offline, the kernel’s lock add-on can now build a customized &lt;code&gt;pyodide-lock.json&lt;/code&gt; from your own requirements — including reading dependencies from a &lt;code&gt;requirements.txt&lt;/code&gt; file or a &lt;code&gt;pyproject.toml&lt;/code&gt; dependency group — giving site authors finer control over which packages are available without a network connection.&lt;/p&gt;
&lt;p&gt;See the &lt;a href="https://github.com/jupyterlite/pyodide-kernel/releases/tag/v0.8.0"&gt;pyodide-kernel 0.8.0 release notes&lt;/a&gt; for the full list of changes.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Pyodide 314 in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/images/004-1_kMihemTy3YNeaStnK6bH1A.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Pyodide 314 in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="javascript-kernel-improvements"&gt;JavaScript Kernel Improvements&lt;/h2&gt;
&lt;p&gt;The in-browser &lt;a href="https://github.com/jupyterlite/javascript-kernel"&gt;JavaScript kernel&lt;/a&gt; has gained several improvements in its 0.4 development line:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A new iframe-based execution mode with better support for libraries that need direct access to the DOM, such as &lt;a href="https://p5js.org/"&gt;p5.js&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Initial support for Jupyter Widgets, through Comm channels and a set of base widgets.&lt;/li&gt;
&lt;li&gt;Clearer error messages and tracebacks, including a fix for errors that previously rendered as blank in Firefox.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
&lt;img alt="Jupyter Widgets and dynamic imports with the JavaScript kernel" src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/images/005-1_uhOWj2tSrsSP_maQk3vWaA.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Jupyter Widgets and dynamic imports with the JavaScript kernel&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="try-it-in-your-browser"&gt;Try it in your browser&lt;/h2&gt;
&lt;p&gt;If you would like to try the new release in your browser, click on the following link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://jupyter.org/try-jupyter/"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/images/006-0_WKrNZ-b6NXSbf5UG.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;Thanks to &lt;a href="https://x.com/TechAtBloomberg"&gt;Bloomberg&lt;/a&gt; for funding the work on JupyterLite at &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt;, and for their ongoing support for JupyterLite in general.&lt;/p&gt;
&lt;p&gt;Many thanks to all the contributors to JupyterLite. The list below is based on GitHub usernames for the 0.8 release across the different projects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;New contributors: @Darshan808, @MMesch, @MUFFANUJ, @wata727&lt;/li&gt;
&lt;li&gt;Returning contributors: @DerThorsten, @agriyakhetarpal, @bollwyvl, @ianthomas23, @jasongrout, @jtpio, @martinRenou, @trungleduc&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thank you to the extended group of contributors in Jupyter Frontends and related project in the Jupyter ecosystem 💛&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-0-8-is-released/images/007-0_AJW_fYChAaoUhRbD.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="JupyterLite"/><category term="releases"/><category term="WebAssembly"/></entry><entry><title>JupyterLite Officially Joins Project Jupyter!</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-officially-joins-project-jupyter/" rel="alternate"/><published>2026-02-12T16:14:00+00:00</published><updated>2026-02-19T12:26:00+00:00</updated><author><name>Project Jupyter</name></author><id>tag:jasongrout.github.io,2026-02-12:/medium-archive/pelican/posts/2026/jupyterlite-officially-joins-project-jupyter/</id><summary type="html">&lt;p&gt;We are thrilled to announce that JupyterLite is now an official part of Project Jupyter. This milestone marks a significant step forward…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-officially-joins-project-jupyter/images/001-1_1mHVBUr6tB3TP0Z1ujvdjw.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;We are thrilled to announce that JupyterLite is now an official part of Project Jupyter. This milestone marks a significant step forward for interactive computing in the browser and strengthens JupyterLite’s role within the Jupyter ecosystem.&lt;/p&gt;
&lt;h2 id="what-is-jupyterlite"&gt;What is JupyterLite?&lt;/h2&gt;
&lt;p&gt;JupyterLite is a JupyterLab distribution that runs entirely in your web browser. Kernels execute directly in the browser using WebAssembly, eliminating the need for an application server. This means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Instant access&lt;/strong&gt;: Start computing with a single click: no prior Python setup, environment configuration, or server management required.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Host thousands of concurrent users from a static website (e.g., GitHub Pages) with zero per-user server costs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Privacy and portability&lt;/strong&gt;: Code and data remain in the user’s browser, making it ideal for embedding in documentation, tutorials, and interactive demos.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;JupyterLite greatly expands the options available in the Jupyter ecosystem for &lt;strong&gt;education&lt;/strong&gt;, &lt;strong&gt;documentation&lt;/strong&gt;, and &lt;strong&gt;demos&lt;/strong&gt;, where reducing friction is critical.&lt;/p&gt;
&lt;p&gt;As Brian Granger reminded us during his &lt;a href="https://youtu.be/IJO7_v7GEVc?si=8_0bMM39ci_QulYb&amp;amp;t=337"&gt;JupyterCon 2025 keynote&lt;/a&gt;, Jupyter’s mission is “to empower people of all backgrounds to think, collaborate, and share knowledge using computational storytelling.” From this perspective, JupyterLite is a logical and key next step to take, letting Jupyter take advantage of the impressive strides made in recent years by the WebAssembly/JavaScript ecosystem (in reach and capability) to advance this mission. JupyterLite is an excellent complement to other forms of accessing Jupyter (whether through a local Python installation or a hosted infrastructure service), that facilitates new use cases and lowers barriers in many others.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Screencast of JupyterLite in action, showing a live jupyter notebook with widgets and data visualisation." src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-officially-joins-project-jupyter/images/002-1_OEJksEVfQVZugt_d6EYXBQ.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Interactive computing in the browser with JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="the-journey-of-jupyterlite"&gt;The Journey of JupyterLite&lt;/h2&gt;
&lt;p&gt;JupyterLite’s development began in 2021, led by &lt;strong&gt;Jeremy Tuloup&lt;/strong&gt; at &lt;strong&gt;QuantStack&lt;/strong&gt;. Over the past four years, it has benefited from the dedication of several other team members, Martin Renou, Trung Le, and Ian Thomas — as well as invaluable contributions from &lt;strong&gt;community members&lt;/strong&gt; like Nick Bollweg and many others.&lt;/p&gt;
&lt;p&gt;Beyond the JupyterLite repository, the project includes &lt;strong&gt;comprehensive tooling&lt;/strong&gt; for creating in-browser language kernels based on &lt;strong&gt;xeus&lt;/strong&gt;. These kernels support languages like &lt;strong&gt;Python&lt;/strong&gt;, &lt;strong&gt;R&lt;/strong&gt;, &lt;strong&gt;C++&lt;/strong&gt;, &lt;strong&gt;GNU Octave&lt;/strong&gt;, &lt;strong&gt;Lua&lt;/strong&gt;, and &lt;strong&gt;SQLite&lt;/strong&gt;, sharing the same codebase as their backend counterparts, developed by Thorsten Beier, Isabel Paredes, Johan Mabille, and Antoine Prouvost. These kernels are built upon the &lt;strong&gt;emscripten-forge&lt;/strong&gt; software distribution for WebAssembly. The project also includes a Python kernel based on &lt;strong&gt;Pyodide&lt;/strong&gt;, and kernels for JavaScript and &lt;a href="http://p5.js"&gt;p5.js&lt;/a&gt;. This architecture means that the same language-agnostic model for kernels that Jupyter pioneered over a decade ago, carries over to the WebAssembly world.&lt;/p&gt;
&lt;p&gt;The JupyterLite GitHub organization also features the &lt;strong&gt;JupyterLite Terminal&lt;/strong&gt;, a terminal and shell emulator that runs entirely in the browser and was developed by Ian Thomas. It enables the use of basic Unix commands like &lt;strong&gt;grep&lt;/strong&gt;, &lt;strong&gt;sed&lt;/strong&gt;, &lt;strong&gt;cat&lt;/strong&gt;, &lt;strong&gt;touch&lt;/strong&gt;, and even &lt;strong&gt;vim&lt;/strong&gt; or &lt;strong&gt;nano&lt;/strong&gt;, all built to WebAssembly.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Screenshot of the JupyterLite terminal emulator, showing some basic Unix commands" src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-officially-joins-project-jupyter/images/003-1_8hPGoJK8chK2uEVlL9ig9Q.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The JupyterLite terminal emulator, with basic Unix commands&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;JupyterLite now powers the &lt;strong&gt;official Jupyter website&lt;/strong&gt; and is used by projects like &lt;strong&gt;numpy.org&lt;/strong&gt;, &lt;strong&gt;sympy.org&lt;/strong&gt;. It also underlies services such as &lt;a href="https://www.jupytereverywhere.org/"&gt;&lt;strong&gt;Jupyter Everywhere&lt;/strong&gt;&lt;/a&gt; and &lt;a href="https://notebook.link/"&gt;&lt;strong&gt;notebook.link&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="a-natural-fit-with-jupyterlab"&gt;A Natural Fit with JupyterLab&lt;/h2&gt;
&lt;p&gt;JupyterLite has always been closely tied to JupyterLab. It is increasingly becoming a set of JupyterLab extensions that replace core plugins to manage kernels, settings, and content in the browser. With contributors overlapping significantly with the Jupyter Frontends group, this integration formalizes what many in the community already recognized: JupyterLite is a core part of the Jupyter ecosystem.&lt;/p&gt;
&lt;p&gt;The proposal to transfer JupyterLite to the Jupyter governance received strong support from the Jupyter community and by the &lt;a href="https://github.com/jupyterlab/frontends-team-compass/issues/290"&gt;Jupyter Frontends council&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="better-integration-with-the-rest-of-jupyter"&gt;Better integration with the rest of Jupyter&lt;/h2&gt;
&lt;p&gt;With JupyterLite now being an official part of Jupyter, it will be easier to find areas for better integration with other aspects of our ecosystem: we can reduce duplication, smooth out the documentation and model for creating and using both “traditional” (server-hosted) and WebAssembly kernels, and make JupyterLite a natural instant-access component of &lt;a href="https://mystmd.org/guide/in-page-execution#jupyterlite"&gt;MyST/JupyterBook-based sites&lt;/a&gt;, and more.&lt;/p&gt;
&lt;p&gt;Mission-wise, JupyterLite is a natural next step for Jupyter, and having it be an official part of the project makes it much easier for the community to integrate its benefits throughout. We hope you’ll try it, use it and contribute to its growth!&lt;/p&gt;
&lt;h2 id="try-it-in-your-browser"&gt;Try it in your browser&lt;/h2&gt;
&lt;p&gt;If you would like to try JupyterLite in your browser, click on the following link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://jupyter.org/try-jupyter/"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2026/jupyterlite-officially-joins-project-jupyter/images/004-1_EUSdzza6CGF6EA195jkzCA.webp" alt="Try lite now." loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="acknowledgments-and-team-credits"&gt;Acknowledgments and team credits&lt;/h2&gt;
&lt;p&gt;JupyterLite’s success is thanks to the support of &lt;strong&gt;individuals and organizations&lt;/strong&gt; who believed in its vision. This includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;QuantStack&lt;/strong&gt;, for their continued investment in the project since 2021 and the broader Jupyter ecosystem,&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bloomberg&lt;/strong&gt;, for funding improvements to JupyterLite by QuantStack since 2023,&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Gates Foundation&lt;/strong&gt;, for funding the development of the xeus-R kernel and its port to WebAssembly,&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Pyodide&lt;/strong&gt; project, whose pioneering work on Python in the browser via WebAssembly made JupyterLite possible.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Key developers to this stack include:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Jeremy Tuloup&lt;/strong&gt; (Director at QuantStack, creator of JupyterLite, and JupyterLab maintainer),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nicholas Bollweg&lt;/strong&gt; (JupyterLite maintainer and #2 all-time committer),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Martin Renou&lt;/strong&gt; (Director at QuantStack, JupyterLite maintainer, responsible for integrating xeus with emscripten-forge, and creator of JupyterLite-Sphinx),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Thorsten Beier&lt;/strong&gt; (Software developer at QuantStack, lead developer of emscripten-forge, and xeus-lite),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Isabel Paredes&lt;/strong&gt; (Software developer at QuantStack, led the packaging of R and GNU Octave in Emscripten-forge),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anutosh Bhat&lt;/strong&gt; (Software developer at QuantStack, C++ kernel in the browser),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ian Thomas&lt;/strong&gt; (Software developer at QuantStack, creator of the JupyterLite terminal, and the cockle shell emulator),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Johan Mabille&lt;/strong&gt; (Director at QuantStack, creator of xeus),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agriya Khetarpal&lt;/strong&gt; (Pyodide contributor, JupyterLite-Sphinx maintainer),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Albert Steppi&lt;/strong&gt; (JupyterLite-Sphinx maintainer).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thank you for being part of this journey, we cannot wait to see what you build with JupyterLite!&lt;/p&gt;
&lt;p&gt;— this post was coauthored by Jérémy Tuloup, Sylvain Corlay, and Fernando Pérez&lt;/p&gt;
</content><category term="education"/><category term="JupyterLite"/><category term="WebAssembly"/></entry><entry><title>JupyterLite 0.7 is released! 🎉</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/" rel="alternate"/><published>2025-12-04T22:11:00+00:00</published><updated>2025-12-04T22:11:00+00:00</updated><author><name>Jeremy Tuloup</name></author><id>tag:jasongrout.github.io,2025-12-04:/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/</id><summary type="html">&lt;p&gt;JupyterLite is a Jupyter distribution that runs entirely in the web browser without any server components. Deployment and hosting are easy…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;a href="https://jupyterlite.readthedocs.io/"&gt;JupyterLite&lt;/a&gt; is a Jupyter distribution that runs entirely in the web browser without any server components. Deployment and hosting are easy as JupyterLite sites are just static websites.&lt;/p&gt;
&lt;p&gt;The new 0.7 release includes a number of new features, bug fixes, and enhancements. This release also brings significant improvements to the user experience and new customization options for JupyterLite deployments.&lt;/p&gt;
&lt;h2 id="workspace-support"&gt;Workspace Support&lt;/h2&gt;
&lt;p&gt;Support for workspaces is now available in JupyterLite. Workspaces allow you to organize your notebooks and files into separate workspace environments, making it easier to switch between different projects or contexts.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Workspaces are now supported in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/images/001-0_9Zx1pB5PRtEUdrYR.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Workspaces are now supported in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The UI layout is also now automatically persisted across sessions. When you return to JupyterLite, your panel arrangements, open files, and workspace configuration will be restored exactly as you left them.&lt;/p&gt;
&lt;h2 id="audio-and-video-playback"&gt;Audio and Video Playback&lt;/h2&gt;
&lt;p&gt;JupyterLite now includes built-in audio and video viewers, allowing users to open audio and video files directly from within the UI.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Open audio and video files in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/images/002-0__FaFC2jYOUzmdmzN.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Open audio and video files in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="basic-interrupt-functionality"&gt;Basic Interrupt Functionality&lt;/h2&gt;
&lt;p&gt;The interrupt button now cancels the execution of cells that are scheduled to run after the currently executing cell. While this doesn’t interrupt the currently running cell itself, it provides better control when executing multiple cells in sequence.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The stop button now cancels the execution of scheduled cells" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/images/003-0_BNaPV7T03CPtnemP.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The stop button now cancels the execution of scheduled cells&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="basic-notebook-export"&gt;Basic Notebook Export&lt;/h2&gt;
&lt;p&gt;JupyterLite now includes basic notebook export functionality through a custom export plugin. Users can export notebooks to different formats including &lt;code&gt;.ipynb&lt;/code&gt; (notebook format) and script formats directly from the File menu.&lt;/p&gt;
&lt;p&gt;Additionally, JupyterLite provides extension points for third-party extensions to register custom exporters. This enables the development of additional export formats, such as PDF, in future extensions.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: there is currently no built-in support for PDF export, but this may be added in the future via a third-party extension.&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Basic notebook exports are now available" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/images/004-0_lqn02-318xj6qHVX.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Basic notebook exports are now available&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="file-menu-download-option"&gt;File Menu Download Option&lt;/h2&gt;
&lt;p&gt;A download entry has been added to the File menu, making it easier to download files from your JupyterLite environment.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Download a notebook using the file menu entry" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/images/005-0_yaURYoXXA2Ujf_Ti.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Download a notebook using the file menu entry&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="enhanced-markdown-support"&gt;Enhanced Markdown Support&lt;/h2&gt;
&lt;p&gt;Markdown cells now support displaying base64-encoded images stored in the browser’s local storage. This makes it easier to include images in your notebooks without requiring external hosting or network access.&lt;/p&gt;
&lt;h2 id="jupyterlab-45-and-notebook-75"&gt;JupyterLab 4.5 and Notebook 7.5&lt;/h2&gt;
&lt;p&gt;JupyterLite 0.7.0 is built on top of JupyterLab 4.5.0 and Notebook 7.5.0, and brings many of the respective improvements and bug fixes. Check out the &lt;a href="/posts/2025/jupyterlab-4-5-and-notebook-7-5-are-available/"&gt;announcement post&lt;/a&gt; to learn more about these new releases.&lt;/p&gt;
&lt;p&gt;JupyterLab 4.5 notably includes significant &lt;a href="https://jupyterlab.readthedocs.io/en/latest/getting_started/changelog.html#performance-and-windowing"&gt;notebook performance improvements&lt;/a&gt;, such as the new optimized cell rendering with the new &lt;code&gt;contentVisibility&lt;/code&gt; windowing mode.&lt;/p&gt;
&lt;h2 id="walkthrough-video"&gt;Walkthrough video&lt;/h2&gt;
&lt;p&gt;For a more interactive tour of the new features, watch the video below:&lt;/p&gt;
&lt;iframe src="https://www.youtube-nocookie.com/embed/utNtppEyK5Y" title="New features in JupyterLite 0.7💡" width="560" height="315" style="aspect-ratio: 560 / 315" loading="lazy" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen&gt;&lt;/iframe&gt;
&lt;h2 id="try-it-in-your-browser"&gt;Try it in your browser&lt;/h2&gt;
&lt;p&gt;If you would like to try the new release in your browser, click on the following link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://jupyter.org/try-jupyter/lab/"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/images/006-0_nbMbf0ppEOPuY0Ur.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;Thanks to &lt;a href="https://x.com/TechAtBloomberg"&gt;Bloomberg&lt;/a&gt; for funding the work on JupyterLite at &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt;, and for their ongoing support for JupyterLite in general.&lt;/p&gt;
&lt;p&gt;Many thanks to all the contributors to JupyterLite. The list below is based on GitHub usernames for the 0.7.0 release:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;New contributors: @rgaiacs, @tan-i-ham&lt;/li&gt;
&lt;li&gt;Returning contributors: @DerThorsten, @bollwyvl, @diegofcornejo, @ianthomas23, @jtpio, @krassowski, @martinRenou&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thank you to the extended group of contributors in Jupyter Frontends and related project in the Jupyter ecosystem 💛&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/jupyterlite-0-7-is-released/images/007-0_5lm4W0GV98Yy1q9l.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="JupyterLite"/><category term="releases"/><category term="WebAssembly"/></entry><entry><title>GNU Octave Meets JupyterLite: Compute Anywhere, Anytime!</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2025/gnu-octave-meets-jupyterlite-compute-anywhere-anytime/" rel="alternate"/><published>2025-10-16T15:04:00+00:00</published><updated>2025-10-16T15:04:00+00:00</updated><author><name>Isabel Paredes</name></author><id>tag:jasongrout.github.io,2025-10-16:/medium-archive/pelican/posts/2025/gnu-octave-meets-jupyterlite-compute-anywhere-anytime/</id><summary type="html">&lt;p&gt;We are thrilled to announce the newest member of our JupyterLite kernel ecosystem: Xeus-Octave. Xeus-Octave allows you to run GNU Octave…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/gnu-octave-meets-jupyterlite-compute-anywhere-anytime/images/001-1__Ha5vHmLH66mSH3WFg1fxg.jpg" alt="Octave-lite logo" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;We are thrilled to announce the newest member of our JupyterLite kernel ecosystem: &lt;strong&gt;Xeus-Octave&lt;/strong&gt;. Xeus-Octave allows you to run GNU Octave code directly on your browser. GNU Octave is a free and open-source Scientific Programming Language that can be used to run Matlab scripts. In this article, we present the challenges encountered when targeting WebAssembly, the current state of the Xeus-Octave kernel, and the future plans for expanding the GNU Octave ecosystem.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Earlier this year, we introduced the JupyterLite kernel for R, &lt;a href="/posts/2025/r-in-the-browser-announcing-our-webassembly/"&gt;&lt;strong&gt;Xeus-R-Lite&lt;/strong&gt;&lt;/a&gt;. Much like R, cross-compiling GNU Octave to WebAssembly required the same custom toolchain to enable the compilation of Fortran code, combining LLVM Flang and Emscripten.&lt;/p&gt;
&lt;p&gt;Similar to many other mathematically oriented language packages, GNU Octave requires a BLAS/LAPACK implementation. Fortunately, OpenBLAS and the Netlib implementations of BLAS/LAPACK had already been added to the emscripten-forge WebAssembly distribution. Initially, OpenBLAS was the preferred implementation, but for the successful compilation of Octave, Netlib LAPACK was selected as it presented fewer hurdles during the build process.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="cross-compilation-of-gnu-octave"&gt;Cross-Compilation of GNU Octave&lt;/h2&gt;
&lt;p&gt;One of the complications of cross-compiling Octave to WebAssembly, which had not been encountered with the R source code, was the extensive use of Fortran common symbols blocks in the internal libraries of Octave such as odepack.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;liboctave&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;external&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;odepack&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;slsode&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="o"&gt;-----------------------------------------------------------------------&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;The&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;following&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;internal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Common&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;contains&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;which&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;any&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;subroutine&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;but&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;whose&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;must&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="n"&gt;be&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;preserved&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;between&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;calls&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;routine&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;own&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;and&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;which&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;communicated&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;between&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;subroutines&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;The&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SLS001&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;declared&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;subroutines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SLSODE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SINTDY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SSTODE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SPREPJ&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SSOLSY&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Groups&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;replaced&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dummy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;arrays&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Common&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;declarations&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;routines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;those&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;used&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="o"&gt;-----------------------------------------------------------------------&lt;/span&gt;
&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="n"&gt;COMMON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;SLS001&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;CONIT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;CRATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;EL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ELCO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;HOLD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RMAX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TESCO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;CCMAX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;EL0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;H&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;HMIN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;HMXI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;HU&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;UROUND&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;INIT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MXSTEP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MXHNIL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NHNIL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NSLAST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NYH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;IALTH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;IPUP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LMAX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MEO&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NQNYH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NSLP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;ICF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;IERPJ&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;IERSL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;JCUR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;JSTART&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;KFLAG&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;LYH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LEWT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LACOR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LSAVF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LWM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LIWM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;METH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MITER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;MAXORD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MAXCOR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MSBP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MXNCF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NQ&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NFE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NJE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NQU&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Initially, it was not possible to cross-compile these common blocks to WebAssembly because the latest version of LLVM (v20 at the time of testing) did not support common symbol linkage.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;// Source: llvm/lib/MC/MCWasmStreamer.cpp&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;MCWasmStreamer::emitCommonSymbol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MCSymbol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;uint64_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;                                      &lt;/span&gt;&lt;span class="n"&gt;Align&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ByteAlignment&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;llvm_unreachable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Common symbols are not yet implemented for Wasm&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As a temporary solution, LLVM was patched with the help of &lt;a href="https://github.com/serge-sans-paille"&gt;Serge Guelton&lt;/a&gt; to simulate common symbols as weak symbols.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;void MCWasmStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
&lt;span class="w"&gt; &lt;/span&gt;                                     Align ByteAlignment) {
&lt;span class="gd"&gt;-  llvm_unreachable(&amp;quot;Common symbols are not yet implemented for Wasm&amp;quot;);&lt;/span&gt;
&lt;span class="gi"&gt;+  auto *Symbol = cast&amp;lt;mcsymbolwasm&amp;gt;(S);&lt;/span&gt;
&lt;span class="gi"&gt;+  getAssembler().registerSymbol(*Symbol);&lt;/span&gt;
&lt;span class="gi"&gt;+  Symbol-&amp;gt;setWeak(true);&lt;/span&gt;
&lt;span class="gi"&gt;+  Symbol-&amp;gt;setExternal(true);&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A proper solution to enable support of common symbols is currently in progress and will likely be included in the next release of LLVM v22 (see &lt;a href="https://github.com/llvm/llvm-project/pull/151478"&gt;llvm-project/pull/151478&lt;/a&gt;). For curious readers, the patched version of LLVM can be found &lt;a href="https://github.com/IsabelParedes/llvm-project/releases/download/v20.1.7_emscripten-wasm32/llvm_emscripten-wasm32-20.1.7-h2e33cc4_5.tar.bz2"&gt;here&lt;/a&gt; (linux only).&lt;/p&gt;
&lt;p&gt;In addition to the patches for LLVM, GNU Octave required a few minor modifications to target WebAssembly; mainly this entailed disabling the GUI functionalities and consolidating the Fortran function signatures and calling conventions. A full list of patches can be found in the &lt;a href="https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/octave/patches"&gt;recipe directory&lt;/a&gt; on emscripten-forge.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="xeus-octave"&gt;Xeus-Octave&lt;/h2&gt;
&lt;p&gt;Once GNU Octave had been successfully packaged for WebAssembly, bringing &lt;a href="https://github.com/jupyter-xeus/xeus-octave"&gt;Xeus-Octave&lt;/a&gt; to JupyterLite was a simple matter of adding a recipe to &lt;a href="https://github.com/emscripten-forge/recipes/"&gt;emscripten-forge&lt;/a&gt;!&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="A JupyterLite notebook demonstrating plots with Xeus-Octave" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/gnu-octave-meets-jupyterlite-compute-anywhere-anytime/images/002-1_lKsfXJGc7_tM1ONU5Ej0Ng.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;&lt;a href="https://jupyter-xeus.github.io/xeus-octave/lab/?path=xeus-octave-wasm.ipynb"&gt;&lt;strong&gt;Try Xeus-Octave in JupyterLite!&lt;/strong&gt;&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;hr&gt;
&lt;h2 id="future-work"&gt;Future Work&lt;/h2&gt;
&lt;p&gt;For our next steps, the team is planning on expanding the Octave ecosystem by adding Octave packages to both conda-forge and emscripten-forge. The packaging work will require defining a process where Octave packages can be installed in predetermined conda environments, perhaps with some minor modifications to the existing pkg utility.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="about-the-author"&gt;About the Author&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Isabel Paredes&lt;/strong&gt;, who led the charge on bringing GNU Octave to emscripten-forge, is a senior scientific software developer at QuantStack. Prior to working on this project, she focused on porting the R programming language and the Robot Operating System (ROS) framework to WebAssembly.&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;This project synthesizes work from many open-source contributors.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/emscripten-forge/recipes/"&gt;&lt;strong&gt;Emscripten-forge&lt;/strong&gt;&lt;/a&gt;, the distribution of conda packages for WebAssembly, was created by Thorsten Beier, who continues to lead the project. Many recipes were contributed by Isabel Paredes, Anutosh Bhat, Martin Renou, Ian Thomas, Wolf Vollprecht, and Johan Mabille.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jupyterlite.readthedocs.io/en/stable/?badge=latest"&gt;&lt;strong&gt;JupyterLite&lt;/strong&gt;&lt;/a&gt;, the Jupyter distribution that runs entirely in the web browser, was created by Jeremy Tuloup.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jupyter-xeus/xeus"&gt;&lt;strong&gt;Xeus&lt;/strong&gt;&lt;/a&gt;, the C++ library implementing the Jupyter kernel protocol, enabling a custom communication layer, and is foundational to kernels like xeus-r, xeus-python, running in JupyterLite, was created by Johan Mabille and is maintained by a broader team including Martin Renou, Sylvain Corlay, and Thorsten Beier, who worked on the first integration with JupyterLite.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jupyter-xeus/xeus-octave"&gt;&lt;strong&gt;Xeus-Octave&lt;/strong&gt;&lt;/a&gt;, the Xeus-based Jupyter kernel for GNU Octave, was created by Giulio Girardi and Antoine Prouvost.&lt;/li&gt;
&lt;/ul&gt;
</content><category term="JupyterLite"/><category term="kernels"/><category term="WebAssembly"/><category term="xeus"/></entry><entry><title>C++ in Jupyter — Interpreting C++ in the Web</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/" rel="alternate"/><published>2025-06-19T15:29:00+00:00</published><updated>2025-06-19T15:29:00+00:00</updated><author><name>Anutosh Bhat</name></author><id>tag:jasongrout.github.io,2025-06-19:/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/</id><summary type="html">&lt;p&gt;A Jupyter kernel for C++ running in the Web browser&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Scientists and engineers utilize programming languages not only to build software systems but also to drive interactive exploratory workflows. They leverage developer tools to explore and reason through problems effectively. This process involves executing code, examining visualizations, loading data, and running additional code. Rapid iteration is particularly crucial during the exploratory phase of any technical project.&lt;/p&gt;
&lt;p&gt;For this reason, the most popular tools for exploratory work tend to be interpreted languages, such as Python or R. The “Read-Eval-Print-Loop” (REPL) places the user at the center of these iterative workflows. While compiled languages such as C++ are essential for performance-sensitive applications, engineers accustomed to interactive tools often struggle in such environments.&lt;/p&gt;
&lt;p&gt;At CERN, the C++ programming language has been pivotal to their data analysis platform for particle physics, notably in the ROOT framework. ROOT is underpinned by the Cling C++ interpreter, which is built on the Clang and LLVM stack. The Cling interpreter, co-created by Vassil Vassilev and Axel Naumann in the 2010s, effectively turned C++ into an agile scientific scripting language!&lt;/p&gt;
&lt;p&gt;These interactive workflows are where the Jupyter stack shines compared to traditional IDEs. Indeed, the Jupyter project was designed with exploratory computing in mind. Crucially, it was built from the ground up to be language-agnostic, accommodating multiple programming languages seamlessly. In 2017, the Xeus-Cling Jupyter kernel &lt;a href="/posts/2017/interactive-workflows-for-c-with-jupyter/"&gt;was announced&lt;/a&gt;. Developed by Sylvain Corlay, Johan Mabille and Loic Gouarin, it integrated Cling in the Jupyter ecosystem, taking advantage of the rich features of Jupyter, such as rich mime type display and interactive widgets.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="An example C++ Jupyter notebook powered by the original Xeus-Cling kernel" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/001-0_WCAlh5DEa7IT27u3.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;An example C++ Jupyter notebook powered by the original Xeus-Cling kernel&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Packaging the Cling project proved challenging as it required patching the code base of Clang, and was not released as frequently as the LLVM stack, causing difficulties with rolling software distributions like conda-forge.&lt;/p&gt;
&lt;p&gt;In an effort led by Cling co-creator Vassil Vassilev, the &lt;a href="https://clang.llvm.org/docs/ClangRepl.html"&gt;Clang-Repl&lt;/a&gt; project was born, which consists in building the foundations for interactive C++ in the core of Clang. Clang-Repl has been undergoing active development for a few years now and a Jupyter kernel for Clang-Repl, &lt;a href="https://github.com/compiler-research/xeus-cpp"&gt;Xeus-Cpp&lt;/a&gt;, has also been developed, providing a similar set of features to Xeus-Cling.&lt;/p&gt;
&lt;p&gt;Building the new C++ kernel upon Xeus was crucial as it enabled the porting of the C++ kernel to the Web browser with JupyterLite.&lt;/p&gt;
&lt;h2 id="scaling-jupyter-with-jupyterlite"&gt;Scaling Jupyter with JupyterLite&lt;/h2&gt;
&lt;p&gt;The standard approach for Jupyter-based computing relies on providing each user with computing resources in the backend. Serving a few thousand end users necessitates substantial resources and complex deployment strategies.&lt;/p&gt;
&lt;p&gt;The JupyterLite project shifts this paradigm by running code directly in the user’s Web browser, by relying on a WebAssembly build of the kernel and required libraries. This eliminates the linear relationship between the number of users and the required resources.&lt;/p&gt;
&lt;p&gt;For instance, the NumPy.org website features a JupyterLite code console on its main page, offering a computational environment to thousands of monthly visitors without incurring any cloud costs. Similarly, the Capytale deployment of Jupyter, used in French high schools, operates on the same model. It accounts for over half a million registered users and hosts more than 200,000 user sessions weekly.&lt;/p&gt;
&lt;p&gt;In order to provide a broad range of packages and libraries for this new platform, the &lt;a href="https://jupyterlite.readthedocs.io/en/stable/"&gt;JupyterLite&lt;/a&gt; team at &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt; developed the &lt;a href="https://emscripten-forge.org/"&gt;Emscripten-forge&lt;/a&gt; distribution, utilizing the conda package manager for creating WebAssembly environments. Emscripten-forge comprises the main packages of the Python scientific computing ecosystem, as well as the R programming language, and several command-line applications powering the JupyterLite terminal.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Today, we are proud to announce that Xeus-Cpp and LLVM are available in emscripten-forge, effectively enabling interpreted C++ in the browser.&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The new C++ Jupyter kernel in action in JupyterLite." src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/002-0_XLTuIN3E7_64kPcO.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The new C++ Jupyter kernel in action in JupyterLite.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Feel free to try it out in your browser by clicking the link below!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://compiler-research.org/xeus-cpp-wasm/lab/index.html"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/003-1_gNg6NzVjE9nwIF9PSdt-jA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We now dive into the details on the internals of the WebAssembly build of Xeus-Cpp, and the key features of the project.&lt;/p&gt;
&lt;h2 id="walking-up-the-stack"&gt;Walking up the stack&lt;/h2&gt;
&lt;h3 id="emulated-just-in-time-compilation-and-webassembly"&gt;Emulated Just-in-Time Compilation and WebAssembly&lt;/h3&gt;
&lt;p&gt;A fundamental challenge inherent to the WebAssembly is that it operates in a &lt;strong&gt;sandboxed Harvard architecture&lt;/strong&gt;: code and data reside in completely distinct memory spaces. This makes conventional &lt;strong&gt;JIT compilation&lt;/strong&gt; unfeasible in the browser, as it prohibits dynamic modification of executable memory.&lt;/p&gt;
&lt;p&gt;The WebAssembly backend for Clang-Repl was introduced during the LLVM 17 development cycle, with the introduction of a WASM-specific &lt;strong&gt;IncrementalExecutor&lt;/strong&gt;, sidestepping the standard LLVM JIT approach used on native platforms. This new &lt;strong&gt;WasmIncrementalExecutor&lt;/strong&gt; class handled the WebAssembly-specific execution model as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The LLVM IR from the REPL’s Partial Translation Unit (PTU) is compiled into an object file.&lt;/li&gt;
&lt;li&gt;This object file is passed to wasm-ld with flags to generate a standalone WebAssembly module.&lt;/li&gt;
&lt;li&gt;The resulting .wasm module acts as a dynamically linked side module, designed to be loaded on top of a persistent main module at runtime.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These side modules, while similar to shared libraries, are treated as auxiliary WASM modules that are dynamically attached to the main application using Emscripten’s dlopen mechanism. They share memory with the main module and can resolve symbols defined in previous executions. As a result, each REPL input produces a corresponding .wasm module that is compiled, linked, and loaded at runtime, incrementally extending the current execution environment.&lt;/p&gt;
&lt;p&gt;Following the initial version in LLVM 17, the support for WebAssembly was incrementally consolidated by a series of pull requests addressing various issues and corner cases with respect to symbol duplication, memory corruption, and dynamic linking failures. We believe the version available today in LLVM 20 is a solid foundation to build upon.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/llvm/llvm-project/pull/86402"&gt;PR #86402 — Initial WebAssembly support for clang-repl&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/llvm/llvm-project/pull/113446"&gt;PR #113446 — Fix undefined lld::wasm::link symbol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/llvm/llvm-project/pull/116735"&gt;PR #116735 — Improve flags responsible for generating shared wasm binaries&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/llvm/llvm-project/pull/117978"&gt;PR #117978 — Fix generation of wasm binaries&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/llvm/llvm-project/pull/118107"&gt;PR #118107 — Remove redundant shared flag while running clang-repl in browser&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a deeper understanding of the constraints of the WebAssembly platform for JIT compilation, refer to the GSOC report: &lt;a href="https://compiler-research.org/assets/presentations/Anubhab_Ghosh_wasm_clangrepl.pdf"&gt;Anubhab Ghosh — WASM Clang-Repl&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="porting-xeus-cpp-to-emscripten-forge"&gt;Porting Xeus-Cpp to Emscripten-forge&lt;/h3&gt;
&lt;p&gt;In addition to challenges with emulating JIT compilation in WebAssembly, packaging Xeus-Cpp for emscripten-forge presented another challenge: managing shared objects within the initial WebAssembly executable, which are typically built statically for other xeus kernels. This issue was addressed in the following PRS:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/jupyterlite/xeus/pull/145"&gt;PR #145 — Handle .data file for kernels that require preloading&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jupyterlite/xeus/pull/146"&gt;PR #146 - Kernel shared libs handling&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As a result of this work, required side modules are now specified as metadata in the Jupyter kernelspec &lt;a href="https://github.com/compiler-research/xeus-cpp/blob/main/share/jupyter/kernels/xcpp23/wasm_kernel.json.in#L12"&gt;kernel.json&lt;/a&gt; file, enabling JupyterLite to automatically detect and utilize them.&lt;/p&gt;
&lt;h2 id="features"&gt;Features&lt;/h2&gt;
&lt;h3 id="inline-documentation"&gt;Inline documentation&lt;/h3&gt;
&lt;p&gt;To fully integrate C++ as a first-class citizen within the Jupyter ecosystem, supporting inline documentation is crucial. Similar to the Python kernel, utilizing the ? magic command should allow users to inspect the following type, perform a lookup in the available documentation, and display the relevant information.&lt;/p&gt;
&lt;p&gt;The C++ kernel comes equipped with a lookup file for the standard library, making it possible to execute queries like &lt;strong&gt;?std::vector&lt;/strong&gt; seamlessly.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Inline help feature in the C++ JupyterLite kernel" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/004-0_j7LvIkaUDbSD0urz.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Inline help feature in the C++ JupyterLite kernel&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This can be enabled for third-party libraries. Check out the &lt;a href="https://xeus-cpp.readthedocs.io/en/latest/inline_help.html"&gt;documentation&lt;/a&gt; to enable inline help for your package.&lt;/p&gt;
&lt;p&gt;This feature, inherited from the Xeus-Cling project, was initially created by &lt;strong&gt;Loic Gouarin&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id="rich-display"&gt;Rich display&lt;/h3&gt;
&lt;p&gt;One of the core benefits of integrating C++ into the Jupyter ecosystem is the ability to leverage Jupyter’s rich MIME display system. Rather than limiting output to plain text, Xeus-Cpp allows you to render rich content like &lt;strong&gt;images, HTML tables, LaTeX&lt;/strong&gt;, or even &lt;strong&gt;custom visualizations&lt;/strong&gt;, all directly from C++.&lt;/p&gt;
&lt;p&gt;This is made possible by the function xcpp::display, which sends a &lt;em&gt;MIME bundle&lt;/em&gt; to the frontend. Each bundle can include multiple representations of the same object, such as &lt;strong&gt;text/plain&lt;/strong&gt;, &lt;strong&gt;image/png&lt;/strong&gt;, or even custom mime types.&lt;/p&gt;
&lt;p&gt;This is illustrated in the following example:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Rich mime type rendering feature of the Xeus-Cpp kernel" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/005-0_icsXc3d2vC5OTF1K.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Rich mime type rendering feature of the Xeus-Cpp kernel&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A custom renderer for any given type can be defined by defining the &lt;strong&gt;mime_bundle_repr&lt;/strong&gt; function in the corresponding namespace, which is then picked up by Xeus-Cpp’s display system through Argument-Dependent Lookup (ADL). A large collection of mime types are supported by the JupyterLab frontend, which can also be extended with plugins to support custom mime types.&lt;/p&gt;
&lt;h3 id="advanced-graphics"&gt;Advanced Graphics&lt;/h3&gt;
&lt;p&gt;Another compelling example leveraging the rich rendering capabilities, is to combine it with frameworks such as SDL for rich graphic content. Emscripten has built-in support for SDL (enabled with the &lt;strong&gt;-s USE_SDL=2&lt;/strong&gt; compilation flag), which allows us to leverage its power in C++ notebooks.&lt;/p&gt;
&lt;p&gt;To illustrate this, we ported &lt;strong&gt;Kevin Beason’s legendary&lt;/strong&gt; &lt;a href="https://www.kevinbeason.com/smallpt/"&gt;&lt;strong&gt;smallpt&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;global illumination renderer&lt;/strong&gt; (a path tracer in 99 lines of C++) into a C++ notebook. The scene is rendered using SDL onto an in-memory canvas, and the resulting image is captured and displayed with &lt;strong&gt;xcpp::display&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This setup showcases the seamless integration of SDL and the Jupyter display system:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use SDL for &lt;strong&gt;real-time or offscreen rendering&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Then pipe the result through xcpp::display(…) as a PNG or pixel buffer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://github.com/compiler-research/xeus-cpp/pull/299"&gt;PR #299&lt;/a&gt; added an example notebook supporting smallpt with SDL-based rendering. Feel free to access the notebook through our &lt;a href="https://compiler-research.org/xeus-cpp/lab/index.html"&gt;lite link&lt;/a&gt; . Since the number of samples per pixel (spp) directly correlates with how long the process runs (approximately 2 minutes in our case), we’ve included debug logs to keep users informed during rendering, so they aren’t left wondering about the progress.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Smallpt tiny raytracer in action in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/006-0_OrN0HWXlcMjemfj6.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Smallpt tiny raytracer in action in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This approach paves the way for interactive C++ graphics demos, ray tracing notebooks, and even the prototyping of browser-based video games from within WebAssembly C++ notebooks.&lt;/p&gt;
&lt;h3 id="loading-third-party-libraries"&gt;Loading Third-Party Libraries&lt;/h3&gt;
&lt;p&gt;For a user’s perspective, a key difference between a Jupyter kernel for a compiled language like C++ and e.g. Python concerns how third-party libraries can be utilized. In Python, one merely needs to import the relevant installed packages, while in the case of C++, the relevant compiled libraries must be loaded in addition to including the corresponding headers.&lt;/p&gt;
&lt;p&gt;Thankfully, Clang-Repl provides the &lt;strong&gt;LoadDynamicLibrary&lt;/strong&gt; to dynamically load shared objects, which was adapted to the WebAssembly based in &lt;a href="https://github.com/llvm/llvm-project/pull/133037"&gt;LLVM PR #133037&lt;/a&gt;. Instead of relying directly on raw dlopen calls, this function ensures that memory layout, symbol resolution, and constructor invocation are handled correctly — even in a WebAssembly environment.&lt;/p&gt;
&lt;p&gt;Building on top of this, the CppInterOp project made these features available via a high-level C++ API.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Showcasing the dynamic loading of shared objects with CppInterOp" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/007-0_O4xsKujuUwCvMVSq.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Showcasing the dynamic loading of shared objects with CppInterOp&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Library authors interested in facilitating the use of their package with the Jupyter kernel can include the calls to CppInterop’s &lt;strong&gt;LoadLibrary&lt;/strong&gt; can simply be included in user-facing headers.&lt;/p&gt;
&lt;p&gt;This has been done for example, in the Symengine library.&lt;/p&gt;
&lt;h3 id="symbolic-computing-with-symengine"&gt;Symbolic Computing with Symengine&lt;/h3&gt;
&lt;p&gt;A compelling example of the Jupyter rich display system’s advanced capabilities with Xeus-Cpp is the &lt;a href="https://github.com/symengine/symengine"&gt;&lt;strong&gt;SymEngine&lt;/strong&gt;&lt;/a&gt; package, a powerful C++ library for symbolic computing.&lt;/p&gt;
&lt;p&gt;Originally designed as a backend for symbolic Python libraries like SymPy, SymEngine offers native support for expression trees, calculus and Latex/MathJax rendering of mathematical expressions. We have integrated SymEngine into the emscripten-forge distribution, making it readily available for use. Once installed, it works seamlessly with Xeus-Cpp, requiring no additional setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SymEngine expressions can be rendered via xcpp::display()&lt;/strong&gt;, which produces LaTeX-formatted expressions and delegates their rendering to &lt;strong&gt;MathJax&lt;/strong&gt; in the frontend.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Rich mime type rendering used with Symengine" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/008-0_7E9I9OxKKGqDK_Og.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Rich mime type rendering used with Symengine&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="array-based-computing"&gt;Array-based Computing&lt;/h3&gt;
&lt;p&gt;Jupyter notebooks are particularly popular among data scientists, students, and practitioners of scientific computing. &lt;strong&gt;Array-based computing&lt;/strong&gt; is at the center of the practice, be it in Python with NumPy, in R, GNU Octave, or Julia.&lt;/p&gt;
&lt;p&gt;A framework for array-based computing is C++ is &lt;strong&gt;Xtensor&lt;/strong&gt;. Xtensor’s syntax closely mirrors that of NumPy, supporting features like array broadcasting, lazy evaluation, and element-wise operations with an idiomatic C++ API. Using Xtensor in combination with the C++ Jupyter kernel provides a similar user experience to that of NumPy with the Python Jupyter kernel.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="JupyterLite used in combination with Xtensor, utilizing rich display for tables." src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/009-0_jbBM7zjHznUTxDmp.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLite used in combination with Xtensor, utilizing rich display for tables.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Built on top of Xtensor, &lt;strong&gt;Xtensor-BLAS&lt;/strong&gt; brings the &lt;strong&gt;high-level syntax of Xtensor&lt;/strong&gt; with the &lt;strong&gt;performance of OpenBLAS&lt;/strong&gt;. It provides convenient, NumPy-style access to BLAS and LAPACK routines making operations like matrix inversion or system solving easy to express and execute.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="JupyterLite used in combination with Xtensor-BLAS" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/010-0_Y0RXrB1PrRoP7fQ3.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLite used in combination with Xtensor-BLAS&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;To use these libraries inside a JupyterLite notebook, all you need is to include Xtensor-BLAS in your environment (available via emscripten-forge). Under the hood, Xtensor-BLAS dynamically loads &lt;strong&gt;libopenblas&lt;/strong&gt;, which is bundled automatically as a dependency.&lt;/p&gt;
&lt;h3 id="simd-acceleration"&gt;SIMD Acceleration&lt;/h3&gt;
&lt;p&gt;We can take a step further with &lt;strong&gt;SIMD (Single Instruction, Multiple Data)&lt;/strong&gt; acceleration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using raw WebAssembly intrinsics :&lt;/strong&gt; WebAssembly includes 128-bit SIMD instructions, which are provided in Clang’s &lt;strong&gt;&amp;lt;wasm_simd128.h&amp;gt;&lt;/strong&gt; header. They can be used to perform vectorized operations directly.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Xeus-Cpp kernel showcasing the use of SIMD instructions" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/011-0_PyE8StfrE9f5s7g8.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Xeus-Cpp kernel showcasing the use of SIMD instructions&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Using Xsimd :&lt;/strong&gt; Here’s an improved version of your text with better flow, clarity, and conciseness.&lt;/p&gt;
&lt;p&gt;Rewriting specialized vectorized routines for WebAssembly can be cumbersome. This is where frameworks like &lt;a href="https://github.com/xtensor-stack/xsimd"&gt;&lt;strong&gt;Xsimd&lt;/strong&gt;&lt;/a&gt; come in. It provides a high-level SIMD API in C++ that abstracts platform-specific SIMD instructions. With Xsimd, you can efficiently operate on batches of numbers using familiar arithmetic operators or mathematical functions, while benefiting from optimized performance under the hood.&lt;/p&gt;
&lt;p&gt;Xsimd powers SIMD acceleration in Xtensor and is also used in many other projects, including Apache Arrow, Firefox, Velox, Pythran, and Krita. Here’s how the same example would look when when using Xsimd instead of raw intrinsics:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Xeus-Cpp kernel showcasing the Xsimd library" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/012-0_cmTseJsCeHr02SRp.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Xeus-Cpp kernel showcasing the Xsimd library&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id="magic-commands"&gt;Magic Commands&lt;/h3&gt;
&lt;p&gt;In addition to interpreting standard C++ code, Xeus-Cpp also supports &lt;strong&gt;magic commands&lt;/strong&gt;, special notebook commands prefixed with % or %% that allow for extended functionality not defined by the C++ language itself.&lt;/p&gt;
&lt;p&gt;These magics let you interact with the runtime environment, manage files, or perform meta-operations, all from within a code cell. The following magics are available:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;%file :&lt;/strong&gt; The %file magic enables file creation and editing directly from a code cell. You can append to an existing file using the &lt;strong&gt;-a&lt;/strong&gt; flag&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
&lt;img alt="Using the %file magics in Xeus-Cpp-lite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/013-0_-sOa-yVDMKuTdJ6R.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Using the %file magics in Xeus-Cpp-lite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;%timeit :&lt;/strong&gt; A %timeit magic has also been prototyped via &lt;a href="https://github.com/compiler-research/xeus-cpp/pull/289"&gt;PR #289&lt;/a&gt; by &lt;a href="https://github.com/kr-2003"&gt;@kr-2003&lt;/a&gt;, enabling performance measurement for expressions in the notebook.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, due to the lack of &lt;strong&gt;last value printing support&lt;/strong&gt; in Clang-Repl, this feature currently relies on a workaround and hasn’t yet been merged. Once upstream support is in place, %timeit will be integrated cleanly and available out of the box.&lt;/p&gt;
&lt;p&gt;Here’s a preview of the %timeit magic in action:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Using the %timeit magics in Xeus-Cpp-lite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/014-1_TxNBjy8ovN1LbrQ1UYejAQ.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Using the %timeit magics in Xeus-Cpp-lite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Magic commands open the door to a more expressive and interactive notebook experience for C++. While support is currently limited to a few core magics, this is just the beginning — with more capabilities and enhancements expected in the near future.&lt;/p&gt;
&lt;h3 id="interactive-widgets"&gt;Interactive Widgets&lt;/h3&gt;
&lt;p&gt;Beyond rich mime type rendering and inline documentation, the Jupyter widgets system allows users to create interactive components in the Jupyter notebook, leveraging by-directional communication with the kernel for more interactivity.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/jupyter-xeus/xwidgets"&gt;&lt;strong&gt;xwidgets&lt;/strong&gt;&lt;/a&gt; package is a C++ implementation of the Jupyter widget protocol, comprising an implementation of all the core Jupyter widgets, and which underlies other interactive visualization libraries like &lt;a href="https://github.com/jupyter-xeus/xleaflet"&gt;&lt;strong&gt;xleaflet&lt;/strong&gt;&lt;/a&gt; or &lt;a href="https://github.com/jupyter-xeus/xcanvas"&gt;&lt;strong&gt;xcanvas&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here are a couple examples demonstrating interactive widgets through xwidgets &amp;amp; xcanvas with Xeus-Cpp-lite.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Displaying a slider using xwidgets" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/015-1_uJRTSmvJ8OgZbDLliI5BkQ.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Displaying a slider using xwidgets&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img alt="Displaying a canvas through xcanvas" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/c-in-jupyter-interpreting-c-in-the-web/images/016-1_w-SeiUeAmHPcMeIY84tb0w.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Displaying a canvas through xcanvas&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;If you inspect the codebase of xwidgets or xcanvas, you will notice that it contains very little code. All that is required on the C++ end is a declaration of the attributes that should be synchronized with the frontend, and serialization methods for complex data types.&lt;/p&gt;
&lt;p&gt;Most of the programmatic logic for Jupyter interactive widgets lies in the frontend implementation. The consequence for the C++ Jupyter kernel is that with seemingly little implementation effort, we could enable an entire ecosystem of widget libraries, covering a large range of use cases. Interactive widgets for 2-D plotting (&lt;strong&gt;bqplot&lt;/strong&gt;, &lt;strong&gt;plotly&lt;/strong&gt;) and 3-D plotting (&lt;strong&gt;ipyvolume&lt;/strong&gt;), GIS (&lt;strong&gt;ipyleaflet&lt;/strong&gt;), efficient rendering of meshes (&lt;strong&gt;ipygany&lt;/strong&gt;), graph visualization (&lt;strong&gt;ipycytoscape&lt;/strong&gt;), and many more could be almost automatically connected to the C++ world.&lt;/p&gt;
&lt;h2 id="how-to-deploy-jupyterlite-with-xeus-cpp"&gt;How to deploy JupyterLite with Xeus-Cpp&lt;/h2&gt;
&lt;p&gt;The GitHub repository &lt;a href="https://github.com/jupyterlite/xeus-lite-demo"&gt;https://github.com/jupyterlite/xeus-lite-demo&lt;/a&gt; is a template for creating a JupyterLite deployment on GitHub pages that includes the packages specified in a conda environment.&lt;/p&gt;
&lt;p&gt;The process is as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new repository from the GitHub template.&lt;/li&gt;
&lt;li&gt;Enable the deployment on GitHub pages from a GitHub action, as shown in the README.&lt;/li&gt;
&lt;li&gt;Edit the environment file to include the desired packages.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example, to deploy an C++ kernel with Symengine &amp;amp; Xtensor-blas installed, the environment.yml file would contain the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;xeus-cpp&lt;/span&gt;
&lt;span class="nt"&gt;channels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;https://repo.prefix.dev/emscripten-forge-dev&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;conda-forge&lt;/span&gt;
&lt;span class="nt"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;xeus-cpp&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;symengine&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;xtensor-blas&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The deployment linked at the beginning of this article was created with this template.&lt;/p&gt;
&lt;h2 id="future-work"&gt;Future work&lt;/h2&gt;
&lt;p&gt;The journey of interactive C++ in Jupyter, both natively and in the browser, is still evolving. While Xeus-Cpp already offer powerful foundations, several exciting developments are underway that will further expand their capabilities across platforms&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Debugger Support:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Currently, only a few Jupyter kernels like Xeus-Python offer full integration with the Jupyter Debug Protocol to enable the Jupyterlab debugger. We’re working to bring that experience to C++ as well.&lt;/p&gt;
&lt;p&gt;This summer, thanks to &lt;a href="https://summerofcode.withgoogle.com/programs/2025/projects/uEB2as1n"&gt;Google Summer of Code 2025&lt;/a&gt;, &lt;strong&gt;Abhinav Kumar&lt;/strong&gt; will be implementing native debugging support in Xeus-Cpp.The approach is based on using &lt;strong&gt;LLDB&lt;/strong&gt; and its &lt;strong&gt;Debug Adapter Protocol (lldb-dap)&lt;/strong&gt;. Modeled after Xeus-Python, it leverages LLDB’s Clang and JIT debugging capabilities to enable &lt;strong&gt;breakpoints&lt;/strong&gt;, &lt;strong&gt;variable inspection&lt;/strong&gt;, and &lt;strong&gt;step-through execution&lt;/strong&gt; directly within the JupyterLab debugger interface.&lt;/p&gt;
&lt;p&gt;We already have a proof-of-concept demonstrating that debugging C++ in Jupyter is possible. You can track this effort here&lt;a href="https://github.com/compiler-research/xeus-cpp/issues/282"&gt;: xeus-cpp issue #28&lt;/a&gt;2.&lt;/p&gt;
&lt;p&gt;In the longer term, we aim to explore extending debugging to the browser through Xeus-Cpp.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cuda Support in Xeus-Cpp:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;CUDA support in Clang-Repl was broken by the time LLVM 20 was released, but that changed with this upstream patch:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;LLVM PR: &lt;a href="https://github.com/llvm/llvm-project/pull/136404"&gt;#136404 — Enable CUDA support in clang-rep&lt;/a&gt;l&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We’re now preparing to bring CUDA support directly to Xeus-Cpp, enabling GPU programming from a Jupyter notebook. Early planning is underway:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GitHub issue: &lt;a href="https://github.com/compiler-research/xeus-cpp/issues/300"&gt;#300 — CUDA REPL support in xeus-cpp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Last Value Printing:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;cling&lt;/strong&gt;, a widely appreciated feature is &lt;em&gt;last value printing&lt;/em&gt;, simply writing a variable at the end of a cell automatically displays its value, without needing any manual printing. This behavior naturally carried over to &lt;strong&gt;xeus-cling&lt;/strong&gt;, making interactive exploration even smoother.&lt;/p&gt;
&lt;p&gt;This feature stands almost done in Clang-Repl:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;LLVM PR: &lt;a href="https://github.com/llvm/llvm-project/pull/84769"&gt;#84769 — Last Value Printing in clang-repl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once merged, this will be integrated into Xeus-Cpp, enabling seamless REPL experience for C++ users.&lt;/p&gt;
&lt;h2 id="how-to-contribute"&gt;How to contribute?&lt;/h2&gt;
&lt;p&gt;Whether you’re a developer, package maintainer, educator, or simply curious about C++ in the browser, &lt;strong&gt;contributions are always welcome&lt;/strong&gt;!&lt;/p&gt;
&lt;h3 id="packaging-for-the-browser"&gt;Packaging for the Browser&lt;/h3&gt;
&lt;p&gt;Many of the capabilities in xeus-cpp-lite rely on packages built for the WebAssembly platform via &lt;strong&gt;emscripten-forge&lt;/strong&gt;. If you’re interested in porting a library or creating a new recipe, please visit &lt;a href="https://emscripten-forge.org/"&gt;emscripten-forge.org&lt;/a&gt; for detailed guidelines and examples.&lt;/p&gt;
&lt;p&gt;PRs and discussions are welcome at &lt;a href="https://github.com/emscripten-forge"&gt;github.com/emscripten-forge&lt;/a&gt;, especially if you’re looking to bring more numerical, graphical, or scientific libraries into the browser.&lt;/p&gt;
&lt;h3 id="improving-xeus-cpp-cppinterop-and-clang-repl"&gt;Improving Xeus-Cpp, CppInterOp and Clang-Repl&lt;/h3&gt;
&lt;p&gt;We welcome contributions to the broader &lt;strong&gt;xeus&lt;/strong&gt; project, which is part of the &lt;a href="https://jupyter.org/"&gt;Project Jupyter&lt;/a&gt; ecosystem. Xeus-Cpp in particular is actively seeking contributors, whether to improve kernel behavior, expand feature support, or explore new magic commands and UI integrations.&lt;/p&gt;
&lt;p&gt;On the LLVM side, the &lt;strong&gt;Clang-Repl&lt;/strong&gt; component is still under active development and can greatly benefit from community contributions, particularly around WebAssembly backend improvements and incremental execution features.&lt;/p&gt;
&lt;h3 id="areas-of-need-opportunities-for-collaboration"&gt;Areas of Need &amp;amp; Opportunities for Collaboration&lt;/h3&gt;
&lt;p&gt;In addition to code contributions, we are seeking funding opportunities to advance the project. We’ve identified several areas where focused effort could significantly enhance the ecosystem, and we warmly welcome collaborators or potential funding partners interested in helping us move these efforts forward, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Integration testing&lt;/strong&gt;: LLVM currently lacks tests for Clang-Repl + WebAssembly. Establishing a reliable test harness in this area is both challenging and critical.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interactive plotting&lt;/strong&gt;: A robust plotting library or plugin for Xeus-Cpp would make the kernel far more expressive for teaching, data exploration, and scientific computing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plugin system for magics&lt;/strong&gt;: Further decoupling kernel extensions would simplify development and allow community-driven growth. A concrete description of this project is framed on &lt;a href="https://hepsoftwarefoundation.org/gsoc/2025/proposal_XeusCpp-Plugins.html"&gt;CERN’s website&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you or your organization shares the vision of making modern C++ more accessible, especially in-browser, we’d love to hear from you.&lt;/p&gt;
&lt;h2 id="about-the-authors"&gt;About the Authors&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/anutosh491"&gt;&lt;strong&gt;Anutosh Bhat&lt;/strong&gt;&lt;/a&gt; is a scientific software engineer at &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt;. His contributions range from the core of LLVM and Xeus, to their packaging for the Emscripten-forge software distribution. In the course of this endeavor, Anutosh was granted commit rights to the LLVM project.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/vgvassilev"&gt;&lt;strong&gt;Vassil Vassilev&lt;/strong&gt;&lt;/a&gt; is a Research Software Consultant with Princeton at &lt;a href="https://home.cern/"&gt;CERN&lt;/a&gt;. As the co-creator of Cling and the lead developer of the Clang-Repl and CppInterOp projects, he has spearheaded the development of interpreted C++ for over a decade.&lt;/p&gt;
&lt;h2 id="acknowledgements"&gt;Acknowledgements&lt;/h2&gt;
&lt;p&gt;The work by &lt;strong&gt;Vassil Vassilev&lt;/strong&gt; on this project is done in the context of the &lt;a href="https://compiler-research.org/"&gt;Compiler Research&lt;/a&gt; group, funded by the National Science Foundation grant OAC-2311471.&lt;/p&gt;
&lt;p&gt;The work by &lt;strong&gt;Anutosh Bhat&lt;/strong&gt; on this project is funded by &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt;, as part of a broader initiative to enable the data science ecosystem within the Web browser.&lt;/p&gt;
&lt;p&gt;Work on prototyping the WebAssembly infrastructure for Clang-Repl was done by &lt;strong&gt;Anubhab Ghosh&lt;/strong&gt;, supported through &lt;a href="https://summerofcode.withgoogle.com/archive/2023/projects/X0cFgJkY"&gt;Google Summer of Code 2023&lt;/a&gt; via the LLVM mentoring organization.&lt;/p&gt;
&lt;p&gt;A significant portion of the Xeus-Cpp codebase was inherited from the Xeus-Cling project and adapted for the Clang-Repl interpreter. This includes work by &lt;strong&gt;Sylvain Corlay&lt;/strong&gt;, &lt;strong&gt;Johan Mabille&lt;/strong&gt;, &lt;strong&gt;Loic Gouarin&lt;/strong&gt;, and &lt;strong&gt;Martin Renou&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;We are grateful to &lt;strong&gt;Thorsten Beier&lt;/strong&gt;, the creator and lead developer of the emscripten-forge software distribution, for his support in packaging LLVM and Xeus-Cpp.&lt;/p&gt;
&lt;p&gt;We extend our gratitude to &lt;strong&gt;Martin Renou&lt;/strong&gt; and &lt;strong&gt;Anastasiia Sliusar&lt;/strong&gt; for devising the processing of conda packages in the frontend, which underlies the support of third-party libraries in WebAssembly environments used by Xeus-Cpp and xeus-r. We are grateful to &lt;strong&gt;Johan Mabille&lt;/strong&gt; for creating xeus and for his code reviews within the xeus stack. We also thank &lt;strong&gt;Jeremy Tuloup&lt;/strong&gt; for creating JupyterLite.&lt;/p&gt;
&lt;p&gt;We are grateful to &lt;strong&gt;Matthew Barton, Tharun Anandh &amp;amp; Abhinav Kumar&lt;/strong&gt; for their numerous and significant contributions to the Xeus-Cpp project.&lt;/p&gt;
&lt;p&gt;Finally, we are immensely grateful to the authors and maintainers of Emscripten and LLVM for building such remarkable technologies and for their engagement and support during our numerous interactions on GitHub.&lt;/p&gt;
</content><category term="C++"/><category term="WebAssembly"/></entry><entry><title>R in the Browser: Announcing Our WebAssembly Distribution</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/" rel="alternate"/><published>2025-02-28T08:31:00+00:00</published><updated>2025-04-25T07:39:00+00:00</updated><author><name>Isabel Paredes</name></author><id>tag:jasongrout.github.io,2025-02-28:/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/</id><summary type="html">&lt;p&gt;R is now available in emscripten-forge, enabling the Xeus-R kernel in JupyterLite&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/images/001-1_y4YmV8C0L1CkE1Q5JRJLkg.webp" alt="Banner with gradient background and R-lite logo" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;In the past few months, &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt; has received funding from the &lt;a href="https://www.gatesfoundation.org/"&gt;&lt;strong&gt;Bill &amp;amp; Melinda Gates Foundation&lt;/strong&gt;&lt;/a&gt; through a grant to &lt;a href="https://coursekata.org/"&gt;CourseKata&lt;/a&gt; to develop support for the R programming language in &lt;a href="https://jupyterlite.readthedocs.io/en/stable/"&gt;JupyterLite&lt;/a&gt; and the &lt;a href="https://emscripten-forge.org/"&gt;Emscripten-forge&lt;/a&gt; distribution for WebAssembly.&lt;/p&gt;
&lt;p&gt;Today, we are thrilled to announce the availability of the R programming language in the Emscripten-Forge distribution for WebAssembly, which enables R workflows in JupyterLite through the Xeus-R Jupyter kernel.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Screenshot of JupyterLite with an R Jupyter notebook in use" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/images/002-0_9D50aOr7jhxFnjzo.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLite with an R Jupyter notebook in use&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;To experience R in JupyterLite, simply click on the link below:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://isabelparedes.github.io/xeus-r-demo/lab/?path=demo.ipynb"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/images/003-0_qOr5KTmon-fiZ37l.webp" alt="Button to access JupyterLite" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this article, we present the details of our efforts to enable R workflows in JupyterLite. We cover the challenges encountered in packaging R and its dependencies for this platform, the solutions we implemented, and the process of handling R mamba packages on the frontend.&lt;/p&gt;
&lt;h2 id="why-webassembly-scaling-scientific-computing-workflows-in-jupyter-to-millions-of-users"&gt;&lt;strong&gt;Why WebAssembly? Scaling scientific computing workflows in Jupyter to millions of users&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The main challenge in scaling Jupyter deployments lies in providing a live computing environment on the server side for each user session.&lt;/p&gt;
&lt;p&gt;While Kubernetes-based JupyterHub deployments have been successfully implemented at a university scale (such as the UC Berkeley Data 8 class, or the JupyterHub deployment of Université Paris Saclay), they demand substantial computing resources and a skilled DevOps team to achieve and maintain this level of scalability.&lt;/p&gt;
&lt;p&gt;In contrast, &lt;a href="https://jupyterlite.readthedocs.io/"&gt;&lt;strong&gt;JupyterLite&lt;/strong&gt;&lt;/a&gt; represents a fundamentally different paradigm. As a browser-based distribution of Jupyter, it runs language kernels directly in the browser, enabling significantly greater scalability and ease of deployment. Notable JupyterLite-based applications include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A JupyterLite console integrated into &lt;a href="http://numpy.org"&gt;&lt;strong&gt;NumPy&lt;/strong&gt;&lt;/a&gt;’s front page, providing immediate access to NumPy functionality without requiring installation.&lt;/li&gt;
&lt;li&gt;A similar console application on &lt;a href="https://live.sympy.org/"&gt;&lt;strong&gt;SymPy&lt;/strong&gt;&lt;/a&gt;’s project page, fully hosted statically.&lt;/li&gt;
&lt;li&gt;The official &lt;a href="https://jupyter.org/try"&gt;&lt;strong&gt;Jupyter&lt;/strong&gt;&lt;/a&gt; website¹.&lt;/li&gt;
&lt;li&gt;The examples in &lt;a href="https://scikit-learn.org/stable/lite/lab/index.html"&gt;&lt;strong&gt;Scikit-Learn&lt;/strong&gt;&lt;/a&gt;’s documentation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These examples illustrate how WebAssembly can be transformative by providing ready-to-use computing environments for scientific workflows, in documentation, blog posts, and scientific communications. The WebAssembly environments are made available to the hundreds of thousands of monthly visitors of these websites without requiring any computing resources on the backend.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://NumPy.org"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/images/004-0_-531naCHla3pK14Q.jpg" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://live.sympy.org/"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/images/005-0_vk6bu54D0C7y4k9b.jpg" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure&gt;
&lt;a href="https://jupyter.org/try"&gt;&lt;img alt="JupyterLite deployments displayed on the NumPy, SymPy, and Jupyter websites" src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/images/006-0_SKvqpunHcz3i2mBG.webp" loading="lazy" data-body-image=""&gt;&lt;/a&gt;
&lt;figcaption&gt;JupyterLite deployments displayed on the NumPy, SymPy, and Jupyter websites&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;[1] Even though it powers the deployment of Jupyter on the main Jupyter website, JupyterLite is not an officially sanctioned Jupyter project.&lt;/p&gt;
&lt;h2 id="beyond-python-enabling-r-in-the-browser-and-more"&gt;&lt;strong&gt;Beyond Python, enabling R in the browser, and more&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;While the initial focus of the JupyterLite team has been on the Python programming language, the JupyterLite infrastructure was designed to be language-agnostic from the outset. The same principle applies to the package management stack we have been contributing to over the past few years, namely, &lt;a href="https://github.com/mamba-org/mamba"&gt;mamba&lt;/a&gt; and &lt;a href="https://conda-forge.org/"&gt;conda-forge&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When we began targeting the WebAssembly platform, we chose to build our efforts on the mamba and conda-forge ecosystem. This decision allowed us to provide customizable environments for WebAssembly and expand beyond Python. This enabled applications such as the &lt;a href="https://github.com/jupyterlite/terminal"&gt;&lt;strong&gt;JupyterLite terminal&lt;/strong&gt;&lt;/a&gt;, created by Ian Thomas, which comprises a bash-like shell written in TypeScript called &lt;a href="https://github.com/jupyterlite/cockle"&gt;Cockle&lt;/a&gt;, and WebAssembly builds of native shell commands such as cat, grep, ls, and vim. You can read the &lt;a href="/posts/2024/jupyterlite-terminal/"&gt;&lt;strong&gt;earlier&lt;/strong&gt; &lt;strong&gt;announcement&lt;/strong&gt;&lt;/a&gt; introducing the JupyterLite terminal.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Today, we are excited to reveal the availability of R in emscripten-forge, enabling Jupyter kernels such as Xeus-R to be used in JupyterLite.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With the addition of R, emscripten-forge now provides a unified packaging solution for Python, R, and terminal applications for WebAssembly. This covers the scopes of &lt;a href="https://pyodide.org/"&gt;&lt;strong&gt;Pyodide&lt;/strong&gt;&lt;/a&gt; (a Python distribution for WebAssembly), &lt;a href="https://docs.r-wasm.org/"&gt;&lt;strong&gt;WebR&lt;/strong&gt;&lt;/a&gt; (an R distribution for WebAssembly), and &lt;a href="https://sandbox.bio/"&gt;&lt;strong&gt;Sandbox.bio&lt;/strong&gt;&lt;/a&gt; (a shell emulator with WebAssembly commands).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="building-r-for-emscripten-forge"&gt;&lt;strong&gt;Building R for Emscripten-forge&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Emscripten-forge is a GitHub organization containing recipes to build &lt;strong&gt;conda packages&lt;/strong&gt; for the emscripten-wasm32 platform; it is also the first distribution of conda packages targeting this platform. It is built upon a modernized stack, leveraging &lt;strong&gt;rattler-build&lt;/strong&gt; (the successor to the conda-build package builder) and &lt;strong&gt;mamba&lt;/strong&gt;. The emscripten-forge project, which was created and is still led by Thorsten Beier, is now a team effort covering a broad range of packages.&lt;/p&gt;
&lt;p&gt;In order to build R with emscripten-forge, we first required a toolchain capable of converting Fortran and C/C++ code into WebAssembly. Since R relies on BLAS and LAPACK (which are written in Fortran) and many essential R packages wrap native libraries that use Fortran, this conversion capability was crucial.&lt;/p&gt;
&lt;h2 id="fortran"&gt;&lt;strong&gt;Fortran&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;By default, the emscripten-forge toolchain can cross-compile any C/C++ packages into WebAssembly; however, the first challenge in building the R stack was expanding the toolchain to also compile Fortran code. The two compilers that we considered for this task are LFortran and Flang.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://lfortran.org/"&gt;&lt;strong&gt;LFortran&lt;/strong&gt;&lt;/a&gt; is a compiler built on top of LLVM and designed from the ground up as a cross-compiler. Despite its potential, LFortran is still in its early stages compared to Flang and does not yet fully support all Fortran features.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flang.llvm.org/"&gt;&lt;strong&gt;LLVM Flang&lt;/strong&gt;&lt;/a&gt; is the Fortran compiler of the LLVM project. Unfortunately, it does not support cross-compilation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Working with Serge Guelton and Kerim Birgi, we initially experimented with the LFortran compiler and contributed to addressing issues encountered when building Netlib &lt;a href="https://github.com/Reference-LAPACK/lapack"&gt;LAPACK&lt;/a&gt;. The BLAS implementation from this package served as a valuable testing ground since BLAS is one of the core dependencies for R.&lt;/p&gt;
&lt;p&gt;After careful consideration, we found that Flang, with its ability to compile a wider variety of Fortran projects, brought us closer to building the Fortran components of R to WebAssembly. George Stagg, the main developer of the WebR project, has written a detailed &lt;a href="https://gws.phd/posts/fortran_wasm/"&gt;article&lt;/a&gt; on using Flang to produce WebAssembly, which was adapted to the (then) latest version of LLVM (&lt;a href="https://github.com/r-wasm/llvm-project/blob/wasm/llvm/CMakeLists.txt"&gt;v18&lt;/a&gt;). Inspired by George Stagg’s endeavors, Serge posted upstream contributions to the Flang project (&lt;a href="https://github.com/llvm/llvm-project/pull/99465"&gt;#99465&lt;/a&gt;, &lt;a href="https://github.com/llvm/llvm-project/pull/99822"&gt;#99822&lt;/a&gt;, &lt;a href="https://github.com/llvm/llvm-project/pull/101242"&gt;#101242&lt;/a&gt;, &lt;a href="https://github.com/llvm/llvm-project/pull/105589"&gt;#105589&lt;/a&gt;), resolving issues with 32-bit platforms that were impacting our effort to support WebAssembly. All of these changes will be included in LLVM/Flang 20.0.&lt;/p&gt;
&lt;p&gt;The remaining patches which cannot be merged upstream at this point involve:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(1) enabling code generation that targets WebAssembly (&lt;a href="https://github.com/llvm/llvm-project/commit/198c0e1e23a52abb3e274ee44223551247f2c38f"&gt;198c0e1&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;(2) encoding target-specific size definitions for various data types given that the host and target platforms have different architectures (&lt;a href="https://github.com/llvm/llvm-project/commit/1da66cda3652da369f5d1be871c27368a12b55e9"&gt;1da66cd&lt;/a&gt;), and&lt;/li&gt;
&lt;li&gt;(3) disabling support for 128-bit floating-point types (&lt;a href="https://github.com/llvm/llvm-project/commit/f20c7c05db0ed9afb50c0092dad7bc991d933481"&gt;f20c7c0&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A version of (2) that could be contributed upstream is in the works, which would be one step closer to making WebAssembly an official target for Flang. Additionally, (3) will no longer be needed starting with Flang v20.&lt;/p&gt;
&lt;p&gt;These patches were integrated by Axel Obermeier into the Flang build recipe for the conda-forge distribution, making the modified build accessible to everyone. It can be installed on Linux with mamba or micromamba by executing:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;micromamba&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;conda-forge/label/emscripten::flang&lt;span class="w"&gt; &lt;/span&gt;libllvm19&lt;span class="w"&gt; &lt;/span&gt;--no-channel-priority
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The final ingredient for our toolchain involved creating a compatible Fortran runtime library. Since Flang implements its runtime library in C/C++, compiling this library with Emscripten proved to be straightforward. We added a &lt;a href="https://github.com/emscripten-forge/recipes/blob/9b08a19a531bb5e03c7d5147367f6de2acb57e40/recipes/recipes_emscripten/libflang/recipe.yaml"&gt;recipe for libflang&lt;/a&gt; to emscripten-forge, which packages the runtime library and includes all the aforementioned patches.&lt;/p&gt;
&lt;p&gt;In the following example, we invoke Flang on a simple Fortran script, and execute the resulting JavaScript and WebAssembly with NodeJS.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;ls
hello.f90&lt;span class="w"&gt;  &lt;/span&gt;libFortranRuntime.a
&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;cat&lt;span class="w"&gt; &lt;/span&gt;hello.f90
File:&lt;span class="w"&gt; &lt;/span&gt;hello.f90
program&lt;span class="w"&gt; &lt;/span&gt;hello
&lt;span class="w"&gt; &lt;/span&gt;print&lt;span class="w"&gt; &lt;/span&gt;*,&lt;span class="w"&gt; &lt;/span&gt;“Hello,&lt;span class="w"&gt; &lt;/span&gt;Fortran!”
end&lt;span class="w"&gt; &lt;/span&gt;program&lt;span class="w"&gt; &lt;/span&gt;hello
&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/emsdk/emsdk_env.sh
&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;flang-new&lt;span class="w"&gt; &lt;/span&gt;--target&lt;span class="o"&gt;=&lt;/span&gt;wasm32-unknown-emscripten&lt;span class="w"&gt; &lt;/span&gt;-c&lt;span class="w"&gt; &lt;/span&gt;hello.f90&lt;span class="w"&gt; &lt;/span&gt;-o&lt;span class="w"&gt; &lt;/span&gt;hello.o
&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;emcc&lt;span class="w"&gt; &lt;/span&gt;hello.o&lt;span class="w"&gt; &lt;/span&gt;libFortranRuntime.a&lt;span class="w"&gt; &lt;/span&gt;-o&lt;span class="w"&gt; &lt;/span&gt;hello.js
&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;ls
hello.f90&lt;span class="w"&gt;  &lt;/span&gt;hello.js&lt;span class="w"&gt;  &lt;/span&gt;hello.o&lt;span class="w"&gt;  &lt;/span&gt;hello.wasm&lt;span class="w"&gt;  &lt;/span&gt;libFortranRuntime.a
&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;node&lt;span class="w"&gt; &lt;/span&gt;hello.js
Hello,&lt;span class="w"&gt; &lt;/span&gt;Fortran!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;With a working Fortran-to-WebAssembly toolchain, we managed to compile BLAS and LAPACK (See the &lt;a href="https://github.com/emscripten-forge/recipes/blob/main/recipes/recipes_emscripten/lapack/recipe.yaml"&gt;LAPACK recipe&lt;/a&gt;). But before we could get started with building R, we needed to tackle the remaining R dependencies.&lt;/p&gt;
&lt;h2 id="walking-up-the-stack"&gt;&lt;strong&gt;Walking up the stack&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;In R (v4.4), there are a handful of dependencies that are required to provide basic functionality; these are: libiconv, zlib, bzip2, xz, pcre2, and libcurl. Thanks to the packaging efforts led by Thorsten Beier and Wolf Vollprecht, these dependencies are available on emscripten-forge with the exception of libcurl. Because of its socket-based networking architecture and reliance on system-level resource access, libcurl faces fundamental incompatibilities with WebAssembly’s sandboxed environment constraints. Therefore, libcurl had to be disabled in the R source code. As a consequence, downstream R packages which depend on libcurl cannot be ported to WebAssembly until a suitable libcurl replacement is available.&lt;/p&gt;
&lt;p&gt;Apart from the core dependencies, R also requires a BLAS implementation. Although external BLAS libraries can be used with R, the R code base contains linear algebra routines from Netlib BLAS and a subset of LAPACK where both libraries are written in C and Fortran. To simplify configuration, we opted for these internal implementations instead of using external BLAS and LAPACK libraries.&lt;/p&gt;
&lt;p&gt;Furthermore, several key optional dependencies were cross-compiled to WebAssembly to enhance R’s graphical capabilities; these include libpng, libtiff, cairo, and pango, along with their respective subdependencies. One particularly challenging aspect of packaging these libraries was the cross-compilation of glib, which both cairo and pango depend on. Compiling glib was only possible thanks to the efforts of &lt;a href="https://gist.github.com/kleisauke/acfa1c09522705efa5eb0541d2d00887"&gt;Kleis Auke Wolthuizen&lt;/a&gt; whose patches made glib compatible with Emscripten, and Johan Mabille who disabled multi-threading.&lt;/p&gt;
&lt;p&gt;The R dependencies are summarized in the following table:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="A table summarizing the R dependencies." src="https://jasongrout.github.io/medium-archive/pelican/posts/2025/r-in-the-browser-announcing-our-webassembly/images/007-1_9VQSZHRow-lBASg0wxfklg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Table of R dependencies&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="cross-compilation-of-r"&gt;&lt;strong&gt;Cross-compilation of R&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Although R typically configures and builds seamlessly on most unix platforms, cross-compiling is not straightforward because R uses a bootstrap approach; first it creates a minimal version of R which is then used to run several R scripts to complete the build process. Bootstrapping is a challenge because the built binaries for the target platform (WebAssembly) are not executable (at least not directly) from the host platform. Therefore, the r-base package necessitates two build phases. First, we compile R for the host platform (Linux) with GCC and Flang; this generates the R and Rscript executables needed for the second phase. And then, we cross-compile to WebAssembly with Emscripten and Flang.&lt;/p&gt;
&lt;p&gt;One of the major challenges of this setup was generating the R Data Base (.rdb) and R Data Index (.rdx) files for the internal packages of r-base (base, compiler, grDevices, graphics, grid, methods, parallel, splines, stats, stats4, tools, and utils). To accomplish this, it was necessary to dynamically load some of the internal shared libraries (tools, grDevices, graphics, utils, stats, and methods) which provide essential functionality to generate the data and index files. However, the R executables we created during the first phase of the build are incompatible with the WebAssembly shared libraries. In order to work around this, we temporarily replaced the WebAssembly libraries of the internal packages with the linux shared libraries we built during the first phase (See &lt;a href="https://github.com/emscripten-forge/recipes/blob/9b08a19a531bb5e03c7d5147367f6de2acb57e40/recipes/recipes_emscripten/r-base/cross_libraries.sh"&gt;cross_libraries.sh&lt;/a&gt;). This makeshift solution is also used to cross-compile all other R packages; the setup is carried out by the activation script of the cross-r-base package (See &lt;a href="https://github.com/conda-forge/r-base-feedstock/blob/54c15117f86693d54d69aacdd2fb76f622e31e5a/recipe/activate-cross-r-base.sh#L18"&gt;activate-cross-r-base.sh&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Additionally, the R source code required a few modifications to enable cross-compilation to WebAssembly.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Emscripten platform was added to select the correct configuration for the platform.&lt;/li&gt;
&lt;li&gt;The dependency on libcurl was removed (as mentioned in the previous section) and as a consequence, the internet package which relies on libcurl was disabled.&lt;/li&gt;
&lt;li&gt;System calls which are not compatible with our WebAssembly environment were disabled.&lt;/li&gt;
&lt;li&gt;Cairo replaced Xlib as the default bitmap type to enable graphics.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The complete list of patches applied to R is available here: &lt;a href="https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/r-base/patches"&gt;r-base patches&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="the-r-package-ecosystem"&gt;&lt;strong&gt;The R package ecosystem&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Building R itself was just the beginning. The next challenge was to provide a wide array of R packages to create a robust development environment. Fortunately, many packages are written in pure R and are available as “noarch” packages on conda-forge, making them directly compatible with emscripten-forge environments. However, for the R packages that require compilation, a package recipe needs to be created and added to emscripten-forge. Thanks to the help of Anutosh Bhat, the following packages have been compiled and are available to use.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;r-askpass     r-digest    r-haven      r-magrittr  r-purrr    r-tidyr
r-base64enc   r-dplyr     r-hexbin     r-mass      r-rcpp     r-tzdb
r-bit         r-ellipsis  r-htmltools  r-matrix    r-readr    r-utf8
r-bit64       r-fansi     r-isoband    r-mgcv      r-rlang    r-vctrs
r-cachem      r-farver    r-jsonlite   r-mime      r-sp       r-vroom
r-cli         r-fastmap   r-later      r-nlme      r-stringi  r-xfun
r-colorspace  r-ggrepel   r-lattice    r-plyr      r-sys      r-yaml
r-data.table  r-glue      r-lazyeval   r-promises  r-tibble
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Most of the time, cross-compiling an R package is very simple because the bulk of the work is handled by r-base. Building a package typically boils down to a single line:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;$R&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;CMD&lt;span class="w"&gt; &lt;/span&gt;INSTALL&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$R_ARGS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Occasionally, minor patches are applied to the package source code to enable the WebAssembly target platform or to simplify cross-compilation. Some R packages, such as r-nlme, contain Fortran code; for such packages, the custom flang compiler needs to be installed before the package can be cross-compiled. Should any package be needed for your use case, feel free to contribute them to emscripten-forge!&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="xeus-r"&gt;&lt;strong&gt;Xeus-R&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Once a sufficient set of packages is available for the platform, the next step is to provide a development environment for end users. Our chosen tool for this purpose is Jupyter.&lt;/p&gt;
&lt;p&gt;The most popular Jupyter kernel for R is &lt;a href="https://github.com/IRkernel/IRkernel"&gt;IRkernel&lt;/a&gt;, which has been developed over several years. It includes complete ZeroMQ bindings for the R language and comprehensive coverage of the Jupyter protocol. However, since IRkernel is tied to ZeroMQ, we opted to work with the &lt;a href="https://github.com/jupyter-xeus/xeus-r"&gt;Xeus-R&lt;/a&gt; project instead, which was &lt;a href="/posts/2024/meet-xeus-r-a-future-proof-jupyter-kernel-for-r/"&gt;announced last year.&lt;/a&gt; Xeus-R was developed by Romain François in collaboration with our team and with JupyterLite in mind. It is built upon the Xeus library, which provides a native implementation of the Jupyter protocol and is adapted to work with the JupyterLite frontend.&lt;/p&gt;
&lt;p&gt;Fortunately, the components of IRkernel responsible for the rich representation of R objects and rich display in Jupyter frontends were split into two separate R packages: &lt;strong&gt;IRdisplay&lt;/strong&gt; and &lt;strong&gt;repr&lt;/strong&gt;. These packages can be reused in Xeus-R. As a result, Xeus-R and IRkernel offer the same rich display functionality, ensuring that Jupyter notebooks created with one kernel will work with the other. However, Xeus-R provides a different implementation of the communication layer through &lt;a href="https://github.com/jupyterlite/xeus"&gt;jupyterlite-xeus&lt;/a&gt;, which enables integration with the JupyterLite stack. This integration was previously implemented for Xeus-Python and Xeus-Lua.&lt;/p&gt;
&lt;p&gt;One key aspect of this integration is the populating of the in-memory file system used by JupyterLite kernels with the required runtime dependencies, particularly shared libraries. This process is done upon bootstrapping the kernel. For this purpose, Anastiasiia Sliusar and Martin Renou developed &lt;a href="https://github.com/emscripten-forge/mambajs"&gt;mambajs&lt;/a&gt;, which, in combination with jupyterlite-xeus, processes conda packages in the frontend and installs them in the kernel filesystem at startup. In WebAssembly, shared libraries need to be handled with special care in order to function as expected. Drawing inspiration from the Python community, we adapted the pioneering work of Pyodide to properly load shared libraries into the filesystem.&lt;/p&gt;
&lt;h2 id="how-to-make-a-deployment-with-custom-packages"&gt;&lt;strong&gt;How to make a deployment with custom packages&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The GitHub repository &lt;a href="https://github.com/jupyterlite/xeus-lite-demo"&gt;https://github.com/jupyterlite/xeus-lite-demo&lt;/a&gt; is a template for creating a JupyterLite deployment on GitHub pages that includes the packages specified in a conda environment.&lt;/p&gt;
&lt;p&gt;The process is as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new repository from the GitHub template.&lt;/li&gt;
&lt;li&gt;Enable the deployment on GitHub pages from a GitHub action, as shown in the README.&lt;/li&gt;
&lt;li&gt;Edit the environment file to include the desired packages.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example, to deploy an R kernel with coursekata installed, the environment.yml file would contain the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;xeus-r&lt;/span&gt;
&lt;span class="nt"&gt;channels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;https://repo.mamba.pm/emscripten-forge&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;conda-forge&lt;/span&gt;
&lt;span class="nt"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;xeus-r&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;r-coursekata&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The deployment linked at the beginning of this article was created with this template.&lt;/p&gt;
&lt;h2 id="how-to-contribute"&gt;&lt;strong&gt;How to contribute&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Contributors are always welcome! New R packages can be requested by opening an issue on emscripten-forge, or added directly by opening a pull request with the desired package recipe. For instructions on how to contribute, please visit &lt;a href="https://emscripten-forge.org/"&gt;https://emscripten-forge.org/&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="what-is-in-the-works"&gt;&lt;strong&gt;What is in the works&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Currently, we are developing the infrastructure to dynamically install emscripten-forge and conda-forge noarch packages in JupyterLite kernel environments. This will apply to all Xeus kernels that make use of these packages, such as Xeus-Python, Xeus-R, and Xeus-Lua. In the case of R, this may be directly bound to install.packages.&lt;/p&gt;
&lt;p&gt;Additionally, we are working on more advanced features for the R kernel, including support for Jupyter interactive widgets and the split of the pure R parts of xeus-r into a separate package, which would facilitate a possible convergence with IRkernel.&lt;/p&gt;
&lt;p&gt;Finally, other language kernels based on the same package management stack are also in the works. Stay tuned for future announcements!&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="about-the-author"&gt;&lt;strong&gt;About the Author&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Isabel Paredes&lt;/strong&gt;, who led the charge on bringing R to emscripten-forge, is a senior scientific software developer at QuantStack. Prior to working on this project, she focused on porting the Robot Operating System (ROS) framework to WebAssembly.&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;&lt;strong&gt;Acknowledgments&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;This effort brought together several endeavors from many open-source developers.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;JupyterLite&lt;/strong&gt;, the Jupyter distribution that runs entirely in the web browser, was created by Jeremy Tuloup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Xeus&lt;/strong&gt;, the C++ library implementing the Jupyter kernel protocol, enabling a custom communication layer, and is foundational to kernels like xeus-r, xeus-python, running in JupyterLite, was created by Johan Mabille and is maintained by a broader team including Martin Renou, Sylvain Corlay, and Thorsten Beier, who worked on the first integration with JupyterLite.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Emscripten-forge&lt;/strong&gt;, the distribution of conda packages for WebAssembly, was created by Thorsten Beier, who continues to lead the project. Many recipes were contributed by Isabel Paredes (for the R ecosystem), but also Kerim Birgi, Anutosh Bhat, Martin Renou, Wolf Vollprecht, and Johan Mabille.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Xeus-R&lt;/strong&gt;, the Xeus-based Jupyter kernel for R, was created by Romain François.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IRDisplay&lt;/strong&gt; and &lt;strong&gt;repr&lt;/strong&gt; are pure R packages providing rich display and rich mime type rendering of many core R types, which are used in xeus-r. These two packages stem from the IRkernel project, a Jupyter kernel for R written in R, which was started by Thomas Kluyver, and has been maintained over the years by Philipp Angerer and Jan Katins.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MambaJS&lt;/strong&gt;, the library enabling the processing of conda packages in the frontend, was developed by Anastasiia Sliusar and Martin Renou.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conda-forge&lt;/strong&gt;, the main distribution of conda packages, includes a large number of “noarch” recipes, including for R packages, and is developed by a broad community of contributors worldwide.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;WebR&lt;/strong&gt;, an R distribution for WebAssembly, was created by George Stagg. Although not directly used in this project, it documented numerous patches and changes to the Flang compiler that were adapted for this effort.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="funding"&gt;&lt;strong&gt;Funding&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The work by &lt;strong&gt;Isabel Paredes&lt;/strong&gt; and other &lt;strong&gt;QuantStack&lt;/strong&gt; team members on bringing R and Xeus-R to Emscripten-Forge was supported by the &lt;a href="https://www.gatesfoundation.org/"&gt;&lt;strong&gt;Bill &amp;amp; Melinda Gates Foundation&lt;/strong&gt;&lt;/a&gt; through a grant to &lt;strong&gt;CourseKata&lt;/strong&gt;. CourseKata is a nonprofit project dedicated to improving statistics and data science education through interactive, research-backed curricula that integrate professional tools like R and Jupyter notebooks. This grant was part of CourseKata’s broader mission to scale its innovative curriculum, equipping students with the skills and confidence to engage with statistics, data science, and coding in meaningful ways.&lt;/p&gt;
</content><category term="JupyterLite"/><category term="kernels"/><category term="WebAssembly"/><category term="xeus"/></entry><entry><title>Jupyter Community Workshop: JupyterLite</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2022/community-workshop-jupyterlite/" rel="alternate"/><published>2022-11-10T15:45:00+00:00</published><updated>2022-11-10T15:45:00+00:00</updated><author><name>Sylvain Corlay</name></author><id>tag:jasongrout.github.io,2022-11-10:/medium-archive/pelican/posts/2022/community-workshop-jupyterlite/</id><summary type="html">&lt;p&gt;We are thrilled to announce the next in-person Jupyter Community Workshop, which will focus on the JupyterLite project!&lt;/p&gt;
</summary><content type="html">&lt;p&gt;We are thrilled to announce the next in-person Jupyter Community Workshop, which will focus on the JupyterLite project!&lt;/p&gt;
&lt;p&gt;The event will be held at the &lt;a href="https://www.ovhcloud.com/"&gt;OVHCloud&lt;/a&gt; headquarters in &lt;strong&gt;Paris&lt;/strong&gt;, France, &lt;strong&gt;from December 7th to December 9th&lt;/strong&gt;, 2022. Funding for travel expenses is available for attendees from academia and those from groups which are not well-represented in the Jupyter and wider tech community!&lt;/p&gt;
&lt;p&gt;Jupyter Community Workshop are a series of community-organized events to tackle challenging development and design projects, growing the community of contributors, and strengthening collaborations.&lt;/p&gt;
&lt;p&gt;This specific workshop will focus on the JupyterLite project, a JupyterLab distribution that runs entirely in the browser built from the ground-up using JupyterLab components and extensions. JupyterLite allows for very scalable deployments, and already powers inline consoles and notebooks on the websites of major projects of our ecosystem, such as NumPy, SymPy, Pandas, and many more.&lt;/p&gt;
&lt;p&gt;The workshop will last three days, with hands-on discussions, hacking sessions, and technical presentations. The goal of this event is to foster collaboration and the sharing of knowledge between Jupyter maintainers and downstream library authors and power users.&lt;/p&gt;
&lt;p&gt;Should you be interested in joining us for this workshop, please fill this &lt;a href="https://docs.google.com/forms/d/e/1FAIpQLSc7M_Bmj_u8kdEFrLwnhfj5-T3Y9r37KVb6mlvYVefXh2uSbw/viewform?usp=sf_link"&gt;&lt;strong&gt;form&lt;/strong&gt;&lt;/a&gt;. A limited number of spots are available for this event.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;We are grateful to&lt;/em&gt; &lt;a href="https://www.ovhcloud.com/"&gt;&lt;em&gt;OVHCloud&lt;/em&gt;&lt;/a&gt; &lt;em&gt;for hosting this event. We are also grateful to the sponsors of the Jupyter Community Workshop series, Bloomberg and Amazon AWS.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/community-workshop-jupyterlite/images/001-1_Zayr-b0FjuEZGr-plrEl3Q.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="community"/><category term="events"/><category term="JupyterLite"/><category term="WebAssembly"/><category term="workshops"/></entry><entry><title>Mamba meets JupyterLite</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2022/mamba-meets-jupyterlite/" rel="alternate"/><published>2022-07-14T11:19:00+00:00</published><updated>2022-07-15T10:26:00+00:00</updated><author><name>Thorsten Beier</name></author><id>tag:jasongrout.github.io,2022-07-14:/medium-archive/pelican/posts/2022/mamba-meets-jupyterlite/</id><summary type="html">&lt;p&gt;Introducing a mamba-based distribution for WebAssembly, and deploying scalable computing environments with JupyterLite.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/mamba-meets-jupyterlite/images/001-1_dbJO26hiSR8EFygX1rnqrA.webp" alt="JupyterLite logo" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;JupyterLite is a Jupyter distribution that runs entirely in the web browser without any server components. To achieve this, all language kernels must also run in the browser.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="A screenshot of JupyterLite running in the Browser. One can see as Matplotlib figure and some Pandas DataFrame code. Furthermore a p5.js kernel instance is visible." src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/mamba-meets-jupyterlite/images/002-0_MoW-XpW5yQgCxinq.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLite running in the browser as a static website&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A significant benefit of this approach is the &lt;strong&gt;ease of deployment&lt;/strong&gt;. With JupyterLite, the only requirement to provide a live computing environment is a collection of static assets. It makes it possible to embed a console or a notebook interface on any static page or blog without having to deal with a server architecture deployment. The &lt;strong&gt;scalability&lt;/strong&gt; of this approach allowed several major projects of our ecosystem (&lt;a href="https://numpy.org"&gt;NumPy&lt;/a&gt;, &lt;a href="https://www.sympy.org/en/shell.html"&gt;SymPy&lt;/a&gt;, &lt;a href="https://pandas.pydata.org/getting_started.html"&gt;Pandas&lt;/a&gt;, &lt;a href="https://www.pymc.io/welcome.html"&gt;PyMC&lt;/a&gt;, and many more) to embed interactive examples on their websites, which are visited by millions of users monthly.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;JupyterLite is the easiest and most scalable way to embed an interactive console or notebook on a web page without any server component.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The most prominent JupyterLite kernel is the &lt;em&gt;Pyolite&lt;/em&gt; Python kernel, which is based on the &lt;a href="https://pyodide.org/en/stable/"&gt;Pyodide&lt;/a&gt; distribution for WebAssembly. Beyond the CPython interpreter, Pyodide includes many popular scientific computing packages such as NumPy, Pandas, and Matplotlib. Pyodide also provides a foreign function interface (FFI) that allows calling Python from JavaScript and vice versa.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The JupyterLite inline console embedded on the SymPy project website" src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/mamba-meets-jupyterlite/images/003-1_rKzDNlHO6LnhH1ZDyb996g.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The JupyterLite inline console embedded on the &lt;a href="https://www.sympy.org/en/shell.html"&gt;SymPy project website&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="pyodide-and-beyond"&gt;Pyodide — and beyond&lt;/h2&gt;
&lt;p&gt;While Pyodide provides many scientific computing packages, its monolithic distribution model does not allow to specify package versions, although versions of pure python packages installed on top can be set. Our goal is to enable the &lt;strong&gt;composability of computing environments&lt;/strong&gt; allowed by package managers and to adopt the conda-forge model for large-scale software distribution crowdsourcing.&lt;/p&gt;
&lt;p&gt;Being able to pin down package versions in an environment is a strong requirement for software &lt;strong&gt;reproducibility.&lt;/strong&gt; In fact, a locked WebAssembly environment could be seen as a reproducibility &lt;strong&gt;time capsule&lt;/strong&gt;. As WebAssembly is a recognized web standard, it ought to be runnable for much longer than native binary packages: these are bound to a combination of architecture and platform and will eventually require an emulator.&lt;/p&gt;
&lt;p&gt;This is why we developed a mamba-based distribution of WebAssembly packages built with Emscripten.&lt;/p&gt;
&lt;h2 id="emscripten-forge"&gt;&lt;strong&gt;Emscripten-forge&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The choice of the Mamba/Conda package manager was natural. Its main strength is the conda-forge community-maintained distribution, which has become the &lt;em&gt;de facto&lt;/em&gt; standard source of packages for scientific computing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Beyond its solid technological foundations and the multi-platform nature of the conda-forge distribution, its main strength is its social model. It allowed for a crowdsourcing approach of the packaging problem, with a balance of separation of concerns between maintainer teams and across-the-board automation, plus an amazing maintainers community.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We plan on contributing this work to the conda-forge project, so that all recipes live in the same space.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Mamba/Conda package manager has support for many platforms and architectures such as Linux, OS X (for both x86 and arm64), and Windows. However, the &lt;strong&gt;WebAssembly&lt;/strong&gt; family of platforms is not supported yet.&lt;/p&gt;
&lt;h3 id="adding-support-for-webassembly-to-mamba-conda"&gt;Adding support for WebAssembly to mamba &amp;amp; conda&lt;/h3&gt;
&lt;p&gt;To create conda packages for the WebAssembly platform, we relied on the &lt;a href="https://emscripten.org/"&gt;Emscripten toolchain&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We defined a new target platform for conda-build and boa, namely &lt;code&gt;wasm32-unknown-emscripten&lt;/code&gt; for which we use the &lt;code&gt;emscripten-32&lt;/code&gt; shorthand name. We then associated the &lt;a href="https://emscripten.org/"&gt;Emscripten&lt;/a&gt; compiler, &lt;a href="https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes/emscripten_emscripten-32"&gt;wrapped in a conda package&lt;/a&gt; as the C/C++ compiler for this new target.&lt;br&gt;
This already allowed us to build many packages, including simple libraries like &lt;code&gt;bzip2&lt;/code&gt; and &lt;code&gt;zlib&lt;/code&gt;, but also more complex packages like &lt;code&gt;Python&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For Python extension modules we used &lt;a href="http://crossenv"&gt;&lt;code&gt;crossenv&lt;/code&gt;&lt;/a&gt; which can create virtual environments for cross-compiling, and &lt;a href="https://github.com/conda-forge/cross-python-feedstock"&gt;&lt;code&gt;cross-python&lt;/code&gt;&lt;/a&gt; which integrates &lt;a href="http://crossenv"&gt;&lt;code&gt;crossenv&lt;/code&gt;&lt;/a&gt; into conda. All the code and recipes for cross-compilation are hosted on the &lt;a href="https://github.com/emscripten-forge/recipes"&gt;emscripten-forge GitHub repository&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;We then used &lt;a href="https://github.com/emscripten-forge/recipes/blob/main/.github/workflows/build_recipes.yaml"&gt;GitHub actions&lt;/a&gt; to build packages with Emscripten and upload them to a package server.&lt;/li&gt;
&lt;li&gt;Packages are hosted on a deployment of the &lt;a href="https://github.com/mamba-org/quetz"&gt;Quetz&lt;/a&gt; open-source server.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this, you can easily create an environment for the &lt;code&gt;emscripten-32&lt;/code&gt; target:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;micromamba create -n my-env --platform=emscripten-32 \ 
    -c https://repo.mamba.pm/emscripten-forge \ 
    -c https://repo.mamba.pm/conda-forge \
    python ipython numpy jedi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that we not only added emscripten-forge as a channel, but also &lt;a href="https://repo.mamba.pm/conda-forge"&gt;conda-forge&lt;/a&gt;. This means all noarch packages can be used.&lt;/p&gt;
&lt;h3 id="adding-new-packages-to-the-emscripten-forge-channel"&gt;Adding new packages to the emscripten-forge channel&lt;/h3&gt;
&lt;p&gt;Adding new packages is a simple procedure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;fork the repository &lt;a href="https://github.com/emscripten-forge/recipes"&gt;https://github.com/emscripten-forge/recipes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;create a folder for your package in &lt;a href="https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten"&gt;&lt;strong&gt;recipes/recipes_emscripten/&amp;lt;my_package&amp;gt;&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;add a &lt;a href="https://github.com/emscripten-forge/recipes/blob/main/recipes/recipes_emscripten/widgetsnbextension/recipe.yaml"&gt;&lt;code&gt;recipe.yaml&lt;/code&gt;&lt;/a&gt; for your package in &lt;code&gt;recipes/recipes_emscripten/&amp;lt;your_package&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;create a pull request containing the recipe. Once the pull request is merged, the package is automatically uploaded to the &lt;code&gt;emscripten-forge&lt;/code&gt; channel.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="integration-with-jupyterlite"&gt;Integration with JupyterLite&lt;/h2&gt;
&lt;p&gt;Even though this is a general-purpose conda-based distribution for Emscripten packages, we had one particular application in mind for this first iteration: &lt;strong&gt;JupyterLite&lt;/strong&gt;. The existing Pyolite kernel is too tightly coupled with the Pyodide distribution, so we decided to go with &lt;a href="https://github.com/jupyter-xeus/xeus-python"&gt;&lt;strong&gt;xeus-python&lt;/strong&gt;&lt;/a&gt; instead.&lt;/p&gt;
&lt;p&gt;The main reason for picking &lt;a href="https://github.com/jupyter-xeus/xeus-python"&gt;xeus-python&lt;/a&gt; (over ipykernel) is that with xeus-based kernels, it is possible to override the communication layer of the kernel (switching e.g. from ZMQ to HTTP/2). In the case of JupyterLite, the implementation simply relies on direct JavaScript function calls.&lt;/p&gt;
&lt;p&gt;You can check out our &lt;a href="/posts/2021/xeus-lite/"&gt;earlier blog post&lt;/a&gt; for more details on the JupyterLite xeus-based kernels.&lt;/p&gt;
&lt;h3 id="providing-a-complete-python-development-experience"&gt;Providing a complete Python development experience&lt;/h3&gt;
&lt;p&gt;Some remaining intrinsic limitations to the WebAssembly platform need to be worked around to provide a complete experience to end-users. For example, sockets cannot be created in WebAssembly, preventing the use of the default asyncio event loop implementation. Luckily, the Pyodide authors developed a custom asyncio event-loop called &lt;a href="https://pyodide.org/en/latest/usage/api/python-api/webloop.html"&gt;WebLoop&lt;/a&gt;: it wraps the browser event loop using the Python — JavaScript foreign function interface (FFI) provided with &lt;a href="https://pyodide.org/en/stable/usage/type-conversions.html"&gt;Pyodide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pyjs:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Since it is non-trivial to extract Pyodide’s FFI and use it for other projects, we created a modern Python - JavaScript FFI from scratch. This was done with the following tricks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/pybind/pybind11"&gt;Pybind11&lt;/a&gt; is used to call Python from C++ and vice versa,&lt;/li&gt;
&lt;li&gt;&lt;a href="https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html"&gt;Embind&lt;/a&gt; is used to call JavaScript from C++ and vice versa.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we use &lt;a href="https://github.com/pybind/pybind11"&gt;Pybind11&lt;/a&gt; and &lt;a href="https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html"&gt;Embind&lt;/a&gt; together we can call Python from JavaScript and vice versa, with C++ as a man in the middle. This not only allows us to write a simple FFI from scratch with relatively little code but also avoids calling any low-level CPython APIs and enables using high-level constructs — like &lt;a href="https://pybind11.readthedocs.io/en/stable/advanced/pycpp/object.html#calling-python-functions"&gt;&lt;code&gt;pybind11::object&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://emscripten.org/docs/api_reference/val.h.html"&gt;&lt;code&gt;emscripten::val&lt;/code&gt;&lt;/a&gt;— instead.&lt;br&gt;
The code is available in the &lt;a href="https://github.com/emscripten-forge/pyjs"&gt;pyjs&lt;/a&gt; repository. The API is very similar to Pyodide’s so that it can be used as a drop-in replacement in code, like Pyodide’s &lt;a href="https://pyodide.org/en/latest/usage/api/python-api/webloop.html"&gt;WebLoop&lt;/a&gt; implementation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Deployment:&lt;/strong&gt;The &lt;a href="https://github.com/jupyterlite/xeus-python-kernel"&gt;xeus-python-kernel&lt;/a&gt; allows conda packages to be pre-installed in the Python runtime. This can be done by passing the &lt;code&gt;XeusPythonEnv.packages&lt;/code&gt; CLI option to &lt;code&gt;jupyter lite build&lt;/code&gt;. The following command will install &lt;code&gt;NumPy&lt;/code&gt;, &lt;code&gt;Matplotlib&lt;/code&gt;, and &lt;code&gt;ipyleaflet&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nx"&gt;jupyter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;lite&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;build&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;XeusPythonEnv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;packages&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;\
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;numpy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;\
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;matplotlib&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;\
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;ipyleaflet&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;figure&gt;
&lt;img alt="xeus-python kernel with the ipyleaflet widget visible." src="https://jasongrout.github.io/medium-archive/pelican/posts/2022/mamba-meets-jupyterlite/images/004-1_JCiZIwwkFen5kwEA2rK4SA.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Running the xeus-python kernel with the ipyleaflet widget in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;More details can be found in the &lt;a href="https://github.com/jupyterlite/xeus-python-kernel"&gt;xeus-python-kernel GitHub repository&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="what-about-the-future"&gt;What about the future?&lt;/h2&gt;
&lt;p&gt;This combination of JupyterLite and Mamba has the potential to open Jupyter to millions of additional users.&lt;br&gt;
Given its scalability, ease of deployment, reproducibility, and accessibility, JupyterLite will be everywhere: countries, organizations, and schools that don’t have access to sovereign cloud infrastructure will be able to deploy Jupyter-based education platforms on servers that they truly own, without endangering the data of their students or becoming too reliant on resources that they do not control.&lt;/p&gt;
&lt;h3 id="in-the-short-term-we-are-working-on-the-following-next-steps"&gt;In the short term, we are working on the following “next steps”:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mambalite:&lt;/strong&gt; To support the installation of packages at runtime. Similar to Pyodide’s pip-lite, it will allow downloading packages at runtime.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fortran:&lt;/strong&gt; Compiling Fortran code with Emscripten is currently not supported, but it is necessary for key packages like SciPy. Pyodide relies on f2c, a Fortran-to-C converter, in conjunction with a set of patches to compile Fortran code with Emscripten. We are working on a more direct approach: compiling SciPy natively with &lt;a href="https://lfortran.org/"&gt;LFortran&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Binderlite:&lt;/strong&gt; Binder converts a repository of notebooks into an executable JupyterLab environment, making code immediately reproducible by anyone, anywhere. Emscripten-forge is the missing piece to build BinderLite, a version of Binder relying on JupyterLite instances instead of vanilla JupyterLab instances.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rust/PyO3 support:&lt;/strong&gt; We are working on integrating the &lt;a href="https://blog.pyodide.org/posts/rust-pyo3-support-in-pyodide/"&gt;work of the Pyodide team&lt;/a&gt; on Rust/PyO3 support in emscripten-forge. This will be important to build Rust extension modules like &lt;code&gt;cryptography&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="credits"&gt;Credits&lt;/h2&gt;
&lt;p&gt;This was built upon the work of a much bigger crowd!&lt;/p&gt;
&lt;h3 id="the-pyodide-team"&gt;The Pyodide team&lt;/h3&gt;
&lt;p&gt;The Pyodide project was started at the Mozilla foundation by &lt;a href="https://twitter.com/MDroettboom"&gt;Michael Droettboom&lt;/a&gt; and is now maintained by &lt;a href="https://github.com/hoodmane"&gt;Hood Chatham&lt;/a&gt;, &lt;a href="https://twitter.com/RomanYurchak"&gt;Roman Yurchak&lt;/a&gt;, and &lt;a href="https://github.com/ryanking13"&gt;Gyeongjae Choi&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The foundational work of the Pyodide project pioneered the use of Python in the browser and made all of the rest possible, from JupyterLite to this work.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="the-emscripten-team"&gt;The Emscripten team&lt;/h3&gt;
&lt;p&gt;Both Pyodide and emscripten-forge are built upon the Emscripten toolchain, which provides the foundational components to be able to meaningfully run WebAssembly programs in the browser.&lt;/p&gt;
&lt;h3 id="the-jupyterlite-team"&gt;&lt;strong&gt;The JupyterLite team&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;The JupyterLite project was started by &lt;a href="https://twitter.com/jtpio"&gt;Jeremy Tuloup&lt;/a&gt;, with significant contributions from &lt;a href="https://github.com/bollwyvl"&gt;Nick Bollweg&lt;/a&gt; and &lt;a href="https://twitter.com/martinrenou"&gt;Martin Renou&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="the-mamba-org-team"&gt;The Mamba Org team&lt;/h3&gt;
&lt;p&gt;The mamba ecosystem has been instrumental in making these developments possible. We use the Quetz open-source server for hosting the packages and the Boa tool to build them. In the mamba development team, we should highlight the work of &lt;a href="https://twitter.com/wuoulf"&gt;Wolf Vollprecht&lt;/a&gt;, &lt;a href="https://twitter.com/johanmabille"&gt;Johan Mabille&lt;/a&gt;, &lt;a href="https://twitter.com/MJKlaim"&gt;Joel Lamotte&lt;/a&gt;, and &lt;a href="https://twitter.com/atrawog"&gt;Andreas Trawöger&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="the-xeus-team"&gt;The Xeus team&lt;/h3&gt;
&lt;p&gt;The xeus project was started by &lt;a href="https://twitter.com/johanmabille"&gt;Johan Mabille&lt;/a&gt; and &lt;a href="https://twitter.com/JohanMabille/"&gt;Sylvain Corlay&lt;/a&gt;. It is at the foundation of the JupyterLite integration and helped to get all the pieces together (Xeus, Mamba, Jupyter). We should especially credit the work of &lt;a href="https://twitter.com/martinRenou"&gt;Martin Renou&lt;/a&gt; and &lt;a href="https://twitter.com/thorstenbeier"&gt;Thorsten Beier&lt;/a&gt; on this integration with JupyterLite.&lt;/p&gt;
&lt;h2 id="acknowledgment"&gt;Acknowledgment&lt;/h2&gt;
&lt;p&gt;The work of Thorsten Beier, Johan Mabille, Martin Renou, Sylvain Corlay, Wolf Vollprecht, Joel Lamotte, and Andreas Trawoger at &lt;a href="https://twitter.com/QuantStack"&gt;&lt;strong&gt;QuantStack&lt;/strong&gt;&lt;/a&gt; was funded by &lt;a href="https://twitter.com/TechAtBloomberg?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor"&gt;&lt;strong&gt;Bloomberg&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="about-the-authors"&gt;About the Authors&lt;/h2&gt;
&lt;h3 id="thorsten-beier"&gt;&lt;strong&gt;Thorsten Beier&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://twitter.com/thorstenbeier"&gt;Thorsten Beier&lt;/a&gt; is a Scientific Software Engineer at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt;. Before joining &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt;, he graduated in computer science at the University of Heidelberg and worked at the &lt;a href="https://www.embl.org/"&gt;EMBL&lt;/a&gt;. As an open-source developer, Thorsten worked on a variety of projects, from &lt;a href="https://github.com/jupyter-xeus/xeus"&gt;xeus&lt;/a&gt; and &lt;a href="https://github.com/QuantStack/xtensor"&gt;xtensor&lt;/a&gt; in C++ to &lt;a href="https://github.com/inferno-pytorch/inferno"&gt;inferno&lt;/a&gt;, &lt;a href="https://kipoi.org/"&gt;kipoi&lt;/a&gt;, &lt;a href="https://www.ilastik.org/"&gt;ilastik&lt;/a&gt;, and &lt;a href="https://github.com/uhlmanngroup/napari-splineit"&gt;napari-splineit&lt;/a&gt; in Python.&lt;/p&gt;
&lt;h3 id="martin-renou"&gt;Martin Renou&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://twitter.com/martinRenou"&gt;Martin Renou&lt;/a&gt; is a Scientific Software Engineer at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt;. Before joining &lt;a href="http://quantstack.net/"&gt;QuantStack&lt;/a&gt;, he studied at the French Aerospace Engineering School &lt;a href="https://www.isae-supaero.fr/en"&gt;SUPAERO&lt;/a&gt;. He also worked at Logilab in Paris and Enthought in Cambridge. As an open-source developer at &lt;a href="http://quantstack.net/"&gt;QuantStack&lt;/a&gt;, Martin worked on a variety of projects, from &lt;a href="https://github.com/QuantStack/xsimd"&gt;xsimd&lt;/a&gt;, &lt;a href="https://github.com/QuantStack/xtensor"&gt;xtensor&lt;/a&gt;, and &lt;a href="https://github.com/QuantStack/xframe"&gt;xframe&lt;/a&gt; in C++ to &lt;a href="https://github.com/jupyter-widgets/ipyleaflet"&gt;ipyleaflet&lt;/a&gt; and &lt;a href="https://github.com/maartenbreddels/ipywebrtc"&gt;ipywebrtc&lt;/a&gt; in Python and JavaScript.&lt;/p&gt;
</content><category term="JupyterLite"/><category term="WebAssembly"/></entry><entry><title>Xeus-Lite</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/" rel="alternate"/><published>2021-10-25T09:40:00+00:00</published><updated>2021-10-25T09:40:00+00:00</updated><author><name>Thorsten Beier</name></author><id>tag:jasongrout.github.io,2021-10-25:/medium-archive/pelican/posts/2021/xeus-lite/</id><summary type="html">&lt;p&gt;JupyterLite + Xeus = ❤️️&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/001-1_PUlJi6czJovO90t-Dsgt5g.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;JupyterLite is a &lt;a href="https://jupyter.org/"&gt;JupyterLab&lt;/a&gt; distribution that runs entirely in the web browser, backed by in-browser language kernels. &lt;a href="https://github.com/jupyter-xeus/xeus"&gt;Xeus&lt;/a&gt; is C++ library for writing &lt;a href="https://jupyter.org/"&gt;Jupyter&lt;/a&gt; kernels. In this blogpost we show how these two can work together.&lt;/p&gt;
&lt;h2 id="jupyterlite"&gt;JupyterLite&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/002-1_dbJO26hiSR8EFygX1rnqrA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;With vanilla Jupyter, kernels are running in separate processes. The communication between the kernels and the client is achieved with &lt;a href="https://zeromq.org/"&gt;ZeroMQ&lt;/a&gt;. In contrast to this, JupyterLite runs entirely in the browser, including the language kernels. The following kernels are already implemented in the JupyterLite framework:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;JavaScript Kernel&lt;/li&gt;
&lt;li&gt;P5 Kernel: Since P5 is a JavaScript library, it is easy to provide a P5 kernel running in the browser.&lt;/li&gt;
&lt;li&gt;A Python kernel based on &lt;a href="https://github.com/pyodide/pyodide"&gt;pyodide&lt;/a&gt; called pyolite: While the two JavaScript based kernels are trivial to implement as in-browser kernels, &lt;a href="https://github.com/pyodide/pyodide"&gt;pyodide&lt;/a&gt; is a Python interpreter compiled to WebAssembly via Emscripten. Not only Python itself has been compiled to WebAssembly, but also the whole Scientific Stack including packages like: Numpy, Scipy, Pandas and many more. An overview of packages can be found &lt;a href="https://github.com/pyodide/pyodide/tree/main/packages"&gt;here&lt;/a&gt;. Furthermore any pure Python package can be installed from within pyolite.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since JupyterLite runs entirely in the browser, it is &lt;a href="https://jupyterlite.github.io/demo/lab/index.html"&gt;very easy to try it out&lt;/a&gt;!&lt;/p&gt;
&lt;h2 id="xeus"&gt;Xeus&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://xeus.readthedocs.io/en/latest/?badge=latest"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/003-1_c-fyt4I1GOXnrq3tkexaGA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/jupyter-xeus/xeus"&gt;Xeus&lt;/a&gt; is C++ library for writing &lt;a href="https://jupyter.org/"&gt;Jupyter&lt;/a&gt; kernels. It is not a kernel but a library that simplifies the process of writing kernels. &lt;a href="https://github.com/jupyter-xeus/xeus"&gt;Xeus&lt;/a&gt; implements the &lt;a href="https://jupyter-client.readthedocs.io/en/stable/messaging.html"&gt;Jupyter messaging protocol&lt;/a&gt;, so that kernel authors only need to implement a handful of methods related to the actual interpreter, like executing pieces of code and auto-completing.&lt;br&gt;
With the help of Xeus, it is very easy to write Jupyter kernels . In fact, &lt;a href="https://github.com/jupyter-xeus/xeus"&gt;Xeus&lt;/a&gt; has already been used for making several &lt;a href="https://jupyter.org/"&gt;l&lt;/a&gt;anguage kernels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/QuantStack/xeus-cling"&gt;xeus-cling&lt;/a&gt; is a Xeus-based C++ kernel.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jupyter-xeus/xeus-python"&gt;xeus-python&lt;/a&gt; is a Xeus-based Python kernel.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jupyter-xeus/xeus-lua"&gt;xeus-lua&lt;/a&gt; is a Xeus-based Lua kernel.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jupyter-xeus/xeus-sql"&gt;xeus-sql&lt;/a&gt; / &lt;a href="https://github.com/jupyter-xeus/xeus-sqlite"&gt;xeus-sqlite&lt;/a&gt; are Xeus-based kernel for SQL / SQLite databases.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jupyter-xeus/xeus-robot"&gt;xeus-robot&lt;/a&gt; is a Jupyter kernel for the &lt;a href="https://robotframework.org/"&gt;Robot Framework&lt;/a&gt; .&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/lfortran/lfortran/-/merge_requests/514"&gt;LFortran&lt;/a&gt; is a modern interactive Fortran compiler with a Xeus-based Jupyter kernel.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since it is very easy to write Xeus based kernels for Jupyter, we also want to leverage Xeus for writing JupyterLite kernels. This has been the main motivation for &lt;a href="/posts/2021/xeus-2-0/"&gt;Xeus 2.0&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="xeus-architecture"&gt;Xeus Architecture&lt;/h2&gt;
&lt;p&gt;Xeus is has three extension points as depicted below&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/004-1_CTgb-wk-_TMWVhDzB-Yx7g.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;em&gt;&lt;strong&gt;Server&lt;/strong&gt;&lt;/em&gt; is the middleware component responsible for receiving and sending messages to the Jupyter client. The default server it is built upon ZeroMQ and handles the concurrency model of the application.&lt;br&gt;
As we will see later, a custom server is needed to connect Xeus with JupyterLite.&lt;/li&gt;
&lt;li&gt;The &lt;em&gt;&lt;strong&gt;Interpreter&lt;/strong&gt;&lt;/em&gt; provides the interface that kernel authors must implement.&lt;/li&gt;
&lt;li&gt;The &lt;em&gt;&lt;strong&gt;Debugger&lt;/strong&gt;&lt;/em&gt; provides the interface that can to be implemented when the kernel shall have &lt;a href="/posts/2020/a-visual-debugger-for-jupyter/"&gt;debug capabilities&lt;/a&gt;, but we do not yet support this for Xeus-JupyterLite-Kernels.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="jupyterlite-xeus-kernels"&gt;JupyterLite Xeus-Kernels&lt;/h2&gt;
&lt;p&gt;Traditionally, the Jupyter kernel and the Client to the Jupyter kernel run in separate processes as depicted below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/005-1_jHLLHjTjNWlV0e38GjvACw.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;The communication between the kernels and the client (ie the Jupyter-server) are done with inter-process communication via &lt;a href="https://zeromq.org/"&gt;ZeroMQ&lt;/a&gt;. But with JupyterLite the &lt;a href="https://jupyterlite.readthedocs.io/en/latest/"&gt;kernel runs directly in the browser&lt;/a&gt;. In that case, ZeroMQ is not required anymore to communicate with the frontend. This was the motivation for &lt;a href="/posts/2021/xeus-2-0/"&gt;Xeus 2.0&lt;/a&gt;, where it is possible to build Xeus without ZeroMQ. To implement JupyterLite Kernels with Xeus, we need to implement a custom Server which handles the &lt;a href="https://emscripten.org/"&gt;Emscripten&lt;/a&gt;/&lt;a href="https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html"&gt;Embind&lt;/a&gt;-based communication layer&lt;/p&gt;
&lt;p&gt;The overall architecture is best described with the picture below: The C++ Xeus-Kernel is compiled to WebAssembly with &lt;a href="https://emscripten.org/"&gt;Emscripten&lt;/a&gt; / &lt;a href="https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html"&gt;Embind&lt;/a&gt;. The WebAssembly compiled code runs in a dedicated WebWorker thread. The WebWorker communicates via Message Passing with a thin layer of TypeScript which implements the &lt;a href="https://github.com/jupyterlite/jupyterlite/blob/d94d472fcdfb5ce760820a6a9cd2c6ea6fc84014/packages/kernel/src/tokens.ts#L45"&gt;IKernel&lt;/a&gt; API of JupyterLite. The communication between JupyterLite and the JupyterLite k ernel is done entirely in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/006-1_AwkYyHKDxj0_EYitMAxZ5Q.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;The C++ code needed to compile an existing xeus-kernel to WebAssembly is very minimal:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/007-1_Qdv9gVF_oO9n2nLffY35SQ.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;p&gt;Furthermore one needs a thin layer of TypeScript / JavaScript to implement the JupyterLite &lt;a href="https://github.com/jupyterlite/jupyterlite/blob/d94d472fcdfb5ce760820a6a9cd2c6ea6fc84014/packages/kernel/src/tokens.ts#L45"&gt;IKernel API&lt;/a&gt;. A good example of this code is given in the &lt;a href="https://github.com/jupyterlite/xeus-lua-kernel"&gt;JupyterLite Xeus-Lua repository&lt;/a&gt;. While most of the repositories code is boilerplate, one needs to provide a simple &lt;a href="https://github.com/DerThorsten/jupyterlite_xeus_lua/blob/main/Dockerfile"&gt;Dockerfile&lt;/a&gt; which compiles the Xeus-Kernel to WebAssembly.&lt;/p&gt;
&lt;h2 id="xeus-lua"&gt;Xeus-Lua&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/jupyter-xeus/xeus-lua"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/008-1_XjZ84G9Ftb3krekpiqBuiw.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We recently released a &lt;a href="/posts/2021/from-jupyter-to-the-moon/"&gt;Xeus based Lua kernel.&lt;/a&gt; Even though its worthwhile to have Xeus-Lua kernel for vanilla Jupyter, the main purpose of Xeus-Lua was to experiment with Xeus-based JupyterLite kernels.&lt;br&gt;
We choose Lua as the first language to try out Xeus-based JupyterLite kernels since Lua is easy to compile to WebAssembly.&lt;br&gt;
A JupyterLite instance with Xeus-Lua included can be found &lt;a href="https://jupyterlite.github.io/demo/lab/"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Xeus-Lua has built in support for interactive widgets" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/009-1_Iwg6iPSZmr5o1ZozOlJXDQ.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Xeus-Lua has built in support for interactive widgets&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="xeus-wren"&gt;Xeus-Wren&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/DerThorsten/xeus-wren"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/010-1_AaO7Or9i6ZDmYR3PNGXh9Q.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Wren is relatively new “&lt;a href="https://wren.io/"&gt;Classy Little scripting Language&lt;/a&gt;” created by the author of the great book &lt;a href="https://craftinginterpreters.com/"&gt;“Crafting Interpreters”&lt;/a&gt;. Wren can be described with the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://wren.io/"&gt;Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern syntax.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We choose Wren as a second language to experiment with Xeus + JupyterLite since it is small, simple to compile to WebAssembly and easy to embed in C++. A JupyterLite instance with Xeus-Wren included can be found &lt;a href="https://jupyterlite.github.io/demo/lab?path=xeus-wren%2Fiwren.ipynb"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Xeus-Wren has built in support for displaying data of various MIME-types" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/xeus-lite/images/011-1_b-X9cmzXfq7NIXeEwfEzow.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Xeus-Wren has built in support for displaying data of various MIME-types&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="outlook"&gt;Outlook&lt;/h2&gt;
&lt;p&gt;There are many languages which can be compiled to WebAssembly like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Julia: &lt;a href="https://github.com/Keno/julia-wasm"&gt;https://github.com/Keno/julia-wasm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Octave: &lt;a href="https://news.ycombinator.com/item?id=22926120"&gt;https://news.ycombinator.com/item?id=22926120&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;C++: &lt;a href="https://github.com/binji/wasm-clang"&gt;https://github.com/binji/wasm-clang&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Python: &lt;a href="https://github.com/pyodide/pyodide"&gt;https://github.com/pyodide/pyodide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also databases as sqlite can be compiled to WebAssembly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sqlite: &lt;a href="https://github.com/sql-js/sql.js/"&gt;https://github.com/sql-js/sql.js/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our goal is to provide Xeus-based JupyterLite kernels for these projects to make the JupyterLite ecosystem even more powerful.&lt;/p&gt;
&lt;h2 id="acknowledgements"&gt;Acknowledgements&lt;/h2&gt;
&lt;p&gt;We like to thank&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/jtpio"&gt;Jeremy Tuloup&lt;/a&gt;, &lt;a href="https://twitter.com/mad_tandon"&gt;Madhur Tandon&lt;/a&gt;, &lt;a href="https://twitter.com/martinrenou"&gt;Martin Renou&lt;/a&gt;, and &lt;a href="https://github.com/bollwyvl"&gt;Nicholas Bollweg&lt;/a&gt; for their work on JupyterLite.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/johanmabille"&gt;Johan Mabille&lt;/a&gt; for Xeus and his help implementing the Xeus-Emscripten server.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="about-the-author"&gt;About the Author&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/thorstenbeier"&gt;Thorsten Beier&lt;/a&gt; is a Scientific Software Engineer at &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt;. Before joining &lt;a href="https://quantstack.net/"&gt;QuantStack&lt;/a&gt;, he graduated in computer science at the University of Heidelberg and worked at the &lt;a href="https://www.embl.org/"&gt;EMBL&lt;/a&gt;. As an open source developer, Thorsten worked on a variety of projects, from &lt;a href="https://github.com/DerThorsten/nifty"&gt;nifty&lt;/a&gt; and &lt;a href="https://github.com/ukoethe/vigra"&gt;vigra&lt;/a&gt; in C++ to &lt;a href="https://github.com/inferno-pytorch/inferno"&gt;inferno&lt;/a&gt;, &lt;a href="https://kipoi.org/"&gt;kipoi&lt;/a&gt; and &lt;a href="https://www.ilastik.org/"&gt;ilastik&lt;/a&gt; in Python.&lt;/p&gt;
</content><category term="kernels"/><category term="WebAssembly"/><category term="xeus"/></entry><entry><title>JupyterLite: Jupyter ❤️ WebAssembly ❤️ Python</title><link href="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/" rel="alternate"/><published>2021-07-13T09:11:00+00:00</published><updated>2021-07-13T09:11:00+00:00</updated><author><name>Jeremy Tuloup</name></author><id>tag:jasongrout.github.io,2021-07-13:/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/</id><summary type="html">&lt;p&gt;JupyterLite is a JupyterLab distribution that runs entirely in the web browser, backed by in-browser language kernels powered by…&lt;/p&gt;
</summary><content type="html">&lt;p&gt;JupyterLite is a JupyterLab distribution that runs entirely in the web browser, backed by in-browser language kernels.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/001-1_CMvcTaLSAD5A-WHCtnIFwA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
&lt;h2 id="motivation"&gt;Motivation&lt;/h2&gt;
&lt;p&gt;JupyterLite is a reboot of several attempts at making a full static Jupyter distribution that runs in the browser, without having to start the Python Jupyter Server on the host machine, usually done by running &lt;code&gt;jupyter lab&lt;/code&gt; or &lt;code&gt;jupyter notebook&lt;/code&gt; in a terminal.&lt;/p&gt;
&lt;p&gt;The goal of the project is to provide a lightweight computing environment accessible in a matter of seconds with a single click, in a web browser, and without having to install anything on the end-user device.&lt;/p&gt;
&lt;p&gt;With in-browser distributions, there is no need to provision the execution environment in the backend. Since the application is mostly a set of static files, it scales more easily, and it is also easier to deploy.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="JupyterLite running in the browser as a static website on ReadTheDocs" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/002-1_bR--bXsuiMIDz-D_V4BfLw.jpg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLite running in the browser as a static website on ReadTheDocs&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="a-full-jupyterlab-distribution-running-in-the-browser"&gt;A full JupyterLab distribution running in the browser&lt;/h2&gt;
&lt;p&gt;JupyterLite is built from the ground up, reusing many JupyterLab plugins and components as is.&lt;/p&gt;
&lt;p&gt;In addition to JupyterLab, JupyterLite also includes the &lt;a href="https://github.com/jupyterlab/retrolab"&gt;RetroLab&lt;/a&gt; interface by default:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="JupyterLite with the RetroLab interface" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/003-1_B1Se7Fe1JXBt2a1NjwRmxg.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLite with the RetroLab interface&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;By reusing JupyterLab components, JupyterLite benefits from many of the upstream improvements such as new features, accessibility fixes, and upkeep improvements. The &lt;a href="/posts/2021/how-we-made-jupyter-notebooks-collaborative-with-yjs/"&gt;recent work on real time collaboration&lt;/a&gt; coming in JupyterLab 3.1 and championed by &lt;a href="https://twitter.com/kevin_jahns"&gt;Kevin Jahns&lt;/a&gt;, &lt;a href="https://twitter.com/carlosHerreroB/"&gt;Carlos Herrero&lt;/a&gt;, and &lt;a href="https://twitter.com/echarles"&gt;Eric Charles&lt;/a&gt; can be enabled in JupyterLite too!&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Real Time Collaboration with JupyterLite on ReadTheDocs" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/004-1_HwMx3Fd6iICkWjjvUCtvwA.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Real Time Collaboration with JupyterLite on ReadTheDocs&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="pyolite-a-python-kernel-backed-by-pyodide"&gt;Pyolite, a Python kernel backed by Pyodide&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://pyodide.org"&gt;Pyodide&lt;/a&gt; consists of the CPython 3.8 interpreter compiled to WebAssembly which allows Python to run in the browser. Many popular scientific Python packages have also been compiled and made available. In addition, Pyodide can install any Python package with a pure Python wheel from the Python Package Index (PyPI). Pyodide also includes a comprehensive foreign function interface that exposes the ecosystem of Python packages to JavaScript and the browser user interface, including the DOM, to Python.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Pyodide: Python with the scientific stack, compiled to WebAssembly" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/005-1_usFUmvzRo6v8TuRFQhK0uw.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Pyodide: Python with the scientific stack, compiled to WebAssembly&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Currently at version &lt;a href="https://hacks.mozilla.org/2021/04/pyodide-spin-out-and-0-17-release/"&gt;0.17&lt;/a&gt;, Pyodide has benefited from many improvements over the past years: smaller binary size, support for &lt;code&gt;asyncio&lt;/code&gt;, and better type translations between Python and JavaScript.&lt;/p&gt;
&lt;p&gt;JupyterLite ships by default with &lt;code&gt;Pyolite&lt;/code&gt;, a Python kernel backed by Pyodide. Pyolite runs in a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API"&gt;Web Worker&lt;/a&gt; and thus doesn’t block the main UI thread when intensive computations are executed.&lt;/p&gt;
&lt;h2 id="ipython-in-the-browser"&gt;IPython in the browser&lt;/h2&gt;
&lt;p&gt;Thanks to the work by Madhur Tandon in this &lt;a href="https://github.com/jupyterlite/jupyterlite/pull/171"&gt;pull request&lt;/a&gt;, Pyolite is now powered by IPython. This provides access to magics, code completion, rich display, interactive widgets, and many other features.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Using IPython in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/006-1_2WBnuwRGkASGVNYUGjyPHg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Using IPython in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="interactive-visualization"&gt;Interactive Visualization&lt;/h2&gt;
&lt;p&gt;Many visualizations libraries such as &lt;a href="https://altair-viz.github.io/"&gt;Altair&lt;/a&gt; and &lt;a href="https://plotly.com/"&gt;Plotly&lt;/a&gt; are also supported in JupyterLite, allowing for quick and convenient figures and plots right in the browser:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Using Altair in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/007-1_SRr162bkckWsmoSMxVd2uQ.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Using Altair in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img alt="Creating Plotly figures in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/008-1_w7Y4wRz9h2OFMgm5MfdD0A.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Creating Plotly figures in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="support-for-jupyter-widgets"&gt;Support for Jupyter Widgets&lt;/h2&gt;
&lt;p&gt;Jupyter Widgets rely on the &lt;a href="https://jupyter-client.readthedocs.io/en/latest/messaging.html#custom-messages"&gt;Custom Messages specification of the Jupyter Protocol&lt;/a&gt; to send messages back and forth between the kernel and the frontend. This &lt;a href="https://github.com/jupyterlite/jupyterlite/pull/145"&gt;pull request&lt;/a&gt; by Martin Renou added support for Comms in the Pyolite kernel, which enabled many of the existing core and third-party Jupyter Widgets to work out of the box in JupyterLite such as &lt;a href="https://github.com/bqplot/bqplot"&gt;bqplot&lt;/a&gt;, &lt;a href="https://github.com/jupyter-widgets/ipyleaflet"&gt;ipyleaflet&lt;/a&gt; and &lt;a href="https://github.com/martinRenou/ipycanvas"&gt;ipycanvas&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="JupyterLite comes with support for Jupyter Widgets" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/009-1_c1DIbxS6bZ7bHDcOTEIJfg.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;JupyterLite comes with support for Jupyter Widgets&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="more-than-just-python"&gt;More than just Python&lt;/h2&gt;
&lt;p&gt;JupyterLite makes it possible to have plenty of other kernels also running in the browser. For now, the default distribution includes a JavaScript and a &lt;a href="https://p5js.org/"&gt;p5&lt;/a&gt; kernel:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Multiple kernels are available in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/010-1_5XFdmBdQWeONbRD3nuQe0A.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Multiple kernels are available in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Both the JavaScript and the p5 kernels run in an IFrame as the code execution sandbox. With the Jupyter display protocol, users can easily render custom animations in the browser:&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The p5.js kernel in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/011-1_kPYtSDP3aE5_M5AmDT-Uvw.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The p5.js kernel in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="highly-customizable"&gt;Highly Customizable&lt;/h2&gt;
&lt;p&gt;Just like many existing Jupyter tools, JupyterLite can easily be configured for custom needs.&lt;/p&gt;
&lt;p&gt;It supports the new &lt;a href="https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#prebuilt-extensions"&gt;JupyterLab prebuilt extension system&lt;/a&gt; added to the 3.0 release. Existing JupyterLab extensions can then easily be reused in JupyterLite too!&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="The JupyterLab Drawio extension running in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/012-1_69CnccBrufVEEU0wqE_f7Q.mp4" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;The JupyterLab Drawio extension running in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The in-browser server part of JupyterLite also follows a plugin-based approach. The server is a &lt;a href="https://github.com/jupyterlab/lumino"&gt;Lumino&lt;/a&gt; application without a shell and registers multiple plugins such as kernels, the contents manager or the sessions service. This plugin-based approach makes it very convenient for deployers and site administrators to swap a plugin for another one. For instance, they might want to swap the default contents manager that stores notebooks and files in the browser local storage with another plugin that would save them on AWS S3 instead.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Overview of the plugin-based architecture of JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/013-1_f7viaaS4SYTBpjA6DTPsDQ.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Overview of the plugin-based architecture of JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The modularity and flexibility of JupyterLite make it possible to easily add new kernels. For example, the Basthon kernel uses a slightly different execution model than Pyolite. It runs in the main UI thread so users can manipulate the main window DOM from within Python directly, while Pyolite runs in a Web Worker as a background thread. Both approaches have pros and cons, and the JupyterLite plugin system lets extension authors have full control over their kernels.&lt;/p&gt;
&lt;p&gt;A prototype for running Basthon in JupyterLite is being developed in the following repository: &lt;a href="https://framagit.org/casatir/basthon-jupyterlab/"&gt;https://framagit.org/casatir/basthon-jupyterlab/&lt;/a&gt;&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="Basthon in JupyterLite" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/014-1_mMmSo4GPx7rpxbMpyf-VAA.jpeg" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;Basthon in JupyterLite&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="deploying-jupyterlite"&gt;Deploying JupyterLite&lt;/h2&gt;
&lt;p&gt;JupyterLite can easily be deployed as a static website. That’s it, no server, no complicated setup, no scalability issue. Just a plain HTTP server to serve static files to users.&lt;/p&gt;
&lt;p&gt;This simple approach makes it possible to use a variety of options: nginx, &lt;a href="https://mybinder.org"&gt;Binder,&lt;/a&gt; GitHub Pages or GitLab Pages, Vercel, Netlify, and more. It can even be deployed to ReadTheDocs, which is where the default JupyterLite demo site is hosted and continuously updated.&lt;/p&gt;
&lt;p&gt;Many of the deployment scenarios are already documented in &lt;a href="https://jupyterlite.readthedocs.io/en/latest/deploying.html"&gt;https://jupyterlite.readthedocs.io/en/latest/deploying.html&lt;/a&gt;. There is also a demo template to easily deploy a custom JupyterLite website on GitHub Pages with a single click: &lt;a href="https://github.com/jupyterlite/demo"&gt;https://github.com/jupyterlite/demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks to the work by Nicholas Bollweg in this &lt;a href="https://github.com/jupyterlite/jupyterlite/pull/147"&gt;pull request&lt;/a&gt;, JupyterLite now offers a &lt;code&gt;jupyterlite&lt;/code&gt; &lt;a href="https://pypi.org/project/jupyterlite/"&gt;command line tool&lt;/a&gt; to make custom deployments much more convenient.&lt;/p&gt;
&lt;p&gt;One of the goals of JupyterLite is to let anyone build their custom distribution with the set of plugins and extensions they would like to use. For now, it requires using the &lt;code&gt;jupyterlite&lt;/code&gt; CLI, but we can imagine having a more user-friendly way of exporting a custom JupyterLite website.&lt;/p&gt;
&lt;figure&gt;
&lt;img alt="A mock-up for the JupyterLite Exporter" src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/015-1_LL_UkItjshAzsEEDB4cI2A.webp" loading="lazy" data-body-image=""&gt;
&lt;figcaption&gt;A mock-up for the JupyterLite Exporter&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="a-wide-range-of-use-cases"&gt;A wide range of use cases&lt;/h2&gt;
&lt;p&gt;With the ease of deployment and the low barrier to entry, JupyterLite is an excellent fit for a wide range of use cases.&lt;/p&gt;
&lt;p&gt;In the educational space, it simplifies access to teaching materials and computing environments. Teachers and students can focus on the content of their classes without worrying about server deployments and monitoring.&lt;/p&gt;
&lt;p&gt;With JupyterLite we also hope to enable the next wave of Jupyter users and make the whole ecosystem even more accessible to newcomers and the wider community.&lt;/p&gt;
&lt;p&gt;For simpler and smaller-scale projects, it could even help reduce the load on &lt;a href="https://mybinder.org"&gt;mybinder.org&lt;/a&gt; by having a &lt;a href="https://twitter.com/fperez_org/status/1385825172230262794"&gt;“binderlite” version of JupyterLite&lt;/a&gt; deployed on a CDN.&lt;/p&gt;
&lt;h2 id="try-it-online"&gt;Try it online&lt;/h2&gt;
&lt;p&gt;JupyterLite can easily be tested in a web browser using the following link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://jupyterlite.github.io/demo"&gt;https://jupyterlite.github.io/demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://jupyterlite.github.io/demo"&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/001-1_CMvcTaLSAD5A-WHCtnIFwA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="try-it-locally"&gt;Try it locally&lt;/h2&gt;
&lt;p&gt;JupyterLite can also be used locally. First, install the CLI package with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip install --pre jupyterlite
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, to build the JupyterLite website and serve it locally:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;jupyter lite init
jupyter lite build
jupyter lite serve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Check out the documentation for more information about the &lt;code&gt;jupyterlite&lt;/code&gt; command-line tool: &lt;a href="https://jupyterlite.readthedocs.io/en/latest/developer-guide.html"&gt;https://jupyterlite.readthedocs.io/en/latest/developer-guide.html&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="next-steps"&gt;Next steps&lt;/h2&gt;
&lt;p&gt;JupyterLite is still under active development, with a lot of improvements planned for the next iterations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Improve tooling for authoring custom in-browser kernels, reusing the JupyterLab federated (prebuilt) extension system.&lt;/li&gt;
&lt;li&gt;Improve the package management story in Pyodide with &lt;a href="https://github.com/mamba-org/mamba"&gt;mamba&lt;/a&gt; and the &lt;a href="https://github.com/conda-forge/conda-forge.github.io/issues/1401"&gt;conda-forge infrastructure&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Reuse the JupyterLite packages in other lab-based applications such as &lt;a href="https://github.com/voila-dashboards/voila"&gt;Voilà&lt;/a&gt;, &lt;a href="https://github.com/mamba-org/gator"&gt;Gator&lt;/a&gt;, and the &lt;a href="https://github.com/mamba-org/quetz-frontend"&gt;Quetz Frontend&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Provide more user-friendly tools to easily export a custom JupyterLite distribution.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="getting-involved"&gt;Getting involved&lt;/h2&gt;
&lt;p&gt;JupyterLite is under active development happening in:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the main repository: &lt;a href="https://github.com/jupyterlite/jupyterlite"&gt;https://github.com/jupyterlite/jupyterlite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;satellite repositories (kernels, demos) in the GitHub organization: &lt;a href="https://github.com/jupyterlite"&gt;https://github.com/jupyterlite&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="about-the-author"&gt;About the Author&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://twitter.com/jtpio"&gt;Jeremy Tuloup&lt;/a&gt; is a Scientific Software Developer at &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt; and a Jupyter Distinguished Contributor. Maintainer and contributor of JupyterLab, Voilà, and many projects within the Jupyter ecosystem.&lt;/p&gt;
&lt;h2 id="acknowledgments"&gt;Acknowledgments&lt;/h2&gt;
&lt;p&gt;We would like to acknowledge the previous work and the contributors who have worked on exploring the idea of Python in the notebook before us: &lt;a href="https://github.com/deathbeds/jyve"&gt;Jyve&lt;/a&gt;, the &lt;a href="https://github.com/iodide-project/iodide"&gt;Iodide notebook&lt;/a&gt;, &lt;a href="https://basthon.fr/"&gt;Basthon&lt;/a&gt;, and the &lt;a href="https://github.com/jtpio/p5-notebook"&gt;p5 notebook&lt;/a&gt;. It is also worth mentioning that similar projects exist outside of the Jupyter ecosystem, such as &lt;a href="https://observablehq.com"&gt;Observable&lt;/a&gt; and the &lt;a href="https://starboard.gg"&gt;Starboard Notebook&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We are grateful to &lt;a href="https://github.com/bollwyvl"&gt;Nicholas Bollweg&lt;/a&gt;, &lt;a href="https://twitter.com/mad_tandon"&gt;Madhur Tandon&lt;/a&gt;, &lt;a href="https://twitter.com/martinRenou"&gt;Martin Renou&lt;/a&gt; for their contributions to JupyterLite, to &lt;a href="https://twitter.com/RomanYurchak"&gt;Roman Yurchak&lt;/a&gt; and team for the work on Pyodide, Romain Casati for developing the Basthon kernel.&lt;/p&gt;
&lt;p&gt;The work on JupyterLite by Jeremy Tuloup, Madhur Tandon, and Martin Renou was funded by &lt;a href="https://twitter.com/QuantStack"&gt;QuantStack&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://jasongrout.github.io/medium-archive/pelican/posts/2021/jupyterlite-jupyter-webassembly-python/images/016-1_UY4k_mgLml9uvyo_EKMdFA.webp" alt="" loading="lazy" data-body-image=""&gt;&lt;/p&gt;
</content><category term="JupyterLite"/><category term="WebAssembly"/></entry></feed>