In the programming language of your choice, take no input and output your programming language's name.

Fair enough, right?


  • You can't use any character that is included in your programming language's name in your code. E.g., if I use Batch, I must not use the chars 'B' 'a' t' 'c' 'h' in my code. Note that this is case sensitive. I can still use the char 'b' because it's different from 'B'.
  • You can have "junk output" before or after the name of the language
  • Version number doesn't count as part of the name of the language. E.g., I can use the number 3 in the code in my answer if it's in Python 3
  • The output of the programming language name is not case sensitive.
  • Brute-forcing all possible letter combinations and hoping you get your language name is forbidden.

Example outputs: (let's say my programming language is called Language) (✔ if valid, else ✖)

  • Language
  • Body language is a type of non-verbal communication in which physical behavior, as opposed to words, is used to express or convey information. Such behavior includes facial expressions, body posture, gestures, eye movement, touch and the use of space.
  • Language 2.0 - © 1078 AD some company
  • foobar

This is thus shortest code wins.

  • 7
    \$\begingroup\$ The rule about case sensitive restrictions is very ambiguous. Which is the correct orthography: BASIC Basic or basic? I'm pretty sure I can find examples for all three. \$\endgroup\$ – Level River St Jan 24 '17 at 23:47
  • 7
    \$\begingroup\$ Obligatory "Just having your code be blank but have a flag like --version isn't allowed"? \$\endgroup\$ – Value Ink Jan 25 '17 at 0:00
  • 89
    \$\begingroup\$ Have case-insensitive output while banning the language name case-sensitively allows boring solutions that just output the language name case-swapped. \$\endgroup\$ – xnor Jan 25 '17 at 0:47
  • 12
    \$\begingroup\$ You made a mistake by allowing users to output junk data. All they have to do is use a language where the compiler include the name whenever there's an error. It's cool but not the challenge I was hoping for \$\endgroup\$ – Lynob Jan 26 '17 at 8:23
  • 3
    \$\begingroup\$ This question really needs to be specified that "Code" must be run. Most languages will show their name in the usage dump if you don't give any code--for instance "Java" or "Groovy" at the command line with no code will display the correct name, however if you pass code (even "empty" code) as in (groovy -e "") you will get an empty response. Same for compile problems, the compiler usage or error output does not mean you wrote a program. \$\endgroup\$ – Bill K Jan 26 '17 at 18:30

131 Answers 131

2 3 4 5

Outputs to STDERR

Outputting to STDERR is now at +33/-21 as an allowed default, which is positive but contested. This is a CW answer to collect answers that just invoke an error in a language where error messages includes the language name.

Haskell, 1 byte



Parse error: naked expression at top level
Perhaps you intended to use TemplateHaskell

Lua, 1 byte



lua: .code.tio:1: syntax error near <eof>

(file name is unimportant)

Batch, 1 byte



'~' is not recognized as an internal or external command,
operable program or batch file.

tinylisp, 5 bytes



Error: cannot cons to Int in tinylisp

R, 1 byte



Error: unexpected ')' in ")"

Java bytecode, 0 bytes


Exception in thread "main" java.lang.ClassFormatError: Truncated class file

Groovy, 1 byte


Note that a can be replaced with any other character


groovy.lang.MissingPropertyException: No such property: a ...

MATLAB, 1 byte



Error: Unexpected MATLAB operator.

PHP, 3 bytes



PHP Parse error:  syntax error, unexpected end of file in /home/runner/.code.tio on line 1

CJam, 1 byte



RuntimeException: The stack is empty
Java exception:
java.lang.RuntimeException: The stack is empty
    at net.aditsu.cjam.CJam.pop(CJam.java:75)
    at net.aditsu.cjam.Op2.run(Op2.java:10)
    at net.aditsu.cjam.Block.run(Block.java:304)
    at net.aditsu.cjam.CJam.runCode(CJam.java:210)
    at net.aditsu.cjam.CJam.main(CJam.java:240)

Twig, 2 bytes

Twig is a template language written in PHP. It's possible that this is a polyglot.



PHP Fatal error:  Uncaught exception 'Twig_Error_Syntax' with message [...] in [...][...]:n:
Stack trace:
#0 [...]

The message varies depending on which program you choose.

S.I.L.O.S, 2 bytes


Try it online! Trivially invokes undocumented behavior. Silos is the name of the language.

Python, 6 bytes


As the character restriction is case insensitive, and the output doesn't have to be in the correct case, this is a valid answer. The error message it produces is something like this:

Traceback (most recent call last):
  File ".code.tio", line 1, in <module>
NameError: name 'pYTHON' is not defined

Try it online! (outputs to 'debug' tab)

JavaScript, 10 bytes


This produces the following error message or similar in all environments:

ReferenceError: jAVAsCRIPT is not defined

QBIC, 6 bytes


In 6 bytes, we can put QBIC encountered error: 9 on the screen, signifying an out-of-bounds error.

ForceLang, 2 bytes


Error produced:

Exception in thread "main" lang.exceptions.IllegalInvocationException: null is not a function.
    at lang.ForceLang.parse(ForceLang.java:99)
    at lang.ForceLang.main(ForceLang.java:129)

Pip, 5 bytes


(Note: this works in the current version as of this writing, No guarantees the interpreter won't change to handle this error differently in the future.)

Tries to regex match with a syntactically invalid pattern. The error produced will look something like this:

Traceback (most recent call last):
  File "/opt/pip/pip.py", line 221, in <module>
  File "/opt/pip/pip.py", line 206, in pip
    state.executeProgram(tree, args)
  File "/opt/pip/execution.py", line 56, in executeProgram
    returnVal = self.functionCall(mainFunction, cmdLineArgs)
  File "/opt/pip/execution.py", line 368, in functionCall
    returnVal = self.getRval(returnExpr)
  File "/opt/pip/execution.py", line 235, in getRval
    expr = self.evaluate(expr)
  File "/opt/pip/execution.py", line 213, in evaluate
    result = opFunction(*args)
  File "/opt/pip/execution.py", line 1134, in FIRSTMATCH
    matchObj = regex.asRegex().search(str(string))
  File "/opt/pip/ptypes.py", line 175, in asRegex
    self._compiled = re.compile(pyRegex)
  File "/usr/lib64/python3.6/re.py", line 233, in compile
    return _compile(pattern, flags)
  File "/usr/lib64/python3.6/re.py", line 301, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib64/python3.6/sre_compile.py", line 562, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib64/python3.6/sre_parse.py", line 855, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib64/python3.6/sre_parse.py", line 416, in _parse_sub
    not nested and not items))
  File "/usr/lib64/python3.6/sre_parse.py", line 765, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
  File "/usr/lib64/python3.6/sre_parse.py", line 416, in _parse_sub
    not nested and not items))
  File "/usr/lib64/python3.6/sre_parse.py", line 523, in _parse
    source.tell() - here)
