What makes a repl?

Опубликовано: 03 Май 2026
на канале: Eric Normand
984
24

There's a lot of discussion on Twitter about whether Node has a repl or Python has a repl. Do they have repls? How can we tell? Well, my opinion is that what's important is how it's used, not a set of features.

►► Audio, Video, and Transcript available: https://lispcast.com/what-makes-a-repl/
►► Subscribe on iTunes: https://itunes.apple.com/us/podcast/t...

Transcript

What makes a REPL a REPL? Does your language have a REPL? Does language X have a REPL?

My name is Eric Normand. I help people thrive with functional programming. There's a lot of debate on Twitter right now, about whether Node has a REPL or Python has a REPL.

I see a lot of Lispers, Clojurists, common Lispers, schemers, replying and telling them, "No, it's not really a REPL." There's a lot of outcry from both sides. Are these Lispers being smug like they always are? Do they have a point? Remember, they can't explain themselves.

I use the Python prompt all the time. Isn't that a REPL? What makes a REPL anyway? I don't want to get into semantics. I don't want to talk about what makes a REPL. It's not about a list of features like, if a REPL can do X, Y, Z, if it can reload code in a running server, or whether it's got a prompt or a printer.

I don't want to go into those details. It might be important, but it doesn't interest me. They can hash that out and other people can. What I want to talk about is the qualitative difference in the workflow between languages with...

Let me just be very, very clear between Lisps [laughs] and everything else. There might be other languages with good REPLs. I'm not trying to be so strict that it's only Lisps have good REPLs. I'm not familiar with the other languages. You could say Fourth has a REPL. I don't know. I've never done it. I've never seen someone program in fourth, so I can't really say.

Smalltalk has a good interactive development. Is it a REPL? I don't know. I've never used Smalltalk. I can't really say. What I'm saying is, what makes Lisp special versus all the languages that I've tried. I'm talking about Java. Java now has something they call a REPL. JavaScript, they call it a REPL. Python has a REPL. Ruby has a REPL.

Haven't done much Ruby, but I've seen it. I can generalize about it. What is the difference? That's what I want to get into. I don't want to mince words. Not saying that X, Y, Z language that I've never used doesn't have a REPL.

What I want to talk about is this qualitative difference in the workflow from what I've seen in some languages versus what's very common in Lisp. That's what I'm trying to talk about. Here's the difference. When you're programming in Lisp, you've got enough experience. You have to be good enough at Lisp.

People execute code in the REPL continuously. I'm talking about if they're deep in it, they're executing their code like every 10 seconds. They type something in, execute. Type something in, execute. Type something in, execute. It's a very, very interactive experience of programming in Lisp.

This is what we call REPL-driven Development. To give it a name, that you're very involved in this running system, or you're writing some code, and then executing it and seeing what it does, and doing a little experiment. Does my code even compile right now?

It's very similar to what I've seen in the Ruby community because they're really good at this is TDD, Test-driven Development, where you make a change, you run your tests. You make a change, you run your tests. You make a change, you run your tests.

The difference is the tests are this giant suite of tests. Then the REPL, it is a live system with all your code loaded and you're now compiling or executing one small piece again or a large piece, depending. You can execute different sizes and things. It's not running tests. It is executing whatever code you want to execute.

Usually, it's what you're working on. You're editing a function, recompile the function. Editing a function, recompile the function. Did I do what I need to do? Let me test this function out myself manually. Let me add this a little bit to the function and compile it.

There's a lot of stuff going on back and forth between you and then the REPL. What I think the difference is, I can't boil it down to features. If you had this, then it's a REPL, and REPL-driven development is possible.

What I can say is that, Lisp REPLs are designed for that. They are designed for this back and forth continuously, like 10 second increments of feedback. They've been optimized for that, for the past 60 years. That's the difference. It's not this feature or that feature. It's that any sharp edges, any obstacles have been removed.