| Bytes | Lang | Time | Link |
|---|---|---|---|
| nan | 250702T111248Z | Steve Be | |
| 018 | Vyxal 3.7.0 | 250701T180554Z | pacman25 |
| 123 | CASIO BASIC CASIO fx9750GIII | 250204T193547Z | madeforl |
| 043 | Bespoke | 250125T052325Z | Josiah W |
| nan | perl | 240618T122055Z | Themooni |
| 070 | Emojigramming | 240615T064210Z | None1 |
| nan | 240615T062619Z | None1 | |
| 043 | LOLCODE | 240212T220707Z | Adelie |
| 998 | Perl 5 | 240227T200311Z | Dom Hast |
| nan | 240214T144900Z | madeforl | |
| nan | 230815T125423Z | Earldrid | |
| 070 | Applescript | 230719T195840Z | Jakdad J |
| 038 | 230602T173855Z | Dadsdy | |
| 127 | MirBSD pax | 230524T113747Z | 鳴神裁四点一号 |
| 105 | Python 3 | 230504T004228Z | Jakdad J |
| nan | 230503T193931Z | Jakdad J | |
| nan | 230503T180539Z | The Empt | |
| nan | 230503T144238Z | Not A Ch | |
| 066 | xidoc | 230503T142239Z | Adam |
| nan | 230228T024756Z | Infigon | |
| nan | 230103T215945Z | qarz | |
| 007 | ACCUMULATOR | 230103T075530Z | Rhaixer |
| 157 | gpg GnuPG 2.2.40 | 221027T024701Z | 鳴神裁四点一号 |
| nan | Fig | 221018T204602Z | Seggan |
| 032 | Knight v2 + EVAL knightlang.netlify.app implementation | 221019T011026Z | Aiden Ch |
| 041 | Desmos | 221019T001027Z | Aiden Ch |
| nan | 140905T200248Z | Mark | |
| 024 | TIBasic | 210928T130221Z | MarcMush |
| 079 | PPL | 210911T143714Z | ophact |
| 021 | Phooey | 210623T000139Z | EasyasPi |
| 095 | Agda | 210622T153706Z | cpli |
| 042 | Vyxal | 210529T030341Z | emanresu |
| 020 | Grok | 210518T205450Z | Aaroneou |
| nan | Pxem pxemi.2.min.posixism | 210326T083643Z | user1004 |
| nan | 210221T100132Z | emanresu | |
| 035 | m4 before 1.4.183 Termux patch | 210126T192906Z | EasyasPi |
| nan | 201118T060953Z | BaseZen | |
| 039 | Husk | 201019T235623Z | LegionMa |
| 097 | Setanta | 200826T125943Z | bb94 |
| nan | 200804T203504Z | TehPers | |
| nan | 200519T090706Z | IFcoltra | |
| nan | 200517T191537Z | Luvexina | |
| 070 | Turing Machine Code | 200516T170249Z | ouflak |
| 009 | Pepe | 181030T022819Z | u-ndefin |
| 064 | MS SQL Server version 2012 | 191004T123151Z | steenber |
| nan | Piet | 191004T120301Z | AlienAtS |
| 042 | C tcc | 191002T111656Z | S.S. Ann |
| 038 | ESOPUNK | 181010T173220Z | SIGSTACK |
| nan | 190827T140053Z | user8505 | |
| nan | 170507T020939Z | user6213 | |
| nan | 150522T031713Z | Dennis | |
| nan | 150831T202912Z | SuperJed | |
| 071 | Pip | 190718T140119Z | Kenzie |
| nan | 190719T051156Z | TheOnlyM | |
| 253 | W.Y.A.L.H.E.I.N. | 190617T222024Z | MilkyWay |
| 046 | Triangularity | 190617T221520Z | MilkyWay |
| 121 | Snowman | 190331T161642Z | MilkyWay |
| nan | 180316T193929Z | weatherm | |
| 020 | ZSH macOS | 190323T003328Z | Josh Pri |
| 065 | ink | 190322T031011Z | Sara J |
| 258 | Turing Machine But Way Worse | 190322T004407Z | MilkyWay |
| nan | 140817T152246Z | proud ha | |
| nan | Rust | 180218T142829Z | null |
| nan | 190224T033140Z | MilkyWay | |
| 039 | Javascript Chrome/V8 | 170830T200235Z | Sasha |
| 002 | K ngn/k | 181011T014221Z | Thaufeki |
| 032 | VB.Net | 180905T133934Z | seadoggi |
| 032 | Malbolge | 180226T070548Z | Weijun Z |
| 028 | Python 3 | 180218T194720Z | Dat |
| 248 | Windows .EXE | 170530T212426Z | MD XF |
| 094 | Cubically | 170618T194711Z | MD XF |
| nan | 140816T201543Z | Florian | |
| 090 | INTERCALL | 161222T135620Z | Erik the |
| nan | 140816T202040Z | BenjiWie | |
| 003 | Python | 171113T185253Z | aaay aaa |
| nan | 170827T215719Z | Obsequio | |
| 045 | NASM for x86 | 170827T212606Z | user2330 |
| 007 | Recursiva | 170826T162328Z | 0xffcour |
| nan | k | 170618T214500Z | zgrep |
| nan | 170618T213409Z | zgrep | |
| 048 | KSH script | 170530T184135Z | MD XF |
| 202 | Syms | 170528T015225Z | Calculat |
| nan | 170521T234425Z | felixphe | |
| nan | 170514T165359Z | eush77 | |
| 012 | GWBASIC least | 170506T224307Z | MD XF |
| 066 | MATLAB | 170410T083451Z | Stewie G |
| nan | 170410T055709Z | 0xffcour | |
| nan | 170128T023411Z | SuperJed | |
| nan | 170127T234030Z | Nick the | |
| nan | 170119T005248Z | snail_ | |
| nan | 170117T180633Z | quat | |
| 028 | ArnoldC | 170106T012309Z | Riker |
| nan | 161012T175428Z | Magic Oc | |
| nan | 161012T185700Z | LambdaBe | |
| 036 | Codelike | 161011T185351Z | Connor D |
| nan | 161011T081516Z | njpipeor | |
| nan | 140820T003648Z | James | |
| nan | 161008T112938Z | FinW | |
| nan | 161008T120036Z | David Co | |
| nan | 161008T115018Z | David Co | |
| nan | 161008T114830Z | David Co | |
| nan | 160915T144603Z | TuxCraft | |
| 070 | BBC Basic | 140818T235740Z | Level Ri |
| nan | 160518T002757Z | cat | |
| 012 | CJam | 160221T145649Z | username |
| nan | 151102T155031Z | Addison | |
| nan | 140919T235157Z | jimmy230 | |
| nan | 140816T101200Z | Mark | |
| nan | 151015T010559Z | Mama Fun | |
| nan | 151015T005126Z | user4616 | |
| nan | 150403T135355Z | ASCIIThe | |
| 025 | ><> 25 Bytes | 140818T153947Z | Cruncher |
| nan | 150902T013408Z | The_Bass | |
| nan | 150411T042435Z | Digital | |
| nan | Java | 150531T150446Z | aditsu q |
| nan | 150410T233718Z | mbomb007 | |
| nan | 150402T205914Z | Luke | |
| nan | 150402T204531Z | ASCIIThe | |
| nan | 140905T194020Z | Dennis | |
| nan | 140819T194123Z | shadowta | |
| 001 | Ed | 140816T161338Z | Ian D. S |
| nan | 140818T175402Z | HostileF | |
| nan | 140818T214949Z | DarkAjax | |
| nan | Java 8 compilation error quine | 140818T213610Z | Volune |
| nan | 140818T161102Z | fvla | |
| nan | 140818T075728Z | Οurous | |
| nan | 140817T191538Z | Danko Du | |
| 035 | Lua console | 140817T105610Z | Martin E |
| nan | 140816T145346Z | Falko | |
| nan | CoffeeScript | 140816T092015Z | Martin E |
| 032 | Bash | 140816T134659Z | Ingo B |
| nan | 140816T093151Z | rink.att | |
| nan | 140816T072851Z | Falko | |
| nan | 140816T091514Z | rink.att | |
| nan | 140816T090517Z | Martin E | |
| nan | 140816T083113Z | AndoDaan | |
| nan | 140816T083010Z | rink.att | |
| nan | 140816T072831Z | Howard |
Node v22
[stdin]:1
[stdin]:1
^
SyntaxError: Unexpected token ':'
at makeContextifyScript (node:internal/vm:185:14)
at node:internal/process/execution:107:22
at [stdin]-wrapper:6:24
at runScript (node:internal/process/execution:101:62)
at evalScript (node:internal/process/execution:136:3)
at node:internal/main/eval_stdin:32:5
at ReadStream.<anonymous> (node:internal/process/execution:237:5)
at ReadStream.emit (node:events:520:28)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Node.js v22.7.0
Running from stdin like this:
$ node <<EOF
> [stdin]:1
> [stdin]:1
> ^
>
> SyntaxError: Unexpected token ':'
> at makeContextifyScript (node:internal/vm:185:14)
> at node:internal/process/execution:107:22
> at [stdin]-wrapper:6:24
> at runScript (node:internal/process/execution:101:62)
> at evalScript (node:internal/process/execution:136:3)
> at node:internal/main/eval_stdin:32:5
> at ReadStream.<anonymous> (node:internal/process/execution:237:5)
> at ReadStream.emit (node:events:520:28)
> at endReadableNT (node:internal/streams/readable:1696:12)
> at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
>
> Node.js v22.7.0
> EOF
[stdin]:1
[stdin]:1
^
SyntaxError: Unexpected token ':'
at makeContextifyScript (node:internal/vm:185:14)
at node:internal/process/execution:107:22
at [stdin]-wrapper:6:24
at runScript (node:internal/process/execution:101:62)
at evalScript (node:internal/process/execution:136:3)
at node:internal/main/eval_stdin:32:5
at ReadStream.<anonymous> (node:internal/process/execution:237:5)
at ReadStream.emit (node:events:520:28)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Node.js v22.7.0
Or similarly from a file:
/Users/me/foo.js:1
/Users/me/foo.js:1
^
SyntaxError: Invalid regular expression flags
at wrapSafe (node:internal/modules/cjs/loader:1469:18)
at Module._compile (node:internal/modules/cjs/loader:1491:20)
at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
at Module.load (node:internal/modules/cjs/loader:1317:32)
at Module._load (node:internal/modules/cjs/loader:1127:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5)
at node:internal/main/run_main_module:30:49
Node.js v22.7.0
```
Vyxal 3.7.0, 18 bytes
No such element: #
Any runtime error will result in a massive stack trace from scala, so we have to go with a parsing error. Easy enough, just use a digraph prefix with nothing after it. Except that all other digraphs give a stack trace due to unknown lexer error, so # is the only one that works here.
CASIO BASIC (CASIO fx-9750GIII), 12 bytes!! :3
Syntax ERROR
I'm not sure if this counts or not
Bespoke, 43 bytes
Specifier was expected, but none found: '5'
The only possible error quine in Bespoke.
This program is equivalent to the following "mnemonic" representation:
CONTINUED XXX:INTEIGHT TRI FOUR
INPUT
The reference interpreter performs two steps before interpreting Bespoke code: tokenizing and parsing.
The CONTINUED instruction isn't valid at the very start of the program, which would normally lead to an Unexpected CONTINUED number. error; however, that would only get caught in the parsing step.
The INPUT instruction expects a specifier after it (which specifies what type of input it takes - a number or a character); the tokenizing step catches that no such specifier was found.
perl, 42 + 6 (file name) = 48 bytes
Illegal division by zero at /tmp/p line 1.
Save as contents of /tmp/p and run perl /tmp/p
Marking as community wiki because I did not come up with it, I saw it in this answer. I wanted to include it because I think it's beautiful.
explanation:
By default, text that doesn't parse as an expression in perl is treated as an unquoted string. This meants that at and tmp are just literal strings, and the / in between makes perl try to parse the division 'at'/'tmp'. Since both of them contain no numers, type coercion evaluates both of them to be 0, and obviously you can't divide by zero.
Emoji-gramming, 70 bytes
💻 ⚠️ ➡️ 🚨 3
🚫 🔡 ➡️ 🔲 🔳
😇
None
Note that there are 4 spaces after 😇 and a line feed in the end. This is the error when Emoji-gramming sees invalid characters in a valid command.
Brainfuck (qdb)
unbalanced [.
This is the error message qdb prints when there are more ['s than ]'s.
LOLCODE, 43 bytes
.code.tio:1: unknown token at: .code.tio:1:
Uiua, 95 bytes SBCS
Error: Unexpected token |
at 1:25
1 | Error: Unexpected token |
─
Perl 5, 99 bytes code + 8 bytes file path, 107 bytes
File must be named >>;/\1/a to close off the <-- HERE ... <-- HERE and to reference the nonexistent group in a regex.
Link is to a Bash test suite.
Reference to nonexistent group in regex; marked by <-- HERE in m/\1 <-- HERE / at >>;/\1/a line 1.
YASEPL
ERROR 5 no variable is loaded:(
located at :
very simple
Applescript, 70 bytes
0:2: syntax error: A “:” can’t go after this identifier. (-2740)
Run with osascript -e "0:2: syntax error: A “:” can’t go after this identifier. (-2740)"
(,) 38 Bytes
code must be surrounded by parentheses
Litterally the only possible one on my current interpreter
MirBSD pax, 127 bytes.
Includes trailing newline:
pax: End of archive volume 1 reached
pax: Cannot identify format. Searching...
pax: Sorry, unable to determine archive format.
Usage
$ pax -f quine
pax: End of archive volume 1 reached
pax: Cannot identify format. Searching...
pax: Sorry, unable to determine archive format.
$ pax < quine
pax: End of archive volume 1 reached
pax: Cannot identify format. Searching...
pax: Sorry, unable to determine archive format.
$
Python 3, 105 bytes
File ".code.tio", line 1
File ".code.tio", line 1
^
IndentationError: unexpected indent
Python 3 (IDLE)
SyntaxError: incomplete input
This surprisingly outputs just itself and nothing else.
Desmos
Sorry, I don't understand the '&' symbol.
Go to desmos.com/calculator and paste in the "code".
xidoc, 66 bytes
Error while rendering file
at 2:17-2:18 in []
Command not found:
xidoc, 135 bytes
Error while rendering file
at 3:26-3:26
Parse error: Unexpected ']'
3 │ Parse error: Unexpected ']'
│ ^
JavaScript
Thought I would make an updated JS answer.Firefox:
Uncaught SyntaxError: unexpected token: identifier
Uncaught SyntaxError: Unexpected identifier 'SyntaxError'
Snap! (scratchblocks syntax)
Hmm...
a custom block definition is missing
ACCUMULATOR, 7 bytes
Invalid
Invalid is the only error in ACCUMULATOR. This is because I is not a function in ACCUMULATOR.
gpg (GnuPG) 2.2.40, 157 bytes
Note error is followed by a newline.
gpg: WARNING: no command supplied. Trying to guess what you mean ...
gpg: no valid OpenPGP data found.
gpg: processing message failed: Unknown system error
Usage in shell
I don't know if that source is REALLY a program source.
cat <<'X' >source
gpg: WARNING: no command supplied. Trying to guess what you mean ...
gpg: no valid OpenPGP data found.
gpg: processing message failed: Unknown system error
X
gpg <source >stdout 2>stderr
cat stdout
diff source stderr
Fig, 1292 bytes (UTF-8)
DEBUG:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "x" is null
at clojure.lang.Numbers.ops(Numbers.java:1068)
at clojure.lang.Numbers.incP(Numbers.java:141)
at fig.compression$fromBijectiveBase$fn__191.invoke(compression.clj:26)
at clojure.core.protocols$fn__8181.invokeStatic(protocols.clj:168)
at clojure.core.protocols$fn__8181.invoke(protocols.clj:124)
at clojure.core.protocols$fn__8136$G__8131__8145.invoke(protocols.clj:19)
at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
at clojure.core.protocols$fn__8168.invokeStatic(protocols.clj:75)
at clojure.core.protocols$fn__8168.invoke(protocols.clj:75)
at clojure.core.protocols$fn__8110$G__8105__8123.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6830)
at fig.compression$fromBijectiveBase.invokeStatic(compression.clj:26)
at fig.compression$decompress.invokeStatic(compression.clj:39)
at fig.compression$decompress.invoke(compression.clj:35)
at fig.compression$decompress.invokeStatic(compression.clj:36)
at fig.parsing$lex.invokeStatic(parsing.clj:40)
at fig.core$_main.invokeStatic(core.clj:38)
at fig.core$_main.doInvoke(core.clj:19)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at fig.core.main(Unknown Source)
The tabs sadly disable Fig's scoring system, so this is counted in UTF-8/ASCII. Still no normal Fig quine...
Knight (v2 + EVAL) (knight-lang.netlify.app implementation), 32 bytes
Error: Unknown identifier 'rror'
Different implementations handle errors differently (it is undefined behavior in the official specs), which is why I specified the implementation that I'm using.
Also, this technically only works in version 1.x because EVAL is removed as a required function in the v2 official specs, but this implementation has EVAL even though it is a v2 implementation, which is why I specified EVAL in the header just to be safe.
If EVAL wasn't implemented in this implementation, I think something like Error: No value could be parsed! would be a valid error quine instead (and it coincidentally turns out to also be 32 bytes).
Knight (v1.2) (C (gcc) implementation), 21 bytes
invalid character 'i'
Different implementation, different error messages :)
Desmos, 41 bytes
Sorry, I don't understand the '?' symbol.
Hover over the danger sign to view the error message.
There could be something shorter but I don't have time to go through every single error out there in Desmos lol.
Z-machine interpreter
I don't know the word "know".
Test against this popular interpreter. Also there's some sort of mostly harmless game hosted there.
PPL, 79 bytes
Reference error on line 3, column 3
a()
^
The identifier a is not defined
I haven't implemented syntax checking properly, so only reference errors and type errors are thrown (plus syntax checking in rare cases). Pretty simple answer, frankly. Attempts to call the nonexisting a function (just a without the call does not work because my interpreter does not check for invalid expressions in some cases) I know my language is not very good but I'm too lazy to work on it.
Phooey, 21 bytes
Unknown mode for '$'
Phooey ignores Unknown mode for ', then tries to parse $' which is an unknown mode for $. 😂
Agda, 95 bytes
After a few attempts, I finally found a solution in my favorite dependently typed language! Agda includes the full filename in place of error.agda on lines 1 & 2.
error.agda:3,1-1
error.agda:3,1: Parse error
)<ERROR>
<ERROR>
<ERROR>
<ERROR>
<ERROR...
Save file as error.agda and prepend the full filepath on those first two lines for a local answer, or here: Try it online!
Grok, 20 bytes
You don't grok Grok.
Grok has only one error message, and one of the ways to trigger it is to try to execute an invalid command. In this case, oun'tgrG. are all invalid commands, so when the execution reaches the first o, it errors out, printing the source code.
Pxem (pxemi.2.min.posixism), Filename: 14 bytes + Content: 0 bytes = 14 bytes.
- Filename (has trailing LF!):
.a B4 .[wxyz] - Content: empty.
Brain-flak
Error at character 33: Unclosed '(' character.
Haskell
[1 of 1] Compiling Main ( .code.tio.hs, .code.tio.o )
.code.tio.hs:1:4: error: parse error on input ‘of’
|
1 | [1 of 1] Compiling Main ( .code.tio.hs, .code.tio.o )
| ^^
/srv/wrappers/haskell: line 5: ./.bin.tio: No such file or directory
Stack Cats
Error: invalid character in source code, E | E ,edoc ecruos ni retcarahc dilavni :rorrE
Taxi
error: parse error: likely incomplete statement
Hexadecimal Stacking Pseudo-Assembly language
/opt/hspal/hspal.rb:69:in `run': Illegal opcode: 170 (RuntimeError)
from /opt/hspal/hspal.rb:75:in `<main>'
Quarterstaff
Traceback (most recent call last):
File "/opt/quarterstaff/quarterstaff.py", line 142, in <module>
QuarterstaffInterpreter(open(parser.parse_args().program).read())
File "/opt/quarterstaff/quarterstaff.py", line 7, in __init__
self.run(self.parse(program), {}, 0)
File "/opt/quarterstaff/quarterstaff.py", line 35, in parse
raise Exception
Exception
Haxe
Main.hx:1: characters 0-4 : Unexpected Main
Uncaught exception - load.c(181) : Module not found : .bin.tio
Hasm
Error with instruction <internal{PARSE}> on line 0:
Syntax error or illegal instruction: Error with instruction <internal{PARSE}> on line 0:
Dumping core:
STACK:
OFFSTACK:
HEAP:
0
Mornington Crescent
Traceback (most recent call last):
File "/opt/mornington-crescent/esoterpret.py", line 123, in <module>
arguments.stdin, extra)
File "/opt/mornington-crescent/esoterpret.py", line 41, in use_language
while not(interpreter.has_execution_finished()):
File "/opt/mornington-crescent/modules/morningtoncrescent/morningtoncrescent.py", line 50, in has_execution_finished
raise RuntimeError("You have to end at Mornington Crescent.")
RuntimeError: You have to end at Mornington Crescent.
Muriel
*** ERROR: muriel: Unknown token '*'
Just picked some random esolangs from TIO and keyboard hashed until I got an error, then copy + pasted.
m4 (before 1.4.18-3 Termux patch), Termux, Android 11, 35 bytes
Who said the error had to be caused directly?
FORTIFY: %n not allowed on Android
Includes trailing newline.
m4 uses a very old version of Gnulib.
Since Android doesn't support %n in printf, Gnulib will replace every printf function in libc with its own custom implementation.
However, stupidly, said function will still use libc's snprintf function internally (which it is supposedly trying to replace because it doesn't work 🤔), and when using it, it attempts to use %n every single time it is called, even if %n isn't in the original format string.
%n used to be silently ignored on Android (similar to macOS), but Android 11 made these errors fatal, causing this error to be printed followed by abort().
I used set +m to prevent Bash from printing the signal error, and I had to compile from source to undo the -3 patch.
The file itself doesn't matter: m4 is guaranteed to crash no matter what. This includes running with no arguments.
Swift
This is a bit of a stretch. Bear with me.
The source MUST be encoded as UTF-16. Formatting the following as UTF-16:
swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16
??^@s^@w^@i^@f^@t^@.^@s^@w^@i^@f^@t^@:^@1^@:^@1^@:^@ ^@e^@r^@r^@o^@r^@:^@^@i^@n^@p^@u^@t^@ ^@f^@i^@l^@e^@s^@ ^@m^@u^@s^@t^@ ^@b^@e^@\^@e^@n^@c^@o^@d^@e^@d^@ ^@a^@s^@ ^@U^@T^@F^@-^@8^@ ^@i^@n^@s^@t^@e^@a^@d^@ ^@o^@f^@ ^@U^@T^@F^@-^@1^@6^@
where ^@ is emacs-speak for an embedded NUL and the ? characters are genuine ASCII question marks. Outputting to console (cat doesn't work, being ignorant of UTF16):
$ iconv -f utf-16 swift.swift
swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16
??swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16
and compiling:
$ swiftc swift.swift
We get:
swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16
??swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16
As desired.
CAVEATS:
- The terminal is taking the 16-bit header BOM
\xFF\xFEin the error message fromswiftcand degrading it as ASCII??in the console. - When the swift compiler is run in an Emacs shell, the terminal settings do not process the unprintable ASCII characters, instead rendering them in Octal.
- When the source is rendered in an Emacs buffer, which is UTF-16 aware, the first line appears correctly, and the ?? appears correctly, and but the remaining characters are shown interspersed with
NULliterals rendered as^@. catin the Terminal doesn't work either, being unaware of UTF-16.- A UTF16-aware output utility is needed:
iconv -f utf-16 swift.swift, where the terminal emulator subsequently discards the interspersedNULcharacters on the second line. - In MacOS,
swiftcleverages terminal capabilities to produce bold and color escape codes. To avoid this ambiguity, you can useexport TERM=dumb.
I'm claiming it's a quine as long as the source is rendered with a UTF-16 aware output utility and a terminal that discards ANSI formatting, NULs, and degrades unprintable characters to ?.
USING TextEdit
You can also make a more visually convincing argument using ˛ˇ in place of ?? where you keep the input as UTF-16 and let Swift output the (invalid) UTF-8 output with swiftc swift.swift > out 2>&1 and open out in TextEdit. Side by side, the input and output indeed are rendered identically. No less dubious under the covers, but looks a lot less dubious.
So...when you say exactly identical, what exactly do you mean?
If the output must be re-usable as the input, the quine constraint is indeed violated. And if you argue it's OK to cycle the UTF8 compiler output back to UTF16 source, that seems promising, but doesn't work because the output of swiftc is neither valid UTF-8 nor UTF-16: it is not valid to embed the BOM header midstream in either encoding. It's just terminal poo. Having fun yet?
It's an interesting foray into encoding and terminals, at the least!
Husk, 39 bytes
Could not infer valid type for program
Try it online! The infamous error that everyone is familiar with. Interestingly, I had trouble finding any other error quines: Parse error (missing \): ¶ is nearly one in verbose mode, but it outputs Parse error (missing \): ): ¶¶.
Setanta, 97 bytes
Eisceacht ar líne 1: Suíomh 19: Ag súil le uimhir, téacs, bool, athróg, liosta, nó gníomh.
Rust v1.45.2 (via Rust Playground)
Code (1126 bytes):
error: unknown start of token: `
--> src/lib.rs:1:32
|
1 | error: unknown start of token: `
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
1 | error: unknown start of token: '
| ^
error: unknown start of token: `
--> src/lib.rs:4:36
|
4 | 1 | error: unknown start of token: `
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
4 | 1 | error: unknown start of token: '
| ^
error: character constant must be escaped: '
--> src/lib.rs:7:56
|
7 | help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
| ^
error: unterminated character literal
--> src/lib.rs:9:36
|
9 | 1 | error: unknown start of token: '
| ^
error: aborting due to 4 previous errors
error: could not compile `playground`.
Try it online (error message might differ in future versions of the language, though)
Compile errors in Rust all start with "error:", so copy/pasting the errors into the source a bunch of times eventually leads to these error messages. Default settings for the Rust Playground were used. That means 2018 edition, stable branch, and debug mode. I don't know what the target triple is.
Red 0.6.3
*** Error: not a Red program!
Newline included. Save as a .red file and run with red <filename>.red.
Julia 1.0 (Tio)
Implementation specific, but this one is made to run in Tio.
ERROR: LoadError: UndefVarError: syntax: extra token "token" after end of expression
Stacktrace:
[1] include at ./boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at ./loading.jl:1038
[3] include(::Module, ::String) at ./sysimg.jl:29
[4] exec_options(::Base.JLOptions) at ./client.jl:229
[5] _start() at ./client.jl:421
in expression starting at /home/runner/.code.tio:1
Turing Machine Code, 70 bytes
Syntax error on line 1: <current symbol> should be a single character!
Pepe, 9 bytes
RRRERROR!
Link to interpreter (paste the code above, permalink removes the ! and O)
Explanation:
The interpreter ignores characters other than R,r,E,e so the code is:
RRRERRR
Now to explain:
RE # Push 0
RR # (RR flag: doesn't exist)
RRR # There is no command RRR, so output RRRERROR!
MS SQL (Server version 2012), 64 bytes
Msg 2812, Level 16, State 62, Line 1
Incorrect syntax near '16'.
Piet, using npiet interpreter
cannot read from `Error.txt'; reason: unknown PPM format
Save as 'Error.txt' and put it in the same folder as the npiet executable. If you want to golf, you can of course choose a shorter filename and adjust the code to match.
ESOPUNK, 38 bytes
Invalid instruction INVALID at line 0.
GNU Smalltalk REPL
REPL is always acceptable, and I only learned the Smalltalk REPL and don't know how to save programs in a file. (I think TIO does not have Smalltalk yet.)
stdin:1: expected expression
This will work when you start the REPL for the first time.
A Pear Tree
a partridge
Almost every program (that isn't very long) prints a partridge in A Pear Tree.
One of the goals of the language was to be good at polyglot challenges; as such, it tries to find a substring of the program that has a very specific property that rarely occurs by chance, and starts running the program there. If it can't find an appropriate entry point, it prints an error. The actual text of the error message was chosen for the The Twelve Days of Christmas reference. (Actually, the design for the language worked the other way round; the main goal was to have a language which errored out on almost any source code, so that it would make the reference in question, so I set about trying to work out what sort of language design would naturally end up doing that.)
Chicken
Error on line 1: expected 'chicken'
Loader (using the official Java interpreter):
These should be run from a module named main in order to produce the exact error messages given here.
This works in the most recent version of the interpreter:
Error: Could not evaluate expression Error (module main, line 1)
Explanation:
expression:statement is a conditional. The interpreter doesn't even syntax check the stuff to the right of the colon (if it did, we'd get a different error message) unless the stuff on the left evaluates to a nonzero value. However, as "Error" is an illegal expression, the interpreter can't evaluate it, exiting the program with this error message.
In some earlier interpreter versions, this would work instead:
Exception in thread "main" java.lang.RuntimeException: Could not evaluate expression Exception in thread "main" java.lang.RuntimeException (module main,line 1)
at Loader.expr(Loader.java:183)
at Loader.load(Loader.java:201)
at Loader.main(Loader.java:249)
Pip, 71 bytes
code and error:
R is not a unary operator
Fatal error while parsing, execution aborted.
also:
Hit end of tokens while parsing expression
Fatal error while parsing, execution aborted.
33
Very simple. : isn't a valid command, so it's easy to make an unrecognised token error quine. The error is just where the : is in the code.
33 (1:8): Unrecognised token
W.Y.A.L.H.E.I.N., 253 bytes
Traceback (most recent call last):
File "/opt/wyalhein/whenyouaccidentallylose100endorsementsinnationstates.py", line 6, in <module>
seed = int(contents[0])
ValueError: invalid literal for int() with base 10: 'Traceback (most recent call last):\n'
whenyouaccidentallyloseahundredendorsementsinnationstates expects a seed on the first line, and Traceback (most recent call last): is not a valid number (unless we're talking in base 96, of course, but whenyouaccidentallyloseahundredendorsementsinnationstates doesn't).
Triangularity, 46 bytes
I smell no triangularity. YOU SHALL NOT PASS!
The language requires programs to be in the form of a triangle. If not, it denies you the gate to programming in the world of triangles. It will not let you pass.
Snowman, 121 bytes
SnowmanException thrown at tokenize
what(): at tokenize: letter operator terminated prematurely?
fatal error, aborting
Ly
Error occurred at program index 3, instruction o (zero-indexed, includes comments)
EmptyStackError: cannot pop from an empty stack
Demo (using official compiler)
This program makes use of the o in "Error", the first instruction character in the error message that produces an error. (apparently r does nothing with an empty stack)
When a stack is not empty, o takes the top entry off the selected stack and outputs it as ASCII;
EmptyStackError occurs when the selected stack is empty. So when Ly runs into this o, it causes this error, since we haven't given the stack anything yet.
ZSH (macOS), 20 bytes excluding newline
zsh: bad pattern: ^[
ink, 65 bytes
ERROR: 'q' line 1: Empty diverts (->) are only valid on choices
Must be saved in a file called q, which is why the code on TIO is 7 bytes longer.
Turing Machine But Way Worse, 258 bytes
Traceback (most recent call last):
File "/opt/tmbww/TuringMachineButWayWorse.py", line 16, in <module>
i[0], i[2], i[3], i[5], i[6] = int(i[0]), int(i[2]), int(i[3]), int(i[5]), int(i[6])
ValueError: invalid literal for int() with base 10: 'Traceback'
GHCi (a Haskell interpreter/shell)
Code.hs:1:1: Parse error: naked expression at top level
Usage:
Write the code in a file named Code and load with GHCi.
A nice fact is that, if the words were actual identifiers, this would be a legal expression (as long as it would typecheck). This is basically due to the fact that : is a built in operator, . is used for module-qualified names, and whitespace is used to denote function application.
Rust, 323 166 164 bytes
Call your program a. and use rustc a..
error: unknown start of token: \
--> a.:1:32
|
1 | error: unknown start of token: \
| ^
error: aborting due to previous error
K (ngn/k), 2 bytes
'c
'c is the response from the console indicating that the variable c is undefined
VB.Net, 32 Bytes
Create a new, empty project named 'A'. Set the startup object to "Sub Main" (it's a drop-down option). Create a new class called anything. Delete everything from the class and copy/paste the following:
'Sub Main' was not found in 'A'.
This works because a single quote is a comment, so it looks like a blank file :D
Python 3, 28 bytes
SyntaxError: invalid syntax
Windows .EXE, 248 bytes
The version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need an x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.
No, really. Save as quine.txt, then rename to quine.exe (or download it here):
Cubically, 94 bytes
Notepad: 0
000
000
000
111222333444
111222333444
111222333444
555
555
555
There are newlines at the start and end. (Cubically automatically dumps its memory to STDERR when the program finishes.)
C
I applied the method of repeatedly copying the error messages to the source. It converged in 2 cycles. Compiled on OSX 10.9 with 'cc -c error.c'.
error.c:1:1: error: unknown type name 'error'
error.c:1:1: error: unknown type name 'error'
^
error.c:1:6: error: expected identifier or '('
error.c:1:1: error: unknown type name 'error'
^
2 errors generated.
Note: This is not so much an answer as it is a methodology to get one. The result might change depending on your OS or the version of cc you are using.
The exact method to get the result is to execute the instructions
$ cc -c error.c 2>out ; mv out error.c ; cat error.c
repeatedly until the output stops changing.
INTERCALL, 90 bytes
Fatal error: A INTERCALL program must start with the mandatory header to prevent golfing.\n
Includes a trailing newline at the end. Note that this isn't STDERR, but it was considered to be error output by many, so I posted it here.
This is the "mandatory header":
INTERCALL IS A ANTIGOLFING LANGUAGE
SO THIS HEADER IS HERE TO PREVENT GOLFING IN INTERCALL
THE PROGRAM STARTS HERE:
C (gcc)
error.c:1:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
error.c:1:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
^
compilation terminated due to -Wfatal-errors.
Compile with gcc -Wfatal-errors error.c.
Python 3
File ".py", line 1
File ".py", line 1
^
IndentationError: unexpected indent
x86 assembly
Bytecode:
53 65 67 6d 65 6e 74 61 75 69 6f 6e 20 66 61 75
6c 74 20 28 63 6f 72 65 20 64 75 6d 70 65 64 29
i.e. the text
Segmentation fault (core dumped)
Crashes immediately because the second instruction (the first being just "push %[er]bx") is
insl (%dx), %gs:(%di)
which fails because (a) ins cannot take segment overrides, (b) %dx and %di are almost certainly uninitialized, (c) %di is a 16-bit memory address and therefore can't be accessed in long mode, (d) ins is an invalid instruction outside of real mode.
The exact output may vary depending on what system this is run on, but it is likely that it will contain some form of illegal instruction.
NASM for x86: 45 bytes
e.asm:1: error: parser: instruction expected
Assemble (or attempt to assemble) with nasm e.asm
Just in case:
0:beau@beau-Latitude-E6330:[~/asm/q]$ nasm -v
NASM version 2.12.02 compiled on Feb 5 2017
0:beau@beau-Latitude-E6330:[~/asm/q]$
k, oK
Might as well group these answers together, since it's supposedly the same language. I must say, this general approach is quite versatile.
oK
Every error seems to have a lot of environment-specific information, because, well, JavaScript is behind it all. Try it online!
/opt/ok/oK.js:876
throw new Error("unexpected character '"+text[0]+"'");
^
Error: unexpected character ')'
at Object.parse (/opt/ok/oK.js:876:8)
at Object.<anonymous> (/opt/ok/repl.js:62:43)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:390:7)
at startup (bootstrap_node.js:150:9)
k
Notice the space at the bottom. This works in 2016.06.28 (c) arthur whitney version of kmac.
a ^ value error
sed
By using this general approach, I have converged on several sed error quines. This may not work in your sed, in which case, you're using the wrong sed, and therefore would you please acquire necessary, error-quining sed.
Try it online! This version works in TIO, and probably not anywhere else. Open the "Debug" panel to see the error.
Where sed is macOS's default sed, and gsed is a GNU sed.
KSH script, 48 bytes
Save as a file named k.
k[1]: not: not found [No such file or directory]
Try it online! Note that TIO saves KSH scripts as .code.tio, so it's a bit longer but still the same thing.
Syms, 202 bytes
Traceback (most recent call last):
File "/opt/syms/syms.py", line 196, in <module>
stack.append(("{"+str(stack.pop())+"}").replace("\\","\\\\").replace("&","\\&"))
IndexError: pop from empty list
Try it online! Works on TIO. May not work on your configuration.
(t)csh
Unmatched '.
The trailing newline is needed to produce an exact match. Run it with csh quine.csh (or just type it into the shell, that works too).
GNU Make 4.1
make: *** No rule to make target 'No', needed by 'make'. Stop.
This is syntactically valid:
- Make tries to evaluate the target named
make(first target is the default), - which depends on the target named
No, - which it has no rule for.
GW-BASIC (least: 12 bytes)
Syntax error
Inspired by the Commodore 64 BASIC answer. Knocked off 2 bytes because IBM and DOS are better than Commodore :P You can download an emulator for GW-BASIC.
NEXT without FOR
Since GW-BASIC is a line-based language, it only evaluates the first instruction after a newline or colon :. Therefore, it reads NEXT and automatically fails it didn't read a FOR.
Apple ][ BASIC (13 bytes)
?SYNTAX ERROR
Woo, 1 less byte than the Commodore answer because the old Apples could beat a Commodore anyday :P
QBasic (43 bytes)
Parse failed: Syntax error at 1:1: Token(:)
Might be cheating because it only works on the first line.
Applesoft BASIC (69 bytes)
ParseError: Syntax error: Expected line number or separator in line 0
Also only works on the first line...
MATLAB, 66 bytes
Undefined function 'Undefined' for input arguments of type 'char'.
This outputs the same to STDERR (shown in the console in red):
This is actually pretty unknown functionality (and it's rarely useful), which is why the MATLAB submission in the "Hello World!"-challenge may be improved.
This works because MATLAB will automatically interpret a command on the form <word_1 word_2 word_3 word_4>, with no surrounding brackets, as a function on the form:
word_1('word_2')`
That is, it calls a function word_1 and gives the single input argument after the first, and in front of the second space as a string input to that function.
"Real life"-examples that can be used for golfing:
disp Hello % Shorter than disp('Hello')
Hello
disp Hello World!
Hello
nnz variable
ans =
8
Note that it will always interpret it as a string, it will not evaluate it:
variable = 3;
nnz variable
ans =
8
nnz(variable)
ans =
1
Python 3.5
Note: the source file should be named "1" for this to work
File "1", line 1
File "1", line 1
^
IndentationError: unexpected indent
ForceLang
Works in the latest version of the reference implementation as of the time this answer was written.
Exception in thread "main" lang.exceptions.IllegalInvocationException: Exception is not a function.
at lang.ForceLang.parse(ForceLang.java:52)
at lang.ForceLang.main(ForceLang.java:129)
Pyth
s_push: parser stack overflow
Traceback (most recent call last):
File "pyth.py", line 752, in <module>
exec(code_to_remove_tools + py_code_line, environment)
MemoryError
SmileBASIC
NEXT without FOR in 0:1
Whenever the pre-run parser encounters a NEXT which isn't paired with a FOR, it produces the error NEXT without FOR in slot:line. Here, the code is in slot 0 and on line 1.
Processing IDE
Probably the friendliest error message I've ever seen.
Syntax error, maybe a missing semicolon?
Result
Technically this is cheating a bit because the pane below it prints expected SEMI, found 'error'. Unfortunately the word error is written in single quotes, so trying to copy that into the source of the program causes it to spit out a massive "Badly formed character constant" error... which does not include any singly-quoted words allowing for it to quine itself.
ArnoldC, 28 bytes
WHAT THE FUCK DID I DO WRONG
This is the only error message in ArnoldC, though you do have to turn off stack traces.
TrumpScript - Making PPCG Great Again (TrumpScript)
When trying to run this language on a windows PC, the output is always:
Make sure the currently-running OS is not Windows, because we're not PC
So when running this program:
Make sure the currently-running OS is not Windows, because we're not PC
It won't even parse it because the OS check fails, and you get the error message. Examples can be given for Mac as well if anyone wants them haha. God I've wanted to use this in PPCG for awhile now, good that I finally get to.
Full list of errors that can be triggered using environmental specifics:
https://github.com/samshadwell/TrumpScript/blob/master/src/trumpscript/utils.py
Bonus Answer: ArnoldC (ArnoldC)
ArnoldC requires root declaration of IT'S SHOWTIME, meaning main(), so:
WHAT THE FUCK DID I DO WRONG
Results in the only error message in ArnoldC...
WHAT THE FUCK DID I DO WRONG
Which, is actually... hilarious. You have to run it non-verbose though w/o stack traces.
Ada
test.adb:1:01: compilation unit expected
Really just make an ada file, toss it at the start as above and compile with gcc filename.adb -c.
Mathematica
Syntax: "needed." is incomplete; more input is needed.
A . in Mathematica means either a decimal point or function Dot. In this case, the . appears at the end of an expression and cannot be interpreted.
Microsoft Excel
Formula: #DIV/0!
Error Message: #DIV/0!
In order to enter a formula without using an equals sign, go into Excel Options/Advanced/Lotus Compatibility Settings and enable Transition Formula Entry.
JavaScript
Uncaught SyntaxError: Unexpected identifier
Throws a generic Unexpected identifier error (in Chrome, at least) because it doesn't recognize Uncaught as an identifier.
F#
e.fs(1,11): error FS0010: Unexpected symbol ':' in implementation file
Compile with fsc --nologo e.fs. Again, there's an extra blank line I can't properly reproduce here. (Without the --nologo flag the compiler wants to announce itself and its version number and display a Microsoft copyright message.)
Elixir
== Compilation error on file e.ex ==
** (SyntaxError) e.ex:3: keyword argument must be followed by space after: ex:
(elixir) lib/kernel/parallel_compiler.ex:114: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
Put the code in e.ex and compile with elixirc e.ex. There are also some blank lines in the output (and in the file), but I can't get them to appear on here; S.O. eats them.
Bash
$ bash: bash:: command not found
bash: bash:: command not found
Straw
/opt/straw/straw.rb:108:in `initialize': no implicit conversion of nil into String (TypeError)
from /opt/straw/straw.rb:108:in `new'
from /opt/straw/straw.rb:108:in `step'
from /opt/straw/straw.rb:225:in `run'
from /opt/straw/straw.rb:254:in `<main>'
BBC Basic, 7 bytes (or 0 Bytes)
This is a valid 7 byte entry:
Mistake
This is the error message produced by the interpreter when it is completely unable to make sense of the code.
On the other hand, this is not:
ERROR
This is a valid keyword in BBC Basic which is supposed to deliberately introduce an error of a specified code into the program, but the syntax is wrong (no code is given.) Therefore it returns Syntax error (which in turn returns Mistake when it is run.)
In general the procedure described by Falko in his answer leads to Mistake in BBC basic. There are a few exceptions. anything producing the errorsDATA not LOCAL or ON ERROR not LOCAL leads to the famous zero byte quine: an empty source code produces an empty file.
Given that most error messages in BBC basic are lowercase (and therefore not valid keywords) I am pretty sure that any invalid input will ultimately lead to one of these possibilities.
Factor
No word named "No" found in current vocabulary search path
Guess what it prints?
No word named "No" found in current vocabulary search path
CJam, 12 bytes
u not handled
When operator doesn't exist, interpreter prints * not handled
AppleScript
A identifier can’t go after this identifier.
Both A and identifier can be identifiers, so AppleScript says no.
C++ (g++)
The file must be saved as 1.pas.
g++: error: 1.pas: Pascal compiler not installed on this system
Commodore 64 Basic
?SYNTAX ERROR
When run on the emulator of your choice (or an actual Commodore 64), produces
?SYNTAX ERROR
This is, in fact, a syntactically-valid one-line program. The question mark is a shortcut for PRINT, and SYNTAX and ERROR are valid variable names. The error occurs because the parser gets confused by the substring OR in ERROR.
CJam
Syntax error:
java.lang.RuntimeException: y not handled
zsh (Linux)
zsh: command not found: zsh:
Should work with some small changes in just about any other shell.
><> - 25 Bytes
something smells fishy...
In Fish, any bad instruction outputs the error: "something smells fishy...". Since s is not a valid command, it errors immediately.
ChucK
Here's my contribution:
[chuck]:line(1).char(8): syntax error
This works if you first type it into the editor, save it as "chuck", and then run it once. If you run it another time the number in char() goes up by eight.
ChucK can be downloaded here.
Applescript (in Script Editor)
Syntax Error
A "error" can't go after this identifier.

Java, in Eclipse
Syntax error on tokens, delete these tokens
C++
(Using Apple LLVM in Xcode)
Unknown type name 'Unknown'
Expected ';' after top level declarator
Perl
syntax error at quine.pl line 2, at EOF
Execution of quine.pl aborted due to compilation errors.
Replace quine.pl with whatever you named the file and enjoy.
R (GUI)
Error: unexpected symbol in "Error: unexpected symbol"
The issue here is replicating the ", which causes the error message to change from unexpected symbol to unexpected string constant. Pretty much any error R throws will have the form Error: <something> in "<bad code>", so you will pretty much always have to contend with the quoting. I tried this several other ways and always ended up falling back here.
Ed (1 byte)
All the other solutions thus far are long and ugly. I suppose that is because of the nature of most error messages. But a good error message is elegant in its simplicity. For that, look no further than ed.
?
Save this to a file called edscript and run with ed < edscript, or run ed<<<?. The result:
?
The question mark is written to stderr and ed returns 1, so this actually is an error message. I wonder why ed isn't very popular?
False (0 bytes)
Run with false filename. It writes the program's source code (i.e. nothing) to stderr and returns 1. Of course, calling false a programming language is questionable, and the zero byte quine is unoriginal, but I thought I might as well add it. There is probably some interpreter for a language that prints no error messages, and could replace false.
Now I wish this was code golf.
Rebol
Interestingly, the error message here parses as symbols/tokens:
x
** Script error: x has no value
** Where: do either either either -apply-
** Near: do intern code
So despite looking error-like, it could be made a valid Rebol program if you gave all the words meanings.
However if you wanted an error at the parse phase vs. a runtime error in the code, the program/error could be:
1A
** Syntax error: invalid "integer" -- "1A"
** Where: to case load either either -apply-
** Near: (line 1) 1A
So given that distinction is possible, you can do fun things if you redefine ** from exponentiation into something else (which I can't think of how to make useful for this particular challenge, given it's a quine.)
(Note: Trying to abuse it for a trick uncovered a peculiarity of what happens when ** (an infix operator) is redefined and then used immediately after. I tried:
**: function [:a :b :c :d :e :f] []
** Syntax error: invalid "integer" -- "1A"
** Where: to case load either either -apply-
** Near: (line 1) 1A
My goal was to override the ** so that it would accept its arguments unevaluated. That way ** Syntax error: invalid "integer" -- "1A" (or whatever) would not attempt to assign invalid to error, but pass the symbols to **. But because ** is infix it attempted to raise the function body to the power of Syntax prior to the completion of the assignment of **:.
It can be remedied by putting any token between the [] and the **. But it helps to remember how your language evaluator works. :-P)
ksh
$ ksh: ksh:: not found.
ksh: ksh:: not found.
Java 8 compilation error quine (12203 bytes)
Generated on windows + mingw with java 1.8.0_11 jdk, using this command:
echo a > Q.java; while true; do javac Q.java 2> Q.err; if [ $(diff Q.err Q.java | wc -c) -eq 0 ]; then break; fi; cat Q.err > Q.java; done
May not be the shortest one, may not be the longest one either, more a proof of concept. Works because error output shows at most 100 errors.
Q.java:1: error: class, interface, or enum expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:1: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:1: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
^
(use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:1: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:2: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:2: error: ';' expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:2: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
^
Q.java:2: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:2: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:2: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:2: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
^
(use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:2: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:3: error: illegal start of type
^
^
Q.java:4: error: = expected
Q.java:1: error: <identifier> expected
^
Q.java:4: error: <identifier> expected
Q.java:1: error: <identifier> expected
^
Q.java:4: error: ';' expected
Q.java:1: error: <identifier> expected
^
Q.java:4: error: illegal start of type
Q.java:1: error: <identifier> expected
^
Q.java:4: error: = expected
Q.java:1: error: <identifier> expected
^
Q.java:5: error: '(' expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:5: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:5: error: ';' expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:5: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
^
Q.java:5: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:5: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:5: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:5: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
^
(use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:5: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:6: error: illegal start of type
^
^
Q.java:7: error: = expected
Q.java:1: error: <identifier> expected
^
Q.java:7: error: <identifier> expected
Q.java:1: error: <identifier> expected
^
Q.java:7: error: ';' expected
Q.java:1: error: <identifier> expected
^
Q.java:7: error: illegal start of type
Q.java:1: error: <identifier> expected
^
Q.java:7: error: = expected
Q.java:1: error: <identifier> expected
^
Q.java:8: error: '(' expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:8: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:8: error: ';' expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:8: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
^
Q.java:8: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:8: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:8: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:8: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
^
(use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:8: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:9: error: illegal start of type
^
^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: <identifier> expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: ';' expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: illegal start of type
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: illegal start of type
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: <identifier> expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: unclosed character literal
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: ';' expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: unclosed character literal
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
^
Q.java:11: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:11: error: ';' expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:11: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
^
Q.java:11: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:11: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:11: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:11: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
^
(use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:11: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:12: error: illegal start of type
^
^
Q.java:12: error: <identifier> expected
^
^
Q.java:13: error: = expected
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:13: error: ';' expected
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:13: error: <identifier> expected
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:13: error: = expected
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:13: error: ';' expected
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:13: error: = expected
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:13: error: unclosed character literal
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:13: error: unclosed character literal
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:13: error: = expected
(use -source 1.4 or lower to use 'enum' as an identifier)
^
Q.java:14: error: <identifier> expected
Q.java:1: error: = expected
^
Q.java:14: error: ';' expected
Q.java:1: error: = expected
^
Q.java:14: error: illegal start of type
Q.java:1: error: = expected
^
Q.java:14: error: = expected
Q.java:1: error: = expected
^
Q.java:14: error: illegal start of type
Q.java:1: error: = expected
^
Q.java:15: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: ';' expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
^
(use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:15: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:16: error: illegal start of type
^
^
Q.java:17: error: = expected
Q.java:2: error: <identifier> expected
^
Q.java:17: error: <identifier> expected
Q.java:2: error: <identifier> expected
^
Q.java:17: error: ';' expected
Q.java:2: error: <identifier> expected
^
Q.java:17: error: illegal start of type
Q.java:2: error: <identifier> expected
^
Q.java:17: error: = expected
Q.java:2: error: <identifier> expected
^
100 errors
Befunge on Wasabi v1.4
There is an interpreter for Befunge called Wasabi, and when an error appears the error message is in the format of a dialog box. This is the program:
Unsupported Command : 'U' at (1, 0). Ignore next syntax error(s)?
To test, download Wasabi v1.4 and insert the above program.
Cobra
test.cobra(1): error: Expecting use, assembly, namespace, class, interface or enum, but got "test".
Compilation failed - 1 error, 0 warnings
Not running due to errors above.
Windows Command Prompt
& was unexpected at this time.

Lua (console), 35 bytes
This is what you get in the Lua console with the usual iterative approach:
stdin:1: '<name>' expected near '1'
which is a bit shorter than the one obtained for putting the code in a file.
Whitespace
First I thought this is clearly impossible. But actually it is trivial as well. -.-
Fail: Input.hs:108: Non-exhaustive patterns in function parseNum'
Yeah, my first whitespace program! ;)
CoffeeScript, syntactically valid
As tested on their website using Chrome or Firefox.
ReferenceError: defined is not defined
You can replace defined with anything that's not a built-in variable, but I thought this version was fun. Unfortunately, undefined is not defined in particular doesn't work as a quine.
In CoffeeScript this isn't even a syntax error, because it compiles. This is technically a runtime error in JavaScript, albeit a boring one. CoffeeScript is a likely candidate to produce some more interesting runtime error quines because a lot of funny sentences are valid code. E.g. the above example compiles to
({
ReferenceError: defined === !defined
});
Bash (32)
Save as file named x:
x: line 1: x:: command not found
When run:
>> bash x
x: line 1: x:: command not found
Go
Another fairly easy one using the "general approach" provided in the other answer. I still like my JavaScript ones better.
can't load package: package :
prog.go:1:1: expected 'package', found 'IDENT' can
prog.go:2:2: invalid package name _
Python
Spyder
Well, a rather trivial solution for the Spyder IDE is to raise a SyntaxError.
Code and identical output:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
execfile(filename, namespace)
File "/Users/falko/golf.py", line 1
Traceback (most recent call last):
^
SyntaxError: invalid syntax
(Python 2.7.8 with Spyder 2.2.5)
Terminal
An alternative solution for Python started from command line struggles with an unexpected indent.
Command:
python golf.py
Code and identical output:
File "golf.py", line 1
File "golf.py", line 1
^
IndentationError: unexpected indent
ideone.com
On ideone.com a solution might be as follows. (Try it!)
Code and identical output:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/py_compile.py", line 117, in compile
raise py_exc
py_compile.PyCompileError: SyntaxError: ('invalid syntax', ('prog.py', 1, 22, 'Traceback (most recent call last):\n'))
(This is for Python 2. An example for Python 3 is trivial but with 15 lines of "code" rather lengthy.)
General approach:
How to create your own solution in 2 minutes?
- Open a new file in an IDE of your choice.
- Bang your head onto the keyboard in front of you.
- Compile.
- Replace the code with the compiler error message.
- Repeat steps 3 and 4 until the code converges.
I bet such a procedure terminates pretty quickly in most cases!
CoffeeScript
Fails on first error, so it's fairly easy to do:
E:\foo.coffee:1:3: error: unexpected \
E:\foo.coffee:1:3: error: unexpected \
^
Demo
E:\>coffee -c foo.coffee
E:\foo.coffee:1:3: error: unexpected \
E:\foo.coffee:1:3: error: unexpected \
^
E:\>
Julia 0.2.0
Another syntax error found iteratively until a fixed point was reached:
ERROR: syntax: extra token "token" after end of expression
Lua
Code:
lua: ERROR.lua:1: function arguments expected near '.'
It seems fairly easy to do with lua. I also modified it to work on ideone.com as:
luac: prog.lua:1: function arguments expected near '.'
JavaScript
Since different browsers use different JavaScript compilers, they produce different messages. These are, however, rather trivial solutions.
V8 (Chrome 36 / Node.js)
SyntaxError: Unexpected identifier

SpiderMonkey (Firefox 31)
SyntaxError: missing ; before statement

Chakra (Internet Explorer 11)
Expected ';'

Ruby 2 on Windows
Code:
error.rb:1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
error.rb:1: syntax error, unexpected tI...
^
The code was found by testing and iterating the process over and over until a fix-point was reached. The code must be inside the file "error.rb".
Demo:
C:\>type error.rb
error.rb:1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTR
ING_DBEG or tSTRING_DVAR or tSTRING_END
error.rb:1: syntax error, unexpected tI...
^
C:\>ruby.exe error.rb
error.rb:1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTR
ING_DBEG or tSTRING_DVAR or tSTRING_END
error.rb:1: syntax error, unexpected tI...
^








