Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

75% Positive

Analyzed from 191 words in the discussion.

Trending Topics

#error#compiler#more#file#fix#errors#actually#used#always#view

Discussion (2 Comments)Read Original on HackerNews

derdi•about 2 hours ago
> The compiler bothers me more. When it encounters an error it seems to give up on the rest of the file. This makes the iteration loop quite slow - write code, get an error, fix the error, rebuild. There's very little chance to fix errors in bulk, especially if you're focussed on one module.

Are there languages where this actually works, in actual practice? No compiler I have ever used in anger was reliable enough in its error recovery, no matter how hard it tried. So when working on the command line, I always scroll up to the first error and ignore the following ones. Any work the compiler puts into showing me more than the first error is wasted, from my point of view. And it wastes my time, so I view this as a net negative. Again, not the lofty idea, but the practical implementation in compilers I've used. (IDEs can be better. IntelliJ is sometimes even actually good. Not always.)

The author mentions Rust, is the Rust compiler really that good at reliably guessing the correct way to recover? Even in the face of, say, complex type errors?

zem•about 1 hour ago
if nothing else, you could guess that a compilation error within a function body would still let other functions be compiled, and proceed on that basis.
jallmann•6 minutes ago
Depending on the error, the grammar, and the parser, it may not be possible to close the function body. Most compilation units are file-based for this reason.