4 ms·
Are there existing tools that help debug compiler time properties (e.g. reference counting) easily? I know of many interactive debugging techniques for investig
by pbardea 4y ago
Are there existing tools that help debug compiler time properties (e.g. reference counting) easily? I know of many interactive debugging techniques for investigating runtime errors, but when I'm faced with a compiler error it seems like the best interface I have is just an error message and then meticulously reading the code. I'd find something like that really useful for type-related errors too.
Even something as simple as breakpoints and printlns let me inspect the intermediary state of these systems.
- dwaite 4y agoSince reference counting is automatic for the most part, the language tries to express the semantics of references itself - for instance, you can capture self weakly for a callback later, and have to check that you still have a valid capture before use. After that, your issues then are typically reference cycles, which can really only be found by tooling at runtime or by certain linting tools (e.g. warn that the type definitions make reference cycles possible, even if your code isn't making cycles). There are tools such as Instruments included with Xcode to help detect cycles at runtime.