sre_constants.error: unterminated character set at position 8

Stax, 2 bytes



Stax runtime error: rational divide by zero

zh also works.

ink, 1 byte


~ at the start of a line marks that the line is a statement to be executed, rather than text to be printed. As of whichever version of inklecate TIO is using, if there's nothing after the ~, the interpreter crashes with the following error:

System.NullReferenceException: Object reference not set to an instance of an object
  at Ink.InkParser.LogicLine () [0x000b1] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.StringParser.ParseObject (Ink.StringParser+ParseRule rule) [0x00012] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.StringParser.OneOf (Ink.StringParser+ParseRule[] array) [0x0000a] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.InkParser.StatementAtLevel (Ink.InkParser+StatementLevel level) [0x00009] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.InkParser+<>c__DisplayClass134_0.<StatementsAtLevel>b__0 () [0x00000] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.StringParser.ParseObject (Ink.StringParser+ParseRule rule) [0x00012] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.StringParser.Interleave[T] (Ink.StringParser+ParseRule ruleA, Ink.StringParser+ParseRule ruleB, Ink.StringParser+ParseRule untilTerminator, System.Boolean flatten) [0x00040] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.InkParser.StatementsAtLevel (Ink.InkParser+StatementLevel level) [0x0004f] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.InkParser.Parse () [0x00000] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.Compiler.Compile () [0x00033] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.CommandLineTool..ctor (System.String[] args) [0x001a3] in <d64e27e7788347b2a5377c9e19bbdcab>:0 
  at Ink.CommandLineTool.Main (System.String[] args) [0x00000] in <d64e27e7788347b2a5377c9e19bbdcab>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at Ink.InkParser.LogicLine () [0x000b1] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.StringParser.ParseObject (Ink.StringParser+ParseRule rule) [0x00012] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.StringParser.OneOf (Ink.StringParser+ParseRule[] array) [0x0000a] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.InkParser.StatementAtLevel (Ink.InkParser+StatementLevel level) [0x00009] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.InkParser+<>c__DisplayClass134_0.<StatementsAtLevel>b__0 () [0x00000] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.StringParser.ParseObject (Ink.StringParser+ParseRule rule) [0x00012] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.StringParser.Interleave[T] (Ink.StringParser+ParseRule ruleA, Ink.StringParser+ParseRule ruleB, Ink.StringParser+ParseRule untilTerminator, System.Boolean flatten) [0x00040] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.InkParser.StatementsAtLevel (Ink.InkParser+StatementLevel level) [0x0004f] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.InkParser.Parse () [0x00000] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.Compiler.Compile () [0x00033] in <b1e5e74f4ee842fc961297862cf23e07>:0 
  at Ink.CommandLineTool..ctor (System.String[] args) [0x001a3] in <d64e27e7788347b2a5377c9e19bbdcab>:0 
  at Ink.CommandLineTool.Main (System.String[] args) [0x00000] in <d64e27e7788347b2a5377c9e19bbdcab>:0 
  • 19
    \$\begingroup\$ Isn't the empty string contained in the language's name? :D \$\endgroup\$ – mbomb007 Jan 25 '17 at 15:08
  • 21
    \$\begingroup\$ The C and R ones are clever. \$\endgroup\$ – DLosc Jan 26 '17 at 7:10
  • 2
    \$\begingroup\$ @mbomb007 but it's not a character, therefore it's not a character included in the language's name. \$\endgroup\$ – user253751 Jan 27 '17 at 4:26
  • 1
    \$\begingroup\$ Does the S.I.L.O.S one count? It doesn't output the periods. \$\endgroup\$ – Business Cat Feb 6 '17 at 17:16
  • 11
    \$\begingroup\$ "Java bytecode, 0 bytes". First time I see Java triumphing above ALL of those other languages mentioned. :) \$\endgroup\$ – Kevin Cruijssen Jul 3 '17 at 11:26

