Read, Evaluate, Print


reptile

Reptile • Sort of like REPL

As we build our programming language we’ll need some way to interact with it. C uses a compiler, where you can change the program, recompile and run it. It’d be good if we could do something better, and interact with the language dynamically. Then we test its behaviour under a number of conditions very quickly. For this we can build something called an interactive prompt.

This is a program that prompts the user for some input, and when supplied with it, replies back with some message. Using this will be the easiest way to test our programming language and see how it acts. This system is also called a REPL, which stands for read-evaluate-print loop. It is a common way of interacting with a programming language which you may have used before in languages such as Python.

Before building a full REPL we’ll start with something simpler. We are going to make a system that prompts the user, and echoes any input straight back. If we make this we can later extend it to parse the user input and evaluate it, as if it were an actual Lisp program.