-
Book Overview & Buying
-
Table Of Contents
Building Programming Language Interpreters
By :
The main advantage of using immutable values in a programming language is that you don’t need to make a distinction between using something by value or by reference. All uses point to a more abstract concept of the value itself, and the life cycle of the value is entirely managed by the language.
In the case of this particular language, I know that the life cycle of those can be tied to the specific messages and states of the network protocol itself.
In one of the examples, I had the following snippet:
messages: array<element_type=str<encoding=Ascii7Bit, sizing=Dynamic, max_length=255>, sizing=Static, length="Quote Request".number>
The assumption here is that values are tied to specific messages, and that those messages can be called by name, and the parts of the data can be referenced directly. When the "Quote Response" message must be written or read, the value for this message has already been set...