Has anyone seen an implementation of a structural ...
# thinking-together
p
Has anyone seen an implementation of a structural REPL? Structural Editors are great but is there something that could be both structural and a repl. I'd love to be able to open a structural repl at a point in my program and investigate at that point.
k
Does Scratch feel like a structural repl? If so, there's also this unreleased project for Python: https://futureofcoding.slack.com/archives/C5U3SEW6A/p1650580496430299?thread_ts=1650580496.430299&cid=C5U3SEW6A I don't follow your last sentence, though.
j
Paredit is a structural editor for lisp-like languages in Emacs, which combines well with support for scheme, clojure, &c, to give you this experience. There are a couple of in-progress projects using treesitter to give similar superpowers for infix languages...
k
Oh hey, I came here to mention what we’re doing with splootcode but it’s already mentioned! The goal is to get all the benefit of a REPL without the downsides.
w
I'd say Scratch feels REPLy since you can click on a stack of blocks to execute them.
Including unused ones in the tray.
p
@Katie Bell what are the downsides of a REPL you are trying to avoid with your approach
Where did the name splootcode come from
@Katie Bell have joined the waitlist, are there any video etc in the meantime
k
The downside of a repl is mostly that you need to type whole statements every time - a typo is mildly irritating to fix in one line of code but if you write a loop or a function, then re-building it is annoying. You can't just go back and edit the code, you might have to hit the up arrow keys many times to find it. Then once you've iterated on the code you want to write, you need to copy paste it back into your code. I'm not saying repls are bad - I just want the code editor to have that level of insight into the code all the time without having to switch into a repl at all. :)
w
And as a not-so-proud user of a readline implemented REPL, each line is separately remembered. So if I make the mistake of trying to enter four lines and line three is incorrect, then the fix is: up arrow, up arrow, up arrow, up arrow, return, up arrow, up arrow, up arrow, up arrow, return, up arrow, up arrow, up arrow, up arrow, fix the mispelling, return, up arrow, up arrow, up arrow, up arrow, return. Of course this always happens when I'm in the thick of something and not at all interested in improving my tools.
j
Teletype REPLs were fine back when we had teletype hardware. Using one today — when we can have in-place evaluation in our editors — is, IMO, completely mad.
💯 1
🐺 1
w
Quicker, easier, more seductive.
y
This video has 4 short demos from such projects:

https://youtu.be/Q61dh87WGrE

(Lamdu, Dark, Hazel, Lisperanto)
o
my project is Lisperanto https://uprun.github.io/lisperanto/ , but as soon as you create any structural editor you can keep track of changes in the code and refresh function calls whenever there is a change, propagating it to the root calls for me it is a special Sandbox function