Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

grinder (1100)

grinder
  (email not shown publicly)
http://www.landgren.net/perl/
Yahoo! ID: perlgrinder (Add User, Send Message)

Editor of p5p summaries, member of the p5p peanut gallery.

Journal of grinder (1100)

Wednesday February 15, 2006
01:20 PM

Brute force compilation

[ #28686 ]

I ran the following program:

% /usr/bin/perl /usr/share/dict/words
Semicolon seems to be missing at /usr/share/dict/words line 56367.
Semicolon seems to be missing at /usr/share/dict/words line 58414.
Semicolon seems to be missing at /usr/share/dict/words line 72599.
Semicolon seems to be missing at /usr/share/dict/words line 104537.
Bareword found where operator expected at /usr/share/dict/words line 109459, near "Maarten"
  (Might be a runaway multi-line MM string starting on line 109455)
Semicolon seems to be missing at /usr/share/dict/words line 124219.
Semicolon seems to be missing at /usr/share/dict/words line 136839.
Bareword found where operator expected at /usr/share/dict/words line 161158, near "qere"
  (Might be a runaway multi-line qq string starting on line 161157)
Semicolon seems to be missing at /usr/share/dict/words line 167505.
Bareword found where operator expected at /usr/share/dict/words line 171985, near "sab"
  (Might be a runaway multi-line ss string starting on line 171980)
syntax error at /usr/share/dict/words line 4650, near "Alaric
alarm
"
No such class Mya at /usr/share/dict/words line 121337, near "muzzy
Mwa
my
Mya"
"no" not allowed in expression at /usr/share/dict/words line 124778, at end of line
No such class Ouranos at /usr/share/dict/words line 133287, near "ouphe
ouphish
our
Ouranos"
Illegal declaration of subroutine main::subabbot at /usr/share/dict/words line 191503.

.. and wondered why I was getting such perplexing errors. Then I realised that I had omitted the name of the script, and was thus executing the word list file.

This reminds me of the time at school when I tried to compile a COBOL program with a Pascal compiler. I got a thick stack of fan-fold back from the computer room. Page after page of errors. It did nearly manage to parse one line correctly, when it got to

PROCEDURE DIVISION

... but apart from that it recorded several thousand syntax errors. I like it when programs march on stubbornly in the face of impossible odds. It makes me feel smarter than them.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I like it when programs march on stubbornly in the face of impossible odds. It makes me feel smarter than them.

    There is historical justification for a compiler to do this. Back in the days of punch cards and line printers, the time between submitting a job to compile a program and seeing the result was measured in minutes, hours, or days. So, it was extremely important for the compiler to tell you about as many errors as possible in a single run so that you could fix as much as possible before sending t

  • (replying several months late :-)

    What is scary is that it got to line 56367 before it noticed that something was wrong...

    • Hey, better late than never, and it's a good point.

      I took a closer look at the file. Line 56367 seems pretty boring, although line 56366 is much more interesting. It contains the word

      do

      To avoid this error in future, I think the addition of the keyword "aardvark" to the language would be of vital importance. There's just the small detail of figuring out what it would do.