Btw, one of the things I came up with in bash was an “object oriented” pattern (antipattern?) where a “constructor” function would declare variables for “attributes” and functions for “methods”, like for example declaring an object named Vector1 whose fields are Vector1_x Vector1_y Vector1_z and methods like Vector1_Normalize and Vector1_SetMagnitude. The functions would be eval’d for each instance of the object during the constructor to reference the attributes and methods of that named object instance. Is this possible in cmake? (I don’t know cmake at all)
It sounds like it should be possible (CMake also has eval), but the lack of OOP isn't so much a problem for what I needed. Packing and unpacking the vectors was more annoying. I can live without OOP, I've written enough C to get used to it haha.
Actually, thinking back, the primary reason I did that was that bash can’t dereference a variable by its name stored in another variable without an eval, and calling eval on each access of the variable was slow. By eval-ing the whole method ahead of time, I could access all the object attributes at runtime without any further evals. It looks like cmake has a getter/setter function that takes a name, so that wouldn’t be a problem here.
The OpenGL interpreter was a lot of effort, but the bash scripts that feed it were basically the same problem you worked out: how to implement 3d vector math in a language of integers, array variables, and functions without references or return values.
http://www.nrdvana.net/cmdlinegl/