4 ms·
> People rave about their repl, but it feels like they're comparing it to a script iteration loop rather than static analysis tooling. You do know that statica
by ReleaseCandidat 5y ago
> People rave about their repl, but it feels like they're comparing it to a script iteration loop rather than static analysis tooling.
You do know that statically typed languages have REPLs too? Like the ML family, including Haskell.
And when using something like a Jupyter notebook with a kernel for your compiled language
https://github.com/gopherdata/gophernotes https://github.com/gopherdata/gophernotes
you can do similar interactive programming.
REPLs are about trying out ideas or changes.
Lisp REPLs take that a step further, as you interact with and in your whole actually running program.
- throwaway894345 5y ago> You do know that statically typed languages have REPLs too? Like the ML family, including Haskell. I do, but that I don't see how that relates to the bit of my post which you've quoted. I certainly didn't claim or imply that REPL and static type systems were mutually exclusive, only that REPLs are a poor substitute for many static analysis tasks. > And when using something like a Jupyter notebook with a kernel for your compiled language https://github.com/gopherdata/gophernotes https://github.com/gopherdata/gophernotes you can do similar interactive programming. Yeah, I'm aware. I operate a large JupyterHub cluster (among many other things) at work. :) > Lisp REPLs take that a step further, as you interact with and in your whole actually running program. That sounds nice, but it's too abstract to persuade IMHO. Personally, it seems like REPLs can make certain feedback loops a bit faster, and to that extent they seem like a modest quality of life improvement; however, considering how lisp folks positively rave about them, I assume I'm missing something.
- ReleaseCandidat 5y ago> that REPLs are a poor substitute for many static analysis tasks. Maybe I should have asked you what you use the REPLs of statically typed languages for. I actually never used REPLs for that (neither in Python, CL, Clojurescript nor Elixir). > That sounds nice, but it's too abstract to persuade IMHO. Of course it is. I also didn't get it until I've tried it myself. That actually has been the main cause why I tried (Common) Lisp at all (well I had been using Emacs Lisp before, but that doesn't really count ;).
- FPGAhacker 5y agoI use repls a lot, both when I used clojure and now when I mainly use python. The reason for me is language exploration. I write my program and don’t always know how to do something and the internet is ambiguous. With a nice repl I can rapidly iterate trying different things and doing micro in-situ experiments to explore and understand how the language (or library more frequently) works. It’s very edifying.
- throwaway894345 5y ago> Maybe I should have asked you what you use the REPLs of statically typed languages for. I don't really use them, which is kind of my point. Once in a great while I'll do some quick testing in the rare case that using a REPL is actually faster than just running the program, but to even call that a marginal improvement in my quality of life would risk overemphasis.
- dunefox 5y ago> I assume I'm missing something. You are indeed, Rackets REPL is very barebones. Use Common Lisp with either SLime or Sly and Emacs.
- igouy 5y ago> You are indeed… How puzzling that you do not spell-out exactly what you believe they are missing.
- dunefox 5y agoIt should be obvious? He uses Racket, Racket has a very simple REPL, as opposed to CL which allows him to use the features he has heard mentioned about Lisp. Interactivity, short feedback loop, etc. This has been written thousands of times on here, I don't intend to repeat it here.
- CodeGlitch 5y ago> Lisp REPLs take that a step further, as you interact with and in your whole actually running program With python, I can add a signal callback which calls the inbuilt breakpoint() function. This means I can send my application a given signal, let's say SIGTERM, and it'll drop into they python debugger whereby I can then drop further into the python REPL. Does Lisp provide more than that out of interest? Edit: ah I see hot reloading is a thing. Not explored that in python.
- brabel 5y agoYes, it was mentioned in the post: you normally get prompted not just when there's a breakpoint, but when your code calls something that doesn't yet exist, for example, or try to access a non-defined variable [1]... you have the option to "fix" the issue and continue from the same point, continue with a different value, or just let it crash... and there's stuff like profiling and de-compiling [2] which are all available directly from the REPL as well. [1] https://lispcookbook.github.io/cl-cookbook/debugging.html https://lispcookbook.github.io/cl-cookbook/debugging.html [2] https://lispcookbook.github.io/cl-cookbook/performance.html https://lispcookbook.github.io/cl-cookbook/performance.html
- ekidd 5y agoMany early Common Lisp systems had impressive error handling. Certain exceptions would automatically break to an interactive Lisp window. But Common Lisp also has a fancy system for recovering from exceptions. So after you replaced the broken function, you'd often see a list of "restart" points from where you could retry a failed operation. So even if you failed in the middle of a complex operation, you could test out a fix without needing to abandon the entire operation in progress. I'm not entirely certain if this was as useful as it sounds, in practice, but it was certainly very impressive.
- retzkek 5y agoThere was a book published just last year about the CL condition system for anyone who wants to better understand it (disclaimer: it's sitting on my desk but I haven't read it yet): https://link.springer.com/book/10.1007/978-1-4842-6134-7 https://link.springer.com/book/10.1007/978-1-4842-6134-7