Interpreting Generated Code
Today I made another attempt at interpreting the generated code myself. What initially turned me away from this solution was the task of not only performing arithmetic operations, but also resolving things like
a[g]. I decided to just bite the bullet and write some functions to break down the problems. I was also hoping that once I finished writing the first slideshow, the others would be fairly straightforward.
At the end of the day, I was able to get everything to work up to where it prints out some of the values in the current context. Basically, the hard part is done. I don’t think this is the most elegant solution, since it’s not as flexible as it would be if I built it into the actual interpreter. But I think it’s much easier to look at and understand. My commit can be found here.