I just wrote a parser for LLVM IR from scratch in two days. That was fun!

This is the start of my Mini-Alive project for my research. I usually care about lossless syntax trees and error recovery, but this time I threw that out and saw how good of diagnostics I could get despite the simple strategy.

https://github.com/thaliaarchi/mini-alive

#llvm

@thalia These diagnostics look so nice! Anything worth trying to upstream in your opinion?

@briles Good idea. My impression is that LLVM’s text IR diagnostics are pretty basic, because the end users are compiler devs. But I can look into what would be needed to track the necessary state. I wonder whether clang’s diagnostics rendering could be reused?

And for the record, the three errors in my image are from separate runs. It stops parsing at the first error. Error recovery would have allowed for all errors to be surfaced on one run, but that’s unnecessary complexity.