38
\$\begingroup\$

As part of his answer to Make an Error Quine!, @Falko proposed the following algorithm:

How to create your own solution in 2 minutes?

  1. Open a new file in an IDE of your choice.
  2. Bang your head onto the keyboard in front of you.
  3. Compile.
  4. Replace the code with the compiler error message.
  5. Repeat steps 3 and 4 until the code converges.

I bet such a procedure terminates pretty quickly in most cases!

Task

Your task is to prove him wrong.

Write a full program that satisfies the following:

  1. When compiled or interpreted, it produces an error message that, when compiled or interpreted in turn, also results in an error message.

  2. Repeating step 1 over and over again will eventually encounter a fixed point, i.e., an error quine.

Additional rules

  • The final error message must have a positive length. However, the previous error messages and the original source code may be empty.

  • The original source code's length may not exceed 1024 bytes.

  • Neither the original code or the code generated in any of the steps may produce non-error output.

    The output has to be clearly identifiable as an error message, which has to be generated by the compiler/interpreter due to a syntax error, runtime error, undefined reference, etc.

  • Your program may not receive any input or require any flags to produce the loop.

  • Your program may rely on a specific implementation of its language or version thereof.

Scoring

Your score is the finite number of steps your source code requires before producing an error quine. The submission with the highest score wins.

The length of the original source code will be used as tie breaker. Shorter is better.

Example

In Chicken, the program



generates the following error message:

TypeError: Cannot read property 'NaN' of undefined

If this error message is, in turn, interpreted, it produces the error message

Error on line 1: expected 'chicken'

which, if interpreted in turn, produces itself.

Thus, the score of the empty Chicken program is 2.

Counterexample

The PHP code

ab<?=c

generates the error message

PHP Parse error:  syntax error, unexpected '?' in Command line code on line 1

which produces itself when interpreted.

However, the second source code prints the message to STDOUT, making this sequence invalid.

\$\endgroup\$
  • 10
    \$\begingroup\$ This procedure never produces an error quine in Pyth. It ends up in a repeating cycle, every third error output of which is Segmentation fault (core dumped). \$\endgroup\$ – isaacg May 30 '15 at 4:49
  • 4
    \$\begingroup\$ @isaacg: That's actually pretty neat that it's cyclic. \$\endgroup\$ – Alex A. May 30 '15 at 4:51
  • 5
    \$\begingroup\$ I believe this is the 3000th question, not counting closed or locked ones. Congrats! :) \$\endgroup\$ – Martin Ender May 30 '15 at 17:00
  • \$\begingroup\$ Too bad that C# can't do this, because the compiler generates an increasingly longer line of errors. \$\endgroup\$ – LegionMammal978 May 30 '15 at 18:40
  • 1
    \$\begingroup\$ @IsmaelMiguel: I've added the last two iterations, to keep it short. \$\endgroup\$ – Dennis May 31 '15 at 4:13
35
\$\begingroup\$

Bash, 9223372036854775810

Inspired by Doorknob's answer.

a='"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #"'
i=2**63
eval $a

It should be run with bash < file.sh, or use the same file name for each program, to get rid of the different file names in the error messages.

The first few errors are (with LANG=C):

bash: line 3: 2>/dev/null;if(((i=9223372036854775807)>0));then declare -- a="\"2>/dev/null;if(((i=\$((i-1)))>0));then \$(declare -p a);\$a;else 1;fi #\"";"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory
bash: line 1: 2>/dev/null;if(((i=9223372036854775806)>0));then declare -- a="\"2>/dev/null;if(((i=\$((i-1)))>0));then \$(declare -p a);\$a;else 1;fi #\"";"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory
bash: line 1: 2>/dev/null;if(((i=9223372036854775805)>0));then declare -- a="\"2>/dev/null;if(((i=\$((i-1)))>0));then \$(declare -p a);\$a;else 1;fi #\"";"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory

And finally:

