3 ms·
REPL is a Read Eval Print Loop, which is a way to interact with a Lisp runtime. This is independent on how EVAL is implemented. A bunch of Lisp systems implemen
by lispm 4y ago
REPL is a Read Eval Print Loop, which is a way to interact with a Lisp runtime. This is independent on how EVAL is implemented. A bunch of Lisp systems implement EVAL with an incremental compiler.
An interpreter is a Lisp feature where code gets interpreted from source at runtime. Some implementations have one, some don't, some only have an interpreter, some only have a compiler, some have several compilers, some have both.
> running sbcl without the REPL and produce an executable binary file
The executable binary file in SBCL always includes the compiler.
REPL: a user interface to execute Lisp code. Reads s-expressions, evaluates them and prints the results as s-expressions.
EVAL: the interface to execute code. A function.
Interpreter: an implementation of Lisp which interprets source code.
Byte Code Interpreter: an implementation of Lisp which interprets byte code instructions.
Compiler: an implementation of Lisp which can compile code to a) byte code, b) C code, c) machine code
In-memory compiler: an implementation of Lisp where the compiler does not create files, but writes the executable code directly to RAM
Whole-Program compiler: an implementation of Lisp, which only compiles whole programs and creates executables -> rare, but various examples exists
- terminalcommand 4y agoThank you for taking the time to explain. I now get it. SBCL includes the compiler in each binary and this is called incremental compiling. That explains the expressiveness. It is kind of like a JIT when needed. Compile everything you can AoT, leave dynamic parts to runtime compilation. It makes perfect sense. Thanks . I guess the difference is that in an interpreter you don't go down to assembly, you parse and run stuff. The moment you cross the line to generate bytecode/machine code or transpile into a different language you get a compiler.
- lispm 4y agoBasically all SBCL code is pre-compiled. There is mostly no runtime compilation happening. Only if the user/developer actually wants it. For example one can connect to a running SBCL and have one or more networked REPLs into it.