SmileBASIC, 11 bytes


Equivalent to SPSET 0,1474. Sets sprite 0 to definition 1474, which is the SmileBASIC logo.



MATL, 1 byte


Output is through STDERR, which is allowed by default.

The output from the offline compiler is

Error using matl_parse (line 339)
MATL error while parsing: Y not recognized at position 1
Error in matl (line 234)
    S = matl_parse(s, useTags); 

Or try it online! (expand "debug" section).

  • 7
    \$\begingroup\$ Should you merge with this? \$\endgroup\$ – wizzwizz4 Jan 25 '17 at 18:31
  • \$\begingroup\$ @wizzwizz4 I'm not sure. I asked in chat and got these two replies, so it's not really clear \$\endgroup\$ – Luis Mendo Jan 25 '17 at 19:47
  • 1
    \$\begingroup\$ yeah but Y tho? \$\endgroup\$ – sagiksp Jan 26 '17 at 9:34
  • \$\begingroup\$ @sagiksp Anything that throws an error will do, such as X or Z. This is because X, Y or Z are prefixes of two-char function names, so a Y by itself is invalid \$\endgroup\$ – Luis Mendo Jan 26 '17 at 10:55

R, 1 byte:


T is an alias for the constant TRUE. So the output for the above is:

[1] TRUE

Since junk is allowed around the name, the “R” in there is the language name.

(As noted in a comment elsewhere, pretty much any single letter and many glyphs will work equally well because they trigger the message “Error: …”, which contains “r”.)


HTML, 24 20 bytes


HTML, 16 bytes

As pointed out by @Bob, modern browsers will recognize HTML entities without semicolons, though it's technically invalid HTML. Of course, it's perfectly valid for code golf.


HTML, 4 bytes

And of course, the uninteresting answer.


