Email or username:

Password:

Forgot your password?
Gleb Zakharov

How is #REPL different from #shell ?

AFAU, the difference is that e.g. Bash is written in C, thus you can execute `ls` command, but cannot execute the body of `ls` function line by line.

But with REPL from any #Lisp you can execute both a function and every expression the function consists of.

Is this right?

It is the understanding I got from this thread:
softwareengineering.stackexcha

4 comments
Nicola

@snyssfx A repl offers introspection for the code environment, a shell generally doesn't

lispm

@snyssfx when you call "ls" in a shell, then it takes an executable file named "ls" in a search path. It calls the executable. Combining two executables could be done like by piping the output of "ls" into the input of "grep".

The REPL is a Lisp function, which read an s-expression (atoms and nested lists), evaluates it, prints the result as an s-expression and loops. By default any Function called by the evaluator is not an external program, but resides and executes in the same memory space.

Gleb Zakharov

@lispm got it, it looks like I can emulate part of REPL functionality on Bash if we are not considering the serialization part. And this is how shells in terminals works.

But differences arise when one need to change a runtime state of the program, for example. In Bash (and Unix) it can be done with signals, but it's just not flexible enough.

And also the difference is that REPL separates serialization and evaluation, and shells are not, and thus it's much harder to tinker with shells.

Go Up