bash: line 1: 2>/dev/null;if(((i=0)>0));then declare -- a="\"2>/dev/null;if(((i=\$((i-1)))>0));then \$(declare -p a);\$a;else 1;fi #\"";"2>/dev/null;if(((i=$((i-1)))>0));then $(declare -p a);$a;else 1;fi #";else 1;fi #: No such file or directory
bash: line 1: 1: command not found
bash: line 1: bash:: command not found

which is an error quine.

\$\endgroup\$
  • 6
    \$\begingroup\$ That's probably as high as we'll get on 64-bit machines. Well played. \$\endgroup\$ – Dennis May 30 '15 at 5:29
  • \$\begingroup\$ @Dennis It can be much higher if I use bc or write my own code for decrement. \$\endgroup\$ – jimmy23013 May 30 '15 at 5:30
  • 3
    \$\begingroup\$ @Dennis Edited to make the errors fit in the maximum file sizes of 64-bit machines. \$\endgroup\$ – jimmy23013 May 30 '15 at 5:46
  • 2
    \$\begingroup\$ This is especially ridiculously high scoring compared to the other answers. To be fair, Falko did say "most cases" (although this does provide at least 9223372036854775000 with score over 800.) \$\endgroup\$ – PyRulez May 30 '15 at 22:52
  • \$\begingroup\$ Maybe also add the last few ones (just before it becomes a quine)? \$\endgroup\$ – Paŭlo Ebermann May 31 '15 at 12:42
14
\$\begingroup\$

Pip 0.15.05.29, over 10100,000

Technically not valid because it requires the -w flag for warning output. That being said, Pip by design doesn't display any runtime errors unless they actually crash the program (infinite recursion, e.g.); the problems with this code are things that other languages would definitely complain about.

i:5**6**7d:"i:1d: Ssi?dRo--iRsRPda"Ssi?dRo--iRsRPda

The exact number of steps depends only on the value assigned to i, so it could be arbitrarily large (until the Python interpreter runs out of memory). Also, it would take longer than the age of the universe to complete the above sequence. (The question did specify "slow"!)

Explanation:

It took some combing through the interpreter before I found an error that would let me put arbitrary code into the warning message. After that, it was essentially modifying standard quine techniques. Example here uses an i-value of 5 for purposes of explanation.

i:5d:"i:1d: Ssi?dRo--iRsRPda"Ssi?dRo--iRsRPda

After setting i, store a string in d and then attempt to execute the Swap statement. Swap expects two variables (more accurately, lvalues). s is fine, but the second expression is i?dRo--iRsRPda. If i is true (nonzero, for our purposes), the ternary evaluates to dRo--iRsRPd, which uses d from earlier to form a near-quine--only with i decremented. This expression is not an lvalue, so Pip complains:

Attempting to swap non-lvalue i:4d:"i:1d: Ssi?dRo--iRsRPda"Ssi?dRo--iRsRPda

... which then starts the whole thing over again. (Attempting to swap non-lvalue is a bunch of no-ops: At calculates the ASCII value of t = 10, n-l subtracts newline minus each value of an empty list, and all the lowercase letters are just variables.)

The process continues in like fashion all the way down to:

Attempting to swap non-lvalue i:0d:"i:1d: Ssi?dRo--iRsRPda"Ssi?dRo--iRsRPda

When this is run, i is now false. The ternary expression evaluates to the else branch a--which is an lvalue. Thus, swap doesn't complain anymore. Instead, we get:

Referencing uninitialized variable a

And upon running this, at last, we have an actual syntax error:

R is not a unary operator
Fatal error while parsing, execution aborted.

... at which point, since the "program" starts with R, Pip will continue complaining that R is not a unary operator forever.


The best solution that doesn't use -w is of length 3:

$~

While scanning, ignored unrecognized character: '~'
Missing operator for $ meta-operator? Got None instead
Fatal error while parsing, execution aborted.

Missing operator for $ meta-operator? Got m instead
Fatal error while parsing, execution aborted.