Also, see my CSS answer.

  • 3
    \$\begingroup\$ You can save four characters by using decimal instead: &#72;&#84;&#77;&#76;. You can save an additional four characters by dropping the semicolons, at the cost of being technically invalid HTML (but still working in modern browsers). \$\endgroup\$ – Bob Jan 25 '17 at 3:26
  • \$\begingroup\$ Why doesn't HTML count? \$\endgroup\$ – OrangeDog Jan 25 '17 at 13:51
  • 1
    \$\begingroup\$ @OrangeDog "You can't use any character that is included in your programming language's name in your code" \$\endgroup\$ – darrylyeo Jan 25 '17 at 18:39
  • \$\begingroup\$ But html should be valid, reducing the score by 12 bytes. \$\endgroup\$ – Christoph Jan 27 '17 at 11:09
  • 3
    \$\begingroup\$ @Clearer This is code golf! As long as it works in at least one environment, who cares whether W3C thinks it's valid? \$\endgroup\$ – darrylyeo Feb 15 '17 at 15:31

Vim, 0 bytes

When you start Vim, the editor displays a splash screen which looks like this:

Vim splash screen

You can see it says Vim here:

Vim splash screen with vim highlighted

Previous answer:

Vim, 1 byte


In Vim 8, pressing will display Type :quit<Enter> to exit Vim at the last line. I'm not completely sure if this counts.

  • 1
    \$\begingroup\$ It should count. Ctrl-C actually has its own ASCII code (code 3, also called ETX or "end of text"), so this is a pure-ASCII program (if not purely printable ASCII). You can use that to prove that the program's one byte long, and displaying text on screen counts. \$\endgroup\$ – user62131 Jan 25 '17 at 14:36
  • 4
    \$\begingroup\$ Since when is "vim" a programming language? \$\endgroup\$ – DepressedDaniel Jan 27 '17 at 3:26
  • 4
    \$\begingroup\$ @DepressedDaniel vim is actually a scripting language if you take a deeper look into the internals. All those fancy keystrokes are instructions => you're programming when you're controlling your editor. \$\endgroup\$ – bash0r Jan 27 '17 at 13:32
  • 1
    \$\begingroup\$ @DepressedDaniel is it turing complete? If it's not, I don't think it should count. \$\endgroup\$ – Clearer Feb 14 '17 at 1:45
  • 4
    \$\begingroup\$ @dfeuer I've come to agree with you, since I made that comment more than 2 years ago. \$\endgroup\$ – Clearer Aug 13 '19 at 6:57

Python, 15 bytes

Python 2 (15)


It concatenates the strings uses the octal 150 which is h and "elp()" and runs the result. This prints the help() command which says "Welcome to Python 3.5's help utility!", meeting the requirements.

Python 3 (17)


Try it online!

  • \$\begingroup\$ Not sure help counts, it only works in a REPL environment. \$\endgroup\$ – xnor Jan 25 '17 at 1:09
  • \$\begingroup\$ It still prints out the Python. That's all that's required. \$\endgroup\$ – user63571 Jan 25 '17 at 1:16
  • 1
    \$\begingroup\$ Never mind, I was mistaken and it works as a program. Sorry about that. \$\endgroup\$ – xnor Jan 25 '17 at 1:22
  • 1
    \$\begingroup\$ you have used the letter 'p' \$\endgroup\$ – Matt Jan 25 '17 at 15:34
  • 3
    \$\begingroup\$ p is allowed but P isn't. Rule 1. \$\endgroup\$ – user63571 Jan 25 '17 at 17:54

C, 0 bytes.

/usr/lib/gcc/i586-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status

Try it online!

  • \$\begingroup\$ where is the name ? Or do you refer to the c characters in there ? \$\endgroup\$ – HopefullyHelpful Jan 26 '17 at 11:46
  • 3
    \$\begingroup\$ This should be marked as C (gcc), because other compilers have different messages. \$\endgroup\$ – orlp Jan 26 '17 at 12:47
  • \$\begingroup\$ Meh, your c's come from extremely implementation-dependent sources. Would have been nicer if you at least provoked a message that contains c in some boilerplate output. \$\endgroup\$ – DepressedDaniel Jan 27 '17 at 3:24
  • 1
    \$\begingroup\$ @DepressedDaniel undefined reference to 'main' \$\endgroup\$ – Loren Pechtel Jan 27 '17 at 5:59
  • \$\begingroup\$ @LorenPechtel Fair enough, missed that. \$\endgroup\$ – DepressedDaniel Jan 27 '17 at 6:02

