6

Xeus 2.0

 2 years ago
source link: https://blog.jupyter.org/xeus-2-0-cb460d4daed4
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Announcing a major release of the Xeus library

We have just released Xeus 2. This is a major release of the library. While it includes backward-incompatible changes, they are very limited and upgrading your kernels should be relatively easy.

How to upgrade Xeus-based kernels

Let’s illustrate that with the code of a simple kernel before and after upgrading to Version 2. Most typically, only the kernel’s main file will have to be updated:

The first change is that you now have to instantiate and pass an additional argument to the kernel constructor: the context. Fortunately, Xeus provides a function to build such a context object, making the update straightforward. We will detail the reason for this change in the next section.

The second change is that the kernel constructor now requires a function to build the server while a default value was provided for it in Xeus 1.x. Again, the motivations for this change will be detailed in the next section. Finally the functions for building the servers have moved to different headers.

To summarize, here is the list of the breaking changes:

  • The kernel’s constructor now requires an additional argument, the context. Xeus provides a function to easily instantiate it.
  • The order of kernel’s constructor arguments has changed, and the function for building the server is now required.
  • The functions for building the servers have moved to the headers where the corresponding servers are defined.

Motivation for these changes

When we created Xeus, kernels were expected to run in separate processes. The communication between the kernels and the client was achieved with the ZeroMQ middleware framework, and it was natural to heavily rely on it in Xeus.

Recent developments have pushed in a different direction, where the kernel can run directly in the browser. In that case, a middleware library is not required anymore to communicate with the frontend. The architecture of Xeus was not suitable for this new kind of kernels. An update was required so that it is possible to build Xeus without the dependency on ZeroMQ.

About the developers

0*tHIyMRx_JbgkU2xy.jpeg?q=20
xeus-2-0-cb460d4daed4

Johan Mabille is a scientific software developer at QuantStack. Johan is a co-author of Xeus, and developed the debugger extension to xeus-python.

0*zUMSbNcno1BZSfjO.jpeg?q=20
xeus-2-0-cb460d4daed4

Sylvain Corlay is the founder and CEO of QuantStack, and a core Jupyter developer. He co-authored Xeus and xeus-python.

1*kGCA9WV-Gf5tiNqqy9vTMQ.png?q=20
xeus-2-0-cb460d4daed4

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK