Thank you to whomever thought about gimbal lock when designing the rotate controls.
You're welcome
https://www.thisamericanlife.org/284/should-i-stay-or-should...
My basic question would be: why not go back to flex/bison/yacc/whatever via C-FFI? (But I think it would still be bad, since you'll want to get to a Swift data structure for your ops and those will still have the Arc issues)
I did investigate maintaining the flex/bison parser, since its generated state machine C code is more robust than my handwritten recursive descent parser when presented with pathological input. However, as you say, since I need a Swift data structure in the end, there is little to be gained and a lot of complication bridging via a C-FFI.
Did you work on Axiom? That was the finest crafted computer algebra system.