4 ms·
Perhaps I've misunderstood, but several languages have REPLs so that isn't unique to Lisps, is it?
by Lyngbakr 3y ago
Perhaps I've misunderstood, but several languages have REPLs so that isn't unique to Lisps, is it?
- phyrex 3y agoThere’s very rarely any where you can actually interact with the running program. At best you can usually load in a method and poke it, but that’s not the same.
- Lyngbakr 3y agoSo, the REPL mentioned in the article differs from, say, the Julia REPL[0]? Is it simply using the same term for slightly different things? [0] https://docs.julialang.org/en/v1/stdlib/REPL/ https://docs.julialang.org/en/v1/stdlib/REPL/
- selimthegrim 3y agoThe Julia REPL front end is written in Scheme IIRC
- sundarurfriend 3y agoI believe it's Julia's current default parser that's written in a Scheme, the REPL is a normal Julia standard library written in Julia itself: https://github.com/JuliaLang/julia/blob/master/stdlib/REPL/src/ https://github.com/JuliaLang/julia/blob/master/stdlib/REPL/s...
- adgjlsfhk1 3y agoalso we are very close to moving Julia's parsing (but not lowering) to pure Julia as well.
- selimthegrim 3y agoOK thanks for the correction!
- sundarurfriend 3y agoOne of the other comments in this thread links to: https://mikelevins.github.io/posts/2020-12-18-repl-driven/ https://mikelevins.github.io/posts/2020-12-18-repl-driven/ which makes a distinction between "having a REPL" and "supporting repl-driven programming". Modern languages which have a REPL generally don't support the sort of repl-driven programming they refer to. Julia's Revise.jl [1] supports one way of repl-driven programming, and it is in fact the recommended way of doing Julia, but from my understanding it's still very different from the Lisp ways. [1] https://timholy.github.io/Revise.jl/stable/ https://timholy.github.io/Revise.jl/stable/
- fsckboy 3y agothat would suggest it's an "enduring innovation" as per the question
- Lyngbakr 3y agoBut the previous post argues that the article is about "lisp features that still make it unique".
- schemescape 3y agoThis blog post explains the sort of workflow a Lisp/Smalltalk-style REPL enables: https://mikelevins.github.io/posts/2020-12-18-repl-driven/ https://mikelevins.github.io/posts/2020-12-18-repl-driven/
- Lyngbakr 3y agoThat is exactly the clarification I needed. Thanks!
- askvictor 3y agoInteresting; when you define a function (or anything) in a breakloop, does it get saved to source? (or is there an option to?) I'm trying to imagine using this style of programming in Python, but the type-redefinition problem is still there
- schemescape 3y agoMy understanding is that you usually write the code in your editor and use an editor command to send the code directly to the Lisp process (that’s what I do, anyway). Or just copy-paste. I’m not aware of a way to get code back out of the Lisp environment, but I’m fairly new to all this.
- lispm 3y agoSometimes a break-loop is all you have. But usually there is something around it. Typically a Lisp system can run several REPLs at the same time, one might be a break loop. You can define a function in another REPL and use it in the break-loop. You can define the function by loading code in a break-loop. An interaction might be (here in LispWorks): CL-USER 6 > (> (sin-x2 3) 0) Error: Undefined operator SIN-X2 in form (SIN-X2 3). 1 (continue) Try invoking SIN-X2 again. 2 Return some values from the form (SIN-X2 3). 3 Try invoking something other than SIN-X2 with the same arguments. 4 Set the symbol-function of SIN-X2 to another function. 5 Set the macro-function of SIN-X2 to another function. 6 (abort) Return to top loop level 0. Type :b for backtrace or :c <option number> to proceed. Type :bug-form "<subject>" for a bug report template or :? for other options. CL-USER 7 : 1 > (load "~/sin-x2.lisp") ; Loading text file /Users/foo/sin-x2.lisp #P"/Users/foo/sin-x2.lisp" CL-USER 8 : 1 > :c 1 T A function SIN-X2 does not exist. There is an error and we get a break-loop. The break-loop is one level deep. All of Lisp is available in a break-loop: the compiler, the code loader, the evaluator, ... Lisp stays with the break-loop in the context of the error. I define/write the function in a file and the load the file. Loading the makes the function available in the running Lisp. Then I use the continue restart to try to find the function again -> the error is gone