miniblog.

← Back to all posts
3
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>.

3 Comments

Completely agree! Though I'm not going to be using the phrase "a total function" as high praise: "Did you see what they did?" "Oh yeah, they are a total function!" :)