Make a slow error quine maker!

38

5

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.

Dennis

Posted 2015-05-30T03:51:58.813

Reputation: 196 637

11This 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). – isaacg – 2015-05-30T04:49:27.030

4@isaacg: That's actually pretty neat that it's cyclic. – Alex A. – 2015-05-30T04:51:16.613

5I believe this is the 3000th question, not counting closed or locked ones. Congrats! :) – Martin Ender – 2015-05-30T17:00:38.160

Too bad that C# can't do this, because the compiler generates an increasingly longer line of errors. – LegionMammal978 – 2015-05-30T18:40:39.833

Is it allowed to write a code that outputs another code with the errors included in it? – Ismael Miguel – 2015-05-31T03:23:18.930

@IsmaelMiguel: I'm not sure if I understood that correctly, but as long as it adheres to neither the original code or the code generated in any of the steps may produce non-error output, you should be fine. – Dennis – 2015-05-31T03:27:39.437

@Dennis What if it produces both, by outputting more code that generated more errors? In PHP, an example can be <?=a.'<?="b<?=c";';. – Ismael Miguel – 2015-05-31T03:29:20.717

@Dennis I just did. But I will repeat: <?=a.'<?="b<?=c";'; in PHP. – Ismael Miguel – 2015-05-31T03:32:40.953

@IsmaelMiguel: That would be invalid because it prints a<?="b<?=c"; to STDOUT, thus producing non-error output. – Dennis – 2015-05-31T03:34:00.990

Alright, thanks. If you want, you can add that as an example of what not to do. – Ismael Miguel – 2015-05-31T03:34:38.190

1@IsmaelMiguel: I've added the last two iterations, to keep it short. – Dennis – 2015-05-31T04:13:53.983

Answers

36

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.

jimmy23013

Posted 2015-05-30T03:51:58.813

Reputation: 34 042

7That's probably as high as we'll get on 64-bit machines. Well played. – Dennis – 2015-05-30T05:29:21.270

@Dennis It can be much higher if I use bc or write my own code for decrement. – jimmy23013 – 2015-05-30T05:30:54.653

3@Dennis Edited to make the errors fit in the maximum file sizes of 64-bit machines. – jimmy23013 – 2015-05-30T05:46:49.370

2This 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.) – PyRulez – 2015-05-30T22:52:26.137

Maybe also add the last few ones (just before it becomes a quine)? – Paŭlo Ebermann – 2015-05-31T12:42:16.163

@PaŭloEbermann Edited. – jimmy23013 – 2015-05-31T14:30:26.603

15

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.

DLosc

Posted 2015-05-30T03:51:58.813

Reputation: 21 213

Pip -w counts as a programming language according to meta consensus – MilkyWay90 – 2019-07-09T16:54:06.057

@MilkyWay90 Good point, though I think the wording of this question overrides that default ("Your program may not... require any flags to produce the loop"). It doesn't matter much to me one way or the other--my solution has been well-received in any case. :) – DLosc – 2019-07-19T04:20:33.170

Okay, I see now – MilkyWay90 – 2019-07-19T15:47:58.250

13

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.

Alex A.

Posted 2015-05-30T03:51:58.813

Reputation: 23 761

2

Unrelated, but worth watching (subtitles in Spanish): https://www.youtube.com/watch?v=8mzfyVluiIU or (subtitles in English, and better quality): https://www.youtube.com/watch?v=mog7Gsu613E

– Ismael Miguel – 2015-05-31T02:16:38.410

2@IsmaelMiguel That most certainly is related. :) – Alex A. – 2015-05-31T06:49:52.290

8

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"

Alex A.

Posted 2015-05-30T03:51:58.813

Reputation: 23 761

6

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
-----

Doorknob

Posted 2015-05-30T03:51:58.813

Reputation: 68 138

Your test script doesn't ignore stdout. If there is stdout and stderr, it won't work properly. – wizzwizz4 – 2016-02-07T15:19:33.527

@wizzwizz4 The challenge forbids non-error output. – Dennis – 2016-02-07T23:09:23.903

@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.) – wizzwizz4 – 2016-02-08T17:34:51.007

5

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
       ^

mbomb007

Posted 2015-05-30T03:51:58.813

Reputation: 21 944

4

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.

mbomb007

Posted 2015-05-30T03:51:58.813

Reputation: 21 944

1As the error messages are not standardized, could you add your compiler version (the output of javac -version)? – Paŭlo Ebermann – 2015-05-31T12:47:23.173

"[...]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 http://text-compare.com/ to compare the texts, or the Compare plugin in Notepad++. The best of all is that http://text-compare.com/ allows to send the results over email.

– Ismael Miguel – 2015-05-31T13:18:48.770

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. – mbomb007 – 2015-06-01T13:31:54.127

@PaŭloEbermann Added link – mbomb007 – 2015-06-01T13:33:20.893

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. – mbomb007 – 2015-06-01T21:57:43.157

2

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

Ismael Miguel

Posted 2015-05-30T03:51:58.813

Reputation: 6 797

@LegionMammal978 In what exact version AND build number and date? – Ismael Miguel – 2015-10-22T20:04:19.700

@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. – Ismael Miguel – 2015-10-22T20:12:31.817

@LegionMammal978 Don't worry. Mark the comments as obsolete when you get this one. – Ismael Miguel – 2015-10-22T20:13:47.810

0

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.

elipszilon

Posted 2015-05-30T03:51:58.813

Reputation: 61