M is not a unary operator
Fatal error while parsing, execution aborted.
\$\endgroup\$
13
\$\begingroup\$

Julia, 3

A simple one just to get the ball rolling...

Initial program:

inquisition

Error 1:

inquisition not defined

It may not be defined, but if it's Spanish, it's also unexpected. Nobody expects the Spanish Inquisition.

Error 2:

syntax: extra token "not" after end of expression

Error 3:

syntax: extra token "token" after end of expression

The third error message, when submitted as a program, produces that same error, hence the score of 3.

Work in progress! Surely I can do better than 3.

\$\endgroup\$
8
\$\begingroup\$

R, 5

Initial program:

1i*"5"

Error 1:

Error in (0+1i) * "5" : non-numeric argument to binary operator

Error 2:

Error: unexpected 'in' in "Error in"

Error 3:

Error: unexpected string constant in "Error 'in'"

Error 4:

Error: unexpected symbol in "Error: unexpected string"

Error 5 (Quine):

Error: unexpected symbol in "Error: unexpected symbol"
\$\endgroup\$
6
\$\begingroup\$

Bash, 3

cp

Very rudimentary shell script to test it:

llama@llama:~$ s=$(bash -c 'cp' 2>&1); olds=asdf; while [ "$s" != "$olds" ]; do echo $s; echo '-----'; olds=$s; s=$(bash -c $s 2>&1); done 
cp: missing file operand
Try 'cp --help' for more information.
-----
bash: cp:: command not found
bash: line 1: Try: command not found
-----
bash: bash:: command not found
bash: line 1: bash:: command not found
-----
\$\endgroup\$
  • \$\begingroup\$ Your test script doesn't ignore stdout. If there is stdout and stderr, it won't work properly. \$\endgroup\$ – wizzwizz4 Feb 7 '16 at 15:19
  • \$\begingroup\$ @wizzwizz4 The challenge forbids non-error output. \$\endgroup\$ – Dennis Feb 7 '16 at 23:09
  • \$\begingroup\$ @Dennis Good point. But... the user isn't always as good as the programmer. (Even if the user is a programmer, they might not be an experienced one.) \$\endgroup\$ – wizzwizz4 Feb 8 '16 at 17:34
5
\$\begingroup\$

Ruby, 5

Initial Program

q

1

undefined local variable or method `q' for #<Context:0x00000001045d70>
(repl):1:in `initialize'

2

