-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Here you go: https://github.com/bamless/interpreter. Look at the interpret/memenv package. The implementation really couldn't be more simple: it is just a queue of frame objects. pushStackFrame is called when calling a function, and popStackFrame when hitting a return or a function end. The MemoryEnvironment is instantiated by the interpreter visitor so all parts of it have access to the memory. The variables themselves are kept in an hashmap inside each Frame. Not the most efficient way but fast enough for a tree walking interpreter
Also, since you are willing to look at non-treewalk interpreters, you can take a look at this: https://github.com/bamless/jstar/blob/master/src/vm.h In this I use two parallel arrays, one for frames and one for variables. The frame contains the instruction pointer of the function and the address of the start of the activation record. Variables are stored packed inside the stack array and are accessed through indexing.