Huh?, 0 bytes

(no, there's nothing in that code block)

The language is named for its output, so...

In the implementation I checked, the interpreter takes the length mod 8 of each line of a given file, and switches depending on the result. For zero, it prints Huh?. Since it strips trailing newlines, you could also do a 1 byte (\n) version.

Note that it's not outputting to stderr or caseswapping or any other trickery. It's just that Huh?'s very confused interpreter finally came in handy.

  • \$\begingroup\$ Wait, is this language Turing complete? \$\endgroup\$ – Hello Goodbye Nov 18 '19 at 15:08

V, 2 bytes


Try it online!

The obvious answer is:


Try it online!

Which is "Insert the letter 'v', and toggle case". However, since you allow for junk output before/after the language name, this works too.

The ¬ command takes two characters for input, and inserts every ASCII character between them. If we don't supply the second character, it automatically defaults to ÿ (ASCII 0xff), so this program inserts every character in the latin1 encoding between U and ÿ.


brainfuck, 54 bytes


Outputs brainfuck, assuming an 8-bit tape open on the left. Try it online!

As always, partial credits go to @primo's Hello, World! answer.

Alternatives with different casing

Brainfuck (62 bytes):


BrainFuck (68 bytes):


MATLAB, 3 bytes


Output is as follows. Irrelevant info has been replaced by [...]). Some parts of the output may change depending on version, installed toolboxes etc.

MATLAB Version: (R2015b)
MATLAB License Number: [...]
Operating System: [...]
Java Version: Java 1.7.0_60-b19 with [...]
MATLAB                                                Version 8.6         (R2015b)
Communications System Toolbox                         Version 6.1         (R2015b)
Curve Fitting Toolbox                                 Version 3.5.2       (R2015b)
Wavelet Toolbox                                       Version 4.15        (R2015b)
  • \$\begingroup\$ Uses a v and an e \$\endgroup\$ – user63571 Jan 25 '17 at 0:31
  • \$\begingroup\$ Your language is Octave, so you can't use v and e. \$\endgroup\$ – JungHwan Min Jan 25 '17 at 0:31
  • 6
    \$\begingroup\$ Woops. Corrected by changing language to Matlab (which was my initial intent anyway) \$\endgroup\$ – Luis Mendo Jan 25 '17 at 0:55

Python, 27 53 49 48 45 bytes

-3 bytes from @wizzwizz4

exec eval('"IMpORT THIS".LOWER()'.swapcase())

Prints the following text, which has "Python" on the first line.

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
  • 1
    \$\begingroup\$ @Arnauld fixed! \$\endgroup\$ – Value Ink Jan 25 '17 at 0:27
  • 1
    \$\begingroup\$ HELP() or HELP(HELP) is shorter. \$\endgroup\$ – Gurupad Mamadapur Jan 25 '17 at 8:14
  • \$\begingroup\$ It doesn't matter if you swap the case of the import string, because you're making it lower-case anyway. -3 bytes. \$\endgroup\$ – wizzwizz4 Jan 25 '17 at 18:39
  • \$\begingroup\$ @GurupadMamadapur the Python 3 answer already covered it and better (pretty sure my code would be the exact same), so I'm not in the mood to use it too. Guess I'm sticking to import this. \$\endgroup\$ – Value Ink Jan 27 '17 at 9:20
  • \$\begingroup\$ @ValueInk Alright then. \$\endgroup\$ – Gurupad Mamadapur Jan 27 '17 at 14:00

Python 2 (1 byte)




  • \$\begingroup\$ Are you sure this is only 1 byte? \$\endgroup\$ – Okx Jul 27 '17 at 22:38
  • 1
    \$\begingroup\$ Agreed. It's 2 bytes in UTF-8 \$\endgroup\$ – mbomb007 Oct 20 '17 at 13:48
  • \$\begingroup\$ The key is "non-ASCII" -- try 0xa0 (nbsp) or basically any other high byte you like and you'll get the same error! \$\endgroup\$ – John P Oct 20 '17 at 17:57
  • 4
    \$\begingroup\$ This is 1 byte in Win1252, which the error message shows this is using. \$\endgroup\$ – ATaco Oct 21 '17 at 5:04

