The evolution of Rust compiler error messages, the approach taken by the core team, and even some sample code from the Rust lexer and parser! https://estebank.github.io/rust/
Related Posts
Some delightful examples of good compiler error messages in the latest Gleam release: https://gleam.run/news/context-aware-compilation/
Counter-intuitively, if you're writing a parser for a programming language, you need it to be a total function. As soon as you build IDE tooling, you need ASTs from invalid or incomplete input.
The parser should return (Ast, List<Error>) rather than Result<Ast, Error>.
I'm experimenting with syntax in examples. I don't really like Rust's `assert(inc(1) == 2)` syntax, I find it a little distracting.
I'm trying `inc(1) //-> 2`. The comment is rendered differently, and there's nothing before the sample code. What do you think?