Learnt today that x86 has UD2, a deliberately invalid opcode for testing. It's a big instruction set.
miniblog.
Related Posts
What types should you infer when code is invalid?
In Garden, + only applies to integers. What should the type of "x" + "y" be?
(1) Int: This produces cascading errors.
(2) String: We've already emitted an error anyway.
(3) Bottom.
Opinions?
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 impressed by how many options I'm offered in Common Lisp (in this case sbcl on Sly) for a simple error like an invalid variable name!
