
REPL + Debugger = REPLugger: a pleasant and scalable live code editor - Glench
https://tinyletter.com/Flowsheets/letters/repl-debugger-replugger-a-pleasant-and-scalable-live-code-editor
======
VectorLock
I like this idea a lot. I've been thinking a lot lately how great it would be
to have something like Flowsheets where you have a spreadsheet and language
working together. This REPlugger closely matches a lot of how I end up writing
code, with putting things over and over again into the REPL and seeing how
they worked. I always wanted a REPL that could edit better. This is very cool
and I think could be amazingly useful.

Edit: Found the github link in the video description:
[https://github.com/Glench/REPLugger](https://github.com/Glench/REPLugger)

~~~
taeric
As noted in another post, this is how some languages were basically designed
to be used. I'll challenge that you can't just claim it is lisp. Common lisp,
though, is a solid model for this method of development.

~~~
VectorLock
Yes it does feel like Smalltalk and Scheme. I never really liked Lisp (I feel
like a heretic saying that on HN) but having this for Python of JavaScript
would be infinitely more useful to me.

~~~
Royalaid
I would be curious to hear why. Where I work currently is full stack Clojure
and I love it but have a few gripes (refactoring can be a pain) but overall it
feels like a huge boon.

~~~
VectorLock
Available libraries, developer talent pool, and support of Python is much
greater.

And personally I much prefer the syntax of Python and developing in it.

~~~
taeric
Greater is subjective. Larger and more visible, I'd agree with.

------
agentultra
This is basically how Lisp and Smalltalk work. You write the function you want
to use. The system puts you into a debugger. You debug your program until it
starts running. I wish I had this environment in more languages like Haskell.

~~~
taeric
Except it isn't really a debugger. It is just a repl in the environment you
have constructed. The difference is most debuggers don't let you do as much as
these would let you do.

Well, _a_ difference. There are others.

~~~
jlg23
What exactly are you missing and what are the other differences?

~~~
taeric
Kind of hard to fully explain. With a debugger, you can typically only analyze
variables on the stack. You can, of course, step over lines and such. However,
with the live coding languages, you can literally redefine the function that
is causing grief. More, you can, on the fly, define a new helper function that
it should call to handle the current input causing trouble and redefine the
method to call over to that.

People have come closer than I give credit in Java land doing this. I've never
seen anyone else come close, though.

I think most any dynamic language _should_ be able to do this. Most can't,
though, due to serious limitations on what can be redefined and what cannot.

~~~
jlg23
> However, with the live coding languages, you can literally redefine the
> function that is causing grief. More, you can, on the fly, define a new
> helper function that it should call to handle the current input causing
> trouble and redefine the method to call over to that.

"This is basically how Lisp and Smalltalk work.", as agentultra commented
further up in this thread.

------
swlkr
This is exactly why like programming with clojure, the REPL and the editor are
the same thing, so you can send + execute code in the REPL from the editor. In
practice, I'm never typing anything directly into the REPL, which is in
contrast to say something like rails' console.

~~~
xfer
It works in almost all repls.. I do the same in emacs with ocaml, racket,
haskell etc.

------
grierson
Stuart Halloway from the Clojure community has some great a talks using the
REPL to debug.

Links:

Debugging with the Scientific Method - Stuart Halloway
([https://www.youtube.com/watch?v=FihU5JxmnBg](https://www.youtube.com/watch?v=FihU5JxmnBg))

REPL DEBUGGING: NO STACKTRACE REQUIRED
([http://blog.cognitect.com/blog/2017/6/5/repl-debugging-no-
st...](http://blog.cognitect.com/blog/2017/6/5/repl-debugging-no-stacktrace-
required))

scope-capture ([https://github.com/vvvvalvalval/scope-
capture](https://github.com/vvvvalvalval/scope-capture))

------
rabidrat
This is a really cool project, and reminds me of Bret Victor's Inventing On
Principle[0] talk--which makes sense, because Glen has worked with Bret on
Dynamicland.

These tools are made for beginners, but even though I'm not a beginner, I wish
I could use these kinds of tools within my existing coding workflow. But I
just can't use an editor/debugger that requires a mouse anymore.

[0] [https://vimeo.com/36579366#t=1085s](https://vimeo.com/36579366#t=1085s)

------
abecedarius
Sounds intriguing, though I'd appreciate a summary that's not a 10-minute
video. This post describes the problem and context but not a lot about the
solution.

------
amasad
I've always thought of the Visual Studio's Immediate Window as a repl +
debugger.

It's what got me hooked on repls back when I was coding in VB4.

[https://docs.microsoft.com/en-
us/visualstudio/ide/reference/...](https://docs.microsoft.com/en-
us/visualstudio/ide/reference/immediate-window?view=vs-2017)

------
coder543
It would have been nice for it to say "JavaScript" in the title of the blog
post, anywhere in the blog post, or in the title of the video. That's what I
suspected, but I had to scrub through the video just to confirm, which is
probably more effort than most people would be willing to put in.

~~~
Glench
While I showed REPLugger with a JavaScript program I wrote, the principles
apply to any language, even compiled ones (if they compile fast enough).

~~~
alanbernstein
How much effort is it to create a version for another language? Say, python?

~~~
Glench
As I said near the end of the video, this is a research project meant to
demonstrate the concept and a lot of engineering would need to be done to make
it work generically. If a small team were to tackle the project, I estimate it
would take about 2-3 years of effort.

That said, I prefer Python and only used JavaScript in the video because I had
a large project done in JS that I wanted to validate the idea against to make
sure it wouldn't just work for toy programs.

------
rmetzler
This looks very nice indeed, and I wish there would be something like that for
Go or Ruby.

The only minor nitpick I have is the layout of the interface. I would think
having the output below the editor would reduce eye movement necessary.

------
eigenspace
This reminds me of Rebugger.jl

[https://timholy.github.io/Rebugger.jl/stable/](https://timholy.github.io/Rebugger.jl/stable/)

------
superasn
Great idea. Would love a small writeup explaining the stuff happening under
the hood and the challenges faced by you and the workarounds you came up with
to make it work.

------
convivialdingo
Nice work! Really love the concept.

