I am building a compiler in Nim, so iterating over complex tree structures of ref objects. I keep running into "quantum bug" issues where simply adding 'echo "hello"' on a line will tigger or prevent a crash, or crashes that happen nondeterministically. Given the complex nature of the code, it is already hard to debug, but now it is just impossible (can't reduce examples, can't print debug and step debugging doesn't work on mac).
I think this is the 4th time running into these bugs in the last 2 months and I spent 8 hours on it today, without a fix. To be honest it is super depressing and I am considering abandoning the whole project and Nim all together. But I do wonder if there is a set of best practices to avoid this sort of thing?
