Jupyter replacement - Programming On Unix

Users browsing this thread: 1 Guest(s)
piotr
Members
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


Messages In This Thread
Jupyter replacement - by piotr - 28-06-2019, 12:19 PM
RE: Jupyter replacement - by z3bra - 29-06-2019, 01:49 AM
RE: Jupyter replacement - by piotr - 01-07-2019, 10:34 AM
RE: Jupyter replacement - by josuah - 12-01-2020, 08:39 PM
RE: Jupyter replacement - by z3bra - 14-01-2020, 11:15 AM