(repl):2: syntax error, unexpected tIDENTIFIER, expecting end-of-input
(repl):1:in `initialize'
                       ^

3

(repl):1: syntax error, unexpected ':', expecting end-of-input
(repl):2: syntax error, unexpected t...
       ^

4

(repl):1: syntax error, unexpected ':', expecting end-of-input
(repl):1: syntax error, unexpected ':', expecting end-of-input
       ^

5 (Quine)

(repl):1: syntax error, unexpected ':', expecting end-of-input
(repl):1: syntax error, unexpected ':', expecting end-of-input
       ^
\$\endgroup\$
4
\$\begingroup\$

Java, 5

These are very long... so I verified string equality using a Python script, and I generated this formatted post, so I wouldn't have to manually insert tabs on 400 lines.

Initial Program

class Main {
  public static void main(String[] args) {
    System.out.println("hello world");
  }}
}

1

Main.java:5: error: class, interface, or enum expected
}
^
1 error

exit status 1

2

Main.java:1: error: class, interface, or enum expected
Main.java:5: error: class, interface, or enum expected
^
Main.java:1: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:1: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:1: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:3: error: illegal start of type
^
^
Main.java:3: error: ';' expected
^
 ^
Main.java:6: error: ';' expected
exit status 1
    ^
Main.java:6: error: <identifier> expected
exit status 1
           ^
Main.java:6: error: reached end of file while parsing
exit status 1
             ^
10 errors

exit status 1

3

Main.java:1: error: class, interface, or enum expected
Main.java:1: error: class, interface, or enum expected
^
Main.java:1: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:1: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:1: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:2: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:2: error: ';' expected
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:2: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:2: error: = expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:2: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:2: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:2: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:2: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:3: error: illegal start of type
^
^
Main.java:4: error: = expected
Main.java:1: error: <identifier> expected
    ^
Main.java:4: error: <identifier> expected
Main.java:1: error: <identifier> expected
         ^
Main.java:4: error: ';' expected
Main.java:1: error: <identifier> expected
          ^
Main.java:4: error: illegal start of type
Main.java:1: error: <identifier> expected
           ^
Main.java:4: error: = expected
Main.java:1: error: <identifier> expected
                  ^
Main.java:5: error: '(' expected
Main.java:5: error: class, interface, or enum expected
    ^
Main.java:5: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:5: error: ';' expected
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:5: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:5: error: = expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:5: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:5: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:5: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:5: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:6: error: illegal start of type
                         ^
                         ^
Main.java:7: error: = expected
Main.java:1: error: <identifier> expected
    ^
Main.java:7: error: <identifier> expected
Main.java:1: error: <identifier> expected
         ^
Main.java:7: error: ';' expected
Main.java:1: error: <identifier> expected
          ^
Main.java:7: error: illegal start of type
Main.java:1: error: <identifier> expected
           ^
Main.java:7: error: = expected
Main.java:1: error: <identifier> expected
                  ^
Main.java:8: error: '(' expected
Main.java:5: error: class, interface, or enum expected
    ^
Main.java:8: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:8: error: ';' expected
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:8: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:8: error: = expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:8: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:8: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:8: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:8: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:9: error: illegal start of type
                                    ^
                                    ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
    ^
Main.java:10: error: <identifier> expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
         ^
Main.java:10: error: ';' expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
          ^
Main.java:10: error: illegal start of type
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
           ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                  ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                          ^
Main.java:10: error: illegal start of type
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                  ^
Main.java:10: error: <identifier> expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                   ^
Main.java:10: error: unclosed character literal
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                     ^
Main.java:10: error: ';' expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                       ^
Main.java:10: error: unclosed character literal
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                          ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                        ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                              ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                         ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                                    ^
Main.java:11: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:11: error: ';' expected
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:11: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:11: error: = expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:11: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:11: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:11: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:11: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:12: error: illegal start of type
                                         ^
                                         ^
Main.java:12: error: <identifier> expected
                                         ^
                                          ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
   ^
Main.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
      ^
Main.java:13: error: <identifier> expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
              ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
               ^
Main.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                  ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                               ^
Main.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                   ^
Main.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                        ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                                          ^
Main.java:14: error: <identifier> expected
Main.java:1: error: = expected
         ^
Main.java:14: error: ';' expected
Main.java:1: error: = expected
          ^
Main.java:14: error: illegal start of type
Main.java:1: error: = expected
           ^
Main.java:14: error: = expected
Main.java:1: error: = expected
                  ^
Main.java:14: error: illegal start of type
Main.java:1: error: = expected
                    ^
Main.java:15: error: = expected
Main.java:5: error: class, interface, or enum expected
^
Main.java:15: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
    ^
Main.java:15: error: = expected
Main.java:5: error: class, interface, or enum expected
         ^
Main.java:15: error: illegal start of type
Main.java:5: error: class, interface, or enum expected
          ^
Main.java:15: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
           ^
Main.java:15: error: = expected
Main.java:5: error: class, interface, or enum expected
             ^
Main.java:15: error: ';' expected
Main.java:5: error: class, interface, or enum expected
                  ^
Main.java:15: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                         ^
Main.java:15: error: <identifier> expected
Main.java:5: error: class, interface, or enum expected
                                    ^
Main.java:15: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:5: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:15: error: = expected
Main.java:5: error: class, interface, or enum expected
                                              ^
Main.java:16: error: illegal start of type
                                              ^
                                              ^
Main.java:17: error: = expected
Main.java:3: error: illegal start of type
    ^
Main.java:17: error: <identifier> expected
Main.java:3: error: illegal start of type
         ^
Main.java:17: error: ';' expected
Main.java:3: error: illegal start of type
          ^
Main.java:17: error: illegal start of type
Main.java:3: error: illegal start of type
           ^
Main.java:17: error: = expected
Main.java:3: error: illegal start of type
                  ^
100 errors

exit status 1

4

Main.java:1: error: class, interface, or enum expected
Main.java:1: error: class, interface, or enum expected
^
Main.java:1: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:1: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:1: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:2: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:2: error: ';' expected
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:2: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:2: error: = expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:2: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:2: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:2: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:2: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:3: error: illegal start of type
^
^
Main.java:4: error: = expected
Main.java:1: error: <identifier> expected
    ^
Main.java:4: error: <identifier> expected
Main.java:1: error: <identifier> expected
         ^
Main.java:4: error: ';' expected
Main.java:1: error: <identifier> expected
          ^
Main.java:4: error: illegal start of type
Main.java:1: error: <identifier> expected
           ^
Main.java:4: error: = expected
Main.java:1: error: <identifier> expected
                  ^
Main.java:5: error: '(' expected
Main.java:1: error: class, interface, or enum expected
    ^
Main.java:5: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:5: error: ';' expected
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:5: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:5: error: = expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:5: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:5: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:5: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:5: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:6: error: illegal start of type
                         ^
                         ^
Main.java:7: error: = expected
Main.java:1: error: <identifier> expected
    ^
Main.java:7: error: <identifier> expected
Main.java:1: error: <identifier> expected
         ^
Main.java:7: error: ';' expected
Main.java:1: error: <identifier> expected
          ^
Main.java:7: error: illegal start of type
Main.java:1: error: <identifier> expected
           ^
Main.java:7: error: = expected
Main.java:1: error: <identifier> expected
                  ^
Main.java:8: error: '(' expected
Main.java:1: error: class, interface, or enum expected
    ^
Main.java:8: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:8: error: ';' expected
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:8: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:8: error: = expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:8: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:8: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:8: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:8: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:9: error: illegal start of type
                                    ^
                                    ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
    ^
Main.java:10: error: <identifier> expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
         ^
Main.java:10: error: ';' expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
          ^
Main.java:10: error: illegal start of type
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
           ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                  ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                          ^
Main.java:10: error: illegal start of type
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                  ^
Main.java:10: error: <identifier> expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                   ^
Main.java:10: error: unclosed character literal
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                     ^
Main.java:10: error: ';' expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                       ^
Main.java:10: error: unclosed character literal
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                          ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                        ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                              ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                         ^
Main.java:10: error: = expected
Main.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                                    ^
Main.java:11: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:11: error: ';' expected
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:11: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:11: error: = expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:11: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:11: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:11: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:11: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:12: error: illegal start of type
                                         ^
                                         ^
Main.java:12: error: <identifier> expected
                                         ^
                                          ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
   ^
Main.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
      ^
Main.java:13: error: <identifier> expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
              ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
               ^
Main.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                  ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                               ^
Main.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                   ^
Main.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                        ^
Main.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                                          ^
Main.java:14: error: <identifier> expected
Main.java:1: error: = expected
         ^
Main.java:14: error: ';' expected
Main.java:1: error: = expected
          ^
Main.java:14: error: illegal start of type
Main.java:1: error: = expected
           ^
Main.java:14: error: = expected
Main.java:1: error: = expected
                  ^
Main.java:14: error: illegal start of type
Main.java:1: error: = expected
                    ^
Main.java:15: error: = expected
Main.java:1: error: class, interface, or enum expected
^
Main.java:15: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
    ^
Main.java:15: error: = expected
Main.java:1: error: class, interface, or enum expected
         ^
Main.java:15: error: illegal start of type
Main.java:1: error: class, interface, or enum expected
          ^
Main.java:15: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
           ^
Main.java:15: error: = expected
Main.java:1: error: class, interface, or enum expected
             ^
Main.java:15: error: ';' expected
Main.java:1: error: class, interface, or enum expected
                  ^
Main.java:15: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                         ^
Main.java:15: error: <identifier> expected
Main.java:1: error: class, interface, or enum expected
                                    ^
Main.java:15: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Main.java:1: error: class, interface, or enum expected
                                         ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Main.java:15: error: = expected
Main.java:1: error: class, interface, or enum expected
                                              ^
Main.java:16: error: illegal start of type
                                              ^
                                              ^
Main.java:17: error: = expected
Main.java:2: error: <identifier> expected
    ^
Main.java:17: error: <identifier> expected
Main.java:2: error: <identifier> expected
         ^
Main.java:17: error: ';' expected
Main.java:2: error: <identifier> expected
          ^
Main.java:17: error: illegal start of type
Main.java:2: error: <identifier> expected
           ^
Main.java:17: error: = expected
Main.java:2: error: <identifier> expected
                  ^
100 errors

exit status 1

5 (Quine) - Omitted because of post length.

\$\endgroup\$
  • 1
    \$\begingroup\$ As the error messages are not standardized, could you add your compiler version (the output of javac -version)? \$\endgroup\$ – Paŭlo Ebermann May 31 '15 at 12:47
  • \$\begingroup\$ "[...]so I wouldn't have to manually insert tabs on 400 lines!" --> Paste on Notepad++, press CTRL+A (Select everything) and then press tab. That is a faster way. Also, you could have used text-compare.com to compare the texts, or the Compare plugin in Notepad++. The best of all is that text-compare.com allows to send the results over email. \$\endgroup\$ – Ismael Miguel May 31 '15 at 13:18
  • \$\begingroup\$ I used my script instead of a website, so that I would have all the output in a single list which could then be output. \$\endgroup\$ – mbomb007 Jun 1 '15 at 13:31
  • \$\begingroup\$ @PaŭloEbermann Added link \$\endgroup\$ – mbomb007 Jun 1 '15 at 13:33
  • \$\begingroup\$ I used repl because ideone doesn't show verbose error output. If you know a better online interpreter, let me know. Despite having Netbeans and Eclipse, I don't like using them for simple programs since that requires creating a project, etc. \$\endgroup\$ – mbomb007 Jun 1 '15 at 21:57
1
\$\begingroup\$

Javascript, 3 error levels

This isn't that 'cleaver' or anything, but I found it rather weird...

Error 0 (original):

document.appendChild(HTMLAllCollection)

Error 1:

HierarchyRequestError

Error 2:

'HierarchyRequestError' is not defined

Error 3 (quine):

Excepted character ';'

This was all returned on Internet Explorer 11.0.9600.17416, being the errors translated to English.


Printscreen:

Printscreen showing the console output

* The error messages are shown in Portuguese and can be easily translated to English

\$\endgroup\$
  • \$\begingroup\$ @LegionMammal978 In what exact version AND build number and date? \$\endgroup\$ – Ismael Miguel Oct 22 '15 at 20:04
  • \$\begingroup\$ @LegionMammal978 The answer was VERY specific. It only works on IE11, and that exact output will only happen on Windows with Portuguese (pt-PT) as the primary display language. I guarantee that it will work on 11.0.9600.17416. I can't and won't guarantee that it will produce the same output in newer builds or on another operating system. \$\endgroup\$ – Ismael Miguel Oct 22 '15 at 20:12
  • \$\begingroup\$ @LegionMammal978 Don't worry. Mark the comments as obsolete when you get this one. \$\endgroup\$ – Ismael Miguel Oct 22 '15 at 20:13
0
\$\begingroup\$

JS in Firefox 66.0; 3 error levels

Input: 6?4;

Error #1 = Input #2: missing : in conditional expression

Error #2 = Input #3: expected expression, got keyword 'in'

Error #3 = Input #4 = Error #4: unexpected token: identifier

This is the highest I got.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.