><>, 12 10 bytes


This will continually print ><> until the interpreter runs out of space.

Try it online!

12 byte version below for those who like a clean output. Recommended by Aaron (no error, 1 output)

  • \$\begingroup\$ Brilliant solution! \$\endgroup\$ – Emigna Jan 25 '17 at 14:14
  • \$\begingroup\$ @Emigna - Thanks, the final version was after a bunch of failed golfs but I quite like it because with the error it prints ><> and fish :D \$\endgroup\$ – Teal pelican Jan 25 '17 at 15:32
  • \$\begingroup\$ Nice one ! Here's a 14 bytes version which only prints once and doesn't errors out : "-o-o-o;_!\ _! \$\endgroup\$ – Aaron Jan 25 '17 at 16:37
  • \$\begingroup\$ @Aaron if you check the edit the first version did that at 12. I do like how clean yours looks though :) \$\endgroup\$ – Teal pelican Jan 26 '17 at 17:28
  • \$\begingroup\$ I like your 12 bytes version (the 10 bytes too :)), I think you should have left it included to your answer as an aside ("for those who like a clean output,[...]") ! \$\endgroup\$ – Aaron Jan 26 '17 at 17:32

JAVA, 1 byte


The output to stderr is:

Main.java:1: error: class, interface, or enum expected
1 error
Error: Could not find or load main class Main
Command exited with non-zero status 1
    Command being timed: "/srv/wrappers/java-openjdk"
    User time (seconds): 1.40
    System time (seconds): 0.80
    Percent of CPU this job got: 40%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.40
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 44564
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 205
    Minor (reclaiming a frame) page faults: 11301
    Voluntary context switches: 2666
    Involuntary context switches: 1677
    Swaps: 0
    File system inputs: 78312
    File system outputs: 0
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 1 
  • 15
    \$\begingroup\$ This is output from compilation, rather than running the program. I don't know whether this is allowed by default. \$\endgroup\$ – CAD97 Jan 25 '17 at 6:16
  • 2
    \$\begingroup\$ Also, if you chose a different file extension, it wouldn’t output "java" would it? (Not sure if that’s possible with java) \$\endgroup\$ – Jonas Schäfer Jan 25 '17 at 7:41
  • 12
    \$\begingroup\$ if you change from java to java bytecode you could reduce by one character. trying to run empty class file will throw java.lang.ClassFormatError \$\endgroup\$ – user902383 Jan 25 '17 at 9:59
  • 2
    \$\begingroup\$ Programs outputting to stderr should be edited into this answer. \$\endgroup\$ – mbomb007 Jan 25 '17 at 14:47

C, 15 Bytes

Compiled C on a Linux machine with a German locale:


It will run to a stack overflow and print Speicherzugriffsfehler (german for Segmentation fault) on stderr.

  • \$\begingroup\$ ............ :-D \$\endgroup\$ – Alfe Oct 14 '19 at 13:12

CSS, 25 bytes


Note that extra markup is added to Stack Overflow snippets, causing "CSS" to be displayed more than once. Open an .html file with contents


to see the result as intended.


bash CLI, 9

printf $0

If you want an actual script and not just a command at the interactive command line, then you can do this:

bash, 13

printf $SHELL

Outputs /bin/bash

  • 1
    \$\begingroup\$ echo $0 should work \$\endgroup\$ – r3mainer Jan 25 '17 at 1:41
  • \$\begingroup\$ @squeamishossifrage That works at the shell command line, but in a script it will output the name of the script. \$\endgroup\$ – Digital Trauma Jan 25 '17 at 7:08
  • 1
    \$\begingroup\$ x $0 works, assuming there's no executable called x on the path. In which case substitute any other letter, digit, or non-special character. \$\endgroup\$ – nigel222 Jan 25 '17 at 11:08
  • 2
    \$\begingroup\$ 'h' is illigal character for you, and you are using it in echo \$\endgroup\$ – user902383 Jan 25 '17 at 11:38
  • 2
    \$\begingroup\$ $'ec\x68o' $0 cures that detail. \$\endgroup\$ – manatwork Jan 25 '17 at 12:02

dc, 6


Outputs dc.

Try it online.


Pip, 8 bytes

'IWR C80

Takes the character I and WRaps it in Chr(80), resulting in PIP. Try it online!

