jupyterlite icon indicating copy to clipboard operation
jupyterlite copied to clipboard

Support for Rust kernels - EvCxR

Open nuke-web3 opened this issue 2 years ago • 2 comments

Problem

I would love to use jupyterlite with the https://github.com/google/evcxr/ Rust kernel :star_struck:

Proposed Solution

I am new here, so don't know the complexities of trying to get this incorporated, but would be very interesting in knowing what would need to be done to manage it!

Additional context

Rust compilation can get really resource intensive! So if it were incorporated, using as much as possible "bare-metal" build tooling, perhaps a required install of rust's toolchain to call from the browser instead of the compilation all handled in browser :grimacing: that wold make most use cases for non-trivial crate (package) use very limited.

Also relatedly, the build artifacts would be best persisted even between kernel restarts, if that could be possible in some way here, that could be much more ideal for non-trivial crates.

nuke-web3 avatar Jun 07 '22 03:06 nuke-web3

Thanks @NukeManDan for the suggestion.

Indeed it would be great to use Rust in JupyterLite!

Although probably this would require some changes to evcxr so it can be compiled to WebAssembly. Quickly looking at the source they seem to depend on zmq which might not work in the browser: https://github.com/google/evcxr/blob/6ae01aac84f6733c2ba3731a975486415500723a/evcxr_jupyter/Cargo.toml#L16

For reference xeus had to make some underlying changes to be able to compile the kernels to WebAssembly.

jtpio avatar Jun 07 '22 07:06 jtpio

Right: the best hope in this case would be to get the upstream kernel authors interested in a WASM build of the core of their feature set (and dependencies) so that a jupyterlite-kernel-rust was a webpack-only kind of thing. Of course, better would be a full kernel, so that they could have pretty browser demos: the rust crowd are often quite amenable to this, as their build chain is comparatively good, vs. scientific python which is still rather nascent (pyodide and friends are only about 5 years old). But good integration with jupytelite is still a moving target, and comes with lots of opinions.

To that point: on this main repo, we're actively trying to shed kernel complexity, as we're already doing the job of both jupyterlab, jupyter_server, jupyter_client, etc. In-browser compilation is probably a non-starter, and indeed, in-browser installation might even be too hard: while pyolite supports limited installation via piplite, xeus-python doesn't, to my knowledge.

bollwyvl avatar Jun 07 '22 13:06 bollwyvl