Jupyter replacement - Programming On Unix
piotr
I am pretty much vendor-locked with Jupyter at work, and while I enjoy some of its' perks (load data once & experiment with it, more structured than append-only REPLs), I find it quite big, easy to break, diffcult to install & manage, and inconvenient (editor is literally an HTML textarea).

I started working on a simple replacement in C which would only do 3 things:

1. open a background interactive process
2. pipe stdin to it from a named pipe
3. pipe stdout from it to another named pipe

So similar design to suckless ii. This has some advantages:

- you can now work from $EDITOR and just send lines / blocks to the interpreter of choice
- no more "Jupyter kernels", as it should work with any process

The issue is, only steps 2 and 3 are working (through the fork / exec / dup2 magic!); I have been stuck at keeping the process running -- the interpreters exit immediately after the first command is executed.

I suppose I could use /proc filesystem API, but I'd rather make it Unix, not just Linux friendly.

Does anyone know if something similar has been done before? And do you have any tips on how to proceed?

Here is all 40 lines of it: http://0x0.st/z2C3.c, runs with "./z2C3 bc" (or sh, or python, etc…).

EDIT: you'll need to mkfifo {in,out} before running
z3bra
What's jupyter? Some sort of online wiki?
piotr
Ah sorry -- it's quite popular in my line of work so I forgot it needs introduction.

Jupyter is a notebook-interface to a scripting language. It has a frontend (usually a browser interface) and a backend (an interpreter process), linked by some message queue. It is similar to a REPL, but it is not append-only -- you can insert code into separate "cells", and then edit & re-run them.




Members  |  Stats  |  Night Mode