Using the I feels a bit like cheating, so here are two 9-byte solutions that don't use any of PpIi:


Both output pip. I'm particularly pleased with the second one:

    ^707   Split 707 into a list of characters        [7;0;7]
  8+       Add 8 to each one                          [15;8;15]
(z      )  Use list to index into lowercase alphabet  ["p";"i";"p"]
           By default, lists are printed without a separator

For proper capitalization, we need a 10-byte solution:

'IWR C80Vx

How this one works is left as an exercise for the reader. ;^)


C#, 60 67 bytes

class P{static void Main(){System.\u0043onsole.Write("\x43\x23");}}
  • \$\begingroup\$ Is this actually your answer, or did a bug messed up your answer? \$\endgroup\$ – auhmaan Jan 25 '17 at 14:18
  • \$\begingroup\$ @auhmaan Sorry, fixed. I initially tested on LINQPad, and forgot it has a few default namespace imports. \$\endgroup\$ – Bob Jan 25 '17 at 14:40
  • \$\begingroup\$ I was referring to the \u0043 and alikes \$\endgroup\$ – auhmaan Jan 25 '17 at 16:16
  • 1
    \$\begingroup\$ @auhmaan That's intentional because I need Console but can't use C as per question rules. In C# you can use Unicode escape sequences in identifiers. \$\endgroup\$ – Bob Jan 25 '17 at 16:36
  • 3
    \$\begingroup\$ I'm sure you can use an anonymous method for this, I can't see a restriction requiring a full program, so you could do _=>System.\u0043onsole.Write("\x43\x23"); \$\endgroup\$ – TheLethalCoder Jan 26 '17 at 16:29

brainfuck, 105 Bytes


Try it online here

  • 7
    \$\begingroup\$ Well, not a problem in BrainFuck ;) \$\endgroup\$ – devRicher Jan 25 '17 at 7:24
  • \$\begingroup\$ @devRicher not at all ;) \$\endgroup\$ – TrojanByAccident Jan 25 '17 at 7:29
  • \$\begingroup\$ @mbomb007 I see. \$\endgroup\$ – TrojanByAccident Jan 25 '17 at 20:31
  • \$\begingroup\$ @mbomb007 updated \$\endgroup\$ – TrojanByAccident Jan 25 '17 at 20:52
  • \$\begingroup\$ Is there any reason for the excessive --- in your markdown? \$\endgroup\$ – FlipTack Jan 25 '17 at 20:54

Poetic, 229 bytes

why?w-h-y?always a war,many flaws,a sham,a fraud,a sad day
luxury a la shahs,a day a la Buddha?ah,many days usually always a burn
a husband hungry?uh-huh
awful suburbs,always a handful
sadly,a man runs harshly away
hardly unusual

Try it online!

Prints Poetic.

This was an interesting challenge. Not only did I have to write the shortest program that prints Poetic, but I challenged myself to create a somewhat coherent series of sentences without using p, o, e, t, i, or c (in keeping with the spirit of the language). That makes this program a "lipogram".


R, 11 bytes


Try it online!

  • \$\begingroup\$ version$l 9 bytes \$\endgroup\$ – djhurio Jan 25 '17 at 13:37
  • 2
    \$\begingroup\$ Probably version is enough (7 bytes) \$\endgroup\$ – djhurio Jan 25 '17 at 13:39
  • 1
    \$\begingroup\$ Or just 'r'. 3 bytes. \$\endgroup\$ – Konrad Rudolph Jan 25 '17 at 18:25
  • \$\begingroup\$ @KonradRudolph You can't use... wait; the specs are case sensitive in checking but not output... Clever. \$\endgroup\$ – wizzwizz4 Jan 25 '17 at 18:42
  • \$\begingroup\$ @wizzwizz4 Yeah … but I’ve since posted a solution that only needs one character, and even gets the case right. \$\endgroup\$ – Konrad Rudolph Jan 25 '17 at 18:50

Forth, 5 bytes


Try it online

Prints a list of every word in the language. Forth happens to be in the list (first word on line 125), though I don't know what it does.


Hexagony, 19 bytes

Basically a direct linear flow wrapped inside the hexagon.


Try this 19 byte un-interesting solution online!

More interesting 28 bytes:


