Hacker News new | past | comments | ask | show | jobs | submit login
REPL + Debugger = REPLugger: a pleasant and scalable live code editor (tinyletter.com)
97 points by Glench on Sept 6, 2018 | hide | past | favorite | 26 comments



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


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.


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.


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.


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.


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


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.


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.


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


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.


> 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.


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.


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


I do Python for my day job, and that's definitely something I miss. The REPL experience of Clojure + CIDER is incredible.


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)

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

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


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


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.


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/...


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.


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


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


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.


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.


This reminds me of Rebugger.jl

https://timholy.github.io/Rebugger.jl/stable/


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.


Nice work! Really love the concept.




Consider applying for YC's first-ever Fall batch! Applications are open till Aug 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: