"The compiler should know how to parse (some) invalid code" is an interesting statement, as it can lead to v. different results. I feel in HTML / JS this materialized in: "we'll allow invalid code". In Rust this has materialized in: "we'll help you turn it into valid code".
-
-
Show this thread
-
Side note: I know *why* that choice was made for web tech, and in hindsight I still think it probably was a reasonable choice.
Show this thread -
But ya I guess the other option would probably be to abort the second you encounter invalid code. Oh god, like imagine Rust without diagnostics. Something went wrong with the borrow checker and you don't get help *why*. Or anything about Pin doesn't work. It'd be soo frustrating
Show this thread
End of conversation
New conversation -
-
-
Yes!! This mirrors how people used to program YACC (and probably still do) parsers - because error messages were so bad they had to create additional rules for invalid code!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.