-
Book Overview & Buying
-
Table Of Contents
Building Programming Language Interpreters
By :
As implied in Chapter 1, the goal is to make the interpreter independent of specific event loop frameworks, allowing the interpreter to be used in as many situations as possible.
Another consequence of that choice is that I only need to interact with the specific parts of the input and output operations that are relevant to how the protocols supported by this language are needed. In particular, that means I really only need to be able to handle the needs for the reads and writes.
I will go back to the sans I/O approach, where all that is needed is a mechanism to receive bytes, and to communicate which bytes have to be written.
I had a placeholder API for InputOutputOperation in the previous section; let me actually refine it now.
There is one subtlety that is relevant now, which is that the sequence of bytes received from the network does not necessarily match the number of bytes this specific operation needs. If there are fewer, the...