Is Lisp the only language with REPL?

前端 未结 7 1880
失恋的感觉
失恋的感觉 2020-12-13 06:59

There are languages other than Lisp (ruby, scala) that say they use REPL (Read, Eval, Print, Loop), but it is unclear whether what is meant by REPL is the same as in Lisp. H

7条回答
  •  情话喂你
    2020-12-13 07:52

    How is Lisp REPL different from non-Lisp REPL?

    Let's compare Common Lisp's REPL with Python's IPython.

    The main two points are:

    • Lisp is an image-based language. There is no need to restart the process/the REPL/the whole app after a change. We compile our code function by function (with compiler warnings etc).
    • we don't loose state. Even more, when we update class definitions, our objects in the REPL are also updated, following rules we have control upon. That way we can hot-reload code in a running system.

    In Python, typically, you start IPython or you are dropped into ipdb. You define some data until you try out your new function. You edit your source, and you want to try again, so you quit IPython and you start the whole process again. In Lisp (Common Lisp mainly), not at all, it's all more interactive.

提交回复
热议问题