IPython Kernel for the Uiua programming language, crudely implemented as a python wrapper.
This is an experimental repo, and not currently part of the official Uiua project.
This repo is not ready for general use, although it does work, so only development instructions are provided; It requires that Rust and Cargo and Uiua have already been installed
git clone # ... url for this repo
cd # ... path to this repo
pip install -e .
jupyter kernelspec install ".\src\uiua_kernel" --user --log-level DEBUG
A Jupyter Kernel apparently cannot offer to format cell contents. This is still a language server feature, and it is not clear if it can be triggered on cell execution, like Uiua pad
I messed around with the python package ansi2html
but I'm pretty sure the colour codes just aren't in the output. Maybe they are there but they are getting lost somehow in the mysterious machinery of subprocess.Popen
.
I think uiua eval
detects if it is running in an interactive terminal, and if not, it
does not appear to output ansi colour codes. The eval
command offers a
--no-color
flag, but maybe it should also offer a --always-color
flag or something.
Currently this seems impossible; uiua eval
can only output a formatted text
stream.
The jupyter kernel apparently requires image data in a base64 encoded format. Perhaps uiua could output a JSON-formatted output to facilitate appropriate output rendering.
I did not try to connect this kernel wrapper to uiua repl
.
The repl also does not maintain the state of the stack between calls, so I am not sure if there is any reason to try?
It seems to me like the best way forward is to implement the kernel directly in
rust, this would be much easier than maintaining this python wrapper. The
zmq
crate and the
jupyter docs are a good
place to start, also a good example to work from might be the
evcxr is basically a jupyter kernel for the
rust programming language itself (Insane, I know, but its very cool).