Is there an example of a minimal subset of jupyter_client in c?

I’m working on a python3 interpreter plugin for MaxMSP (GitHub - shakfu/py-js: Simple (and extensible) python3 externals for maxmsp) implemented with the python c-api. While it works ok, one of the intractable problems is related to the proper unloading of c-extensions such as numpy. Basically I can use a c-extension but I have to restart the host application if I call Py_FinalizeEx(). I think this is almost a deal-breaker for some.

Thinking how Jupyter solves these issues, I’ve been considering whether it would be possible to implement a very basic client / frontend at the Max/MSP side which communicates with a python (to non-Python) kernel using Jupyter protocols. This would be implemented in c or c++ or in pure python (as far as I remember pyzmq has a c-extension dependency so that could cause problems).

I would appreciate any advice or guidance as to whether this is a good idea to begin with and if so any pointers and/or example to help me get started.


Not sure if this helps, but GitHub - jupyter-xeus/xeus: Implementation of the Jupyter kernel protocol in C++ “is a library meant to facilitate the implementation of kernels for Jupyter”, written in C++.

Thanks for your recommendation. I had glanced through the xeus tutorial earlier and I had the impression that their focus was on the kernel side, but I’ll check them more closely in case they have client code as well.