Improving Compiler Error Messages

bearophile bearophileHUGS at lycos.com
Mon May 3 04:21:30 PDT 2010


Lars T. Kyllingstad:
> I've never understood why people have a problem with the semicolons.  

In real life there are all kind of errors, communication channels are noisy, and the number of possible meanings is huge. So people are forced to try to understand what other people meant. When people interact with computers, they expect a bit of "basic" understanding from the machine. A language like Perl that tries to read too much into what you meant leads to a messy design and messy programs. But the other extrema (obligatory semicolons at the end of lines) are often seen as excessively fussy by programming newbies (or normal Python programmers).


>I would say I like to have them optional. When you start using delegate literals it's just too much:
foo((int i) { writeln(i); });<

If semicolons will ever became optional in D, I want the D parser to not add them in a smart way as JavaScript does, they can be accepted only as a replacement of ;<newline>. So even if D semicolons become optional, in that lambda you will need to add the inner semicolon still (so Python has lambdas but no Ruby blocks and Guido V.R. likes it this way).

Bye,
bearophile


More information about the Digitalmars-d mailing list