3 ms·
It seems obvious now, but that's not low hanging fruit, and even when you think to do it, it's not easy to do. It took and is still taking real ingenuity and ha
by cormacrelf 5y ago
It seems obvious now, but that's not low hanging fruit, and even when you think to do it, it's not easy to do. It took and is still taking real ingenuity and hard work from Rust folks to do. Their syntax trees are insane, they carry so much information around to make these kinds of messages possible. Every source of ambiguity in intent adds to the problem. Making binops work only with whitespace is an easy change to the parser; telling people as you look over their shoulder is also easy. Producing this error message when it is valid syntax and means something else is a different beast entirely. For a general purpose language I just wouldn't recommend it when you have an easy choice available to avoid the ambiguity in intent. It will save so much work if you aspire to have better errors.