Try it online!

This uses the small h, which is allowed. Uses the IP1 (Initial is 0) as a "function" which does "Decrement and print as char".

Expanded view

   I ] f .
  @ ] z ; .
 ( ; [ . $ >
] z ( ] b ] \
 ( ] p ] h <
  . . . . .
   . . . .

Saves I in the memory, go to the next instruction pointer with ], then IP1 runs from NE corner in SE direction and hits ..> which directs to E, wrapped to the bottom 5 no-ops . and then to ( (decrement), ; (print as char) and then [ which returns to IP0.

IP0 starts reading from where it stopped to f, go through the no-op . and to the middle ] which runs the "function" again: IP1 starts from where it stopped and hits no-op . then $ which skips the > and runs through the bottom again... to print e.

The program keeps doing things like that. Found out that I could've just printed n by calling the function again after printing o. Mm.. can't think of ways to shorten this further though I replace 1 byte by no-op with this discovery.

Leave me a comment if you want to see diagrams in this explanation!


J, 2 bytes


┌┬┐├┼┤└┴┘│─ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������

a. returns the alphabet of the J language — a built-in list of all bytes.

My original: 4 bytes


This just seems pretty cool to me. The square root (%:) of negative 1 (_1) is i (0j1).

  • 1
    \$\begingroup\$ 2 Bytes: a.. Prints the alphabet, which obviously includes 'J'. Definetly not as cool though :/ \$\endgroup\$ – Bolce Bussiere Mar 26 '18 at 16:47
  • \$\begingroup\$ Gotta golf it. :-) That said, I am attached to my original answer. \$\endgroup\$ – Dane Mar 28 '18 at 17:47

BASIC (ZX Spectrum), 4 2 bytes

crossed out 4 is still regular 4

Saved 2 bytes thanks to @ShaunBebbers.

Note: In the ZX Spectrum character set, these bytes display as


When you enter this in, the Spectrum starts by parsing an optional number followed by a line of code. Normally the line number is 1..9999 which causes the code to be added to the stored program. However if no line number is supplied then the code is executed immediately instead. Unfortunately a bug in the Spectrum means that it mistakes a line number of zero for no line number at all, but it still tries to execute the zero as part of the line of code, which is illegal, thus causing the error.

The previous 4-byte version generates a true error rather than relying on an interpreter bug:


Note: In the ZX Spectrum character set, these bytes display as


which outputs

C Nonsense in BASIC, 0:1

because the empty string is not a valid numeric expression. (I could of course have used any statement that takes a single integer.) If this answer is unacceptable, then for 6 bytes you can write a program consisting of a single line with one of the keywords that accepts no arguments, then use POKE to replace it with an illegal keyword, then attempt to RUN the program.

  • \$\begingroup\$ or 0 REM produces the same error \$\endgroup\$ – Shaun Bebbers Aug 13 '19 at 15:52
  • 1
    \$\begingroup\$ @ShaunBebbers Does that even pass syntax checking? \$\endgroup\$ – Neil Aug 13 '19 at 19:13
  • \$\begingroup\$ yes it does on a real Spectrum. \$\endgroup\$ – Shaun Bebbers Aug 13 '19 at 20:36

C 24 20 Bytes (Clang 3.8.1)

Thanks to @squeamish ossifrage for helping me save 4 bytes.

  • \$\begingroup\$ How about putchar(67);? \$\endgroup\$ – r3mainer Jan 25 '17 at 1:36
  • \$\begingroup\$ @squeamishossifrage yep, thanks \$\endgroup\$ – Wade Tyler Jan 25 '17 at 1:40
  • \$\begingroup\$ Just curious, but wouldn't printf('c') also be valid? You're not allowed to use uppercase "C", but you are lowercase, and the result is case-insensitive. \$\endgroup\$ – Jocie Jan 25 '17 at 9:51
  • 1
    \$\begingroup\$ @Jocie printf needs a char * so I need to use "" \$\endgroup\$ – Wade Tyler Jan 25 '17 at 12:30
  • 1
    \$\begingroup\$ if result is not case sensitive, then puts("c") saves a few bytes, and does not use uppercase C... Rules might need an edit then \$\endgroup\$ – Florian Castellane Jan 26 '17 at 15:16
2 3 4 5

Your Answer

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

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