-
Book Overview & Buying
-
Table Of Contents
Building Programming Language Interpreters
By :
When you are designing a language that primarily focuses on a single thread of execution, the question of the mutability of the values and containers is reasonably easy to ignore. There are very few things that can get in the way of simply overwriting the value in memory and carrying on.
But there are nuances to be considered, even in the single-threaded use case. Consider, for example, a data structure such as a hash map. You could end up in a situation where a key and value that were added to a hash map become completely inaccessible because the key was inserted in one bucket, but as it mutated, it didn’t get reassigned to a different bucket.
I want to explore a few different ways to address this particular problem. My goal is to use this as an illustration of the kinds of questions you’ll have to ask yourself when you’re designing your language, and explore ways to find a solution that matches your use case.
Perhaps the simplest of all...
Change the font size
Change margin width
Change background colour