Janet REPL
General-Purpose GraphicalJanet REPL in the image of Self and gtoolkit.
I'll try to make this a much better REPL than the terminal one (janet
).
This program is developed together with dvui.
Building
To run the program, run zig build run -- imgfile
with Zig 0.11.0. (If you use wayland, set environment variable SDL_VIDEODRIVER=wayland
.)
How it works
Knowledge of Janet is required.
- Write code in the text field.
- "Do It" executes the code in text field.
- "Get It" executes the code and give the result a name.
- Pressing Enter at the end of text field = "Get It".
- Each top-level definition (
def
,var
) that starts with_
will be a window._
is a special variable that represents current object/window (when writing code in the text field). - The window shows object representation live.
Caveat
- cfunction cannot be persisted. imported library might have cfunction.
To do
- unique
def
for each window/object (all starts with_
) - closable windows (delete variable on close)
- "Do it" and "Get it"
- unclosable root window with demo window toggle
- persist env to file
- different view tabs (like in gtoolkit)
- Define view protocol (like
{_ :dview}
) - "broadcast variable name" button (via subscription system in Janet)
- open Janet REPL on stdin
- auto persist?
- clean up
Wild thoughts, but probably out of scope.
- support Python and IPython display protocol