# Output programming language name

## Challenge:

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

Fair enough, right?

Restrictions:

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

• 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. Jan 24 '17 at 23:47
• Obligatory "Just having your code be blank but have a flag like --version isn't allowed"? Jan 25 '17 at 0:00
• Have case-insensitive output while banning the language name case-sensitively allows boring solutions that just output the language name case-swapped.
– xnor
Jan 25 '17 at 0:47
• 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 Jan 26 '17 at 8:23
• 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. Jan 26 '17 at 18:30

# Forth (gforth), 4 bytes

COLD


This word prints the following text (version number may vary):

Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type license'
Type bye' to exit


# chicken (not scheme), 1 byte

The language name might also be chicken chicken, see here

a


outputs:

Error on line 1: expected 'chicken'

• Downvoter please explain. This seems perfectly valid to me Jan 30 '17 at 9:46

## Bash, 9 bytes

--verSion


Will output the following:

GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.


which has the word in it.

• Perhaps I'm missing something, but I only see the word bash in the command itself and not the output. I don't think that counts. Jan 25 '17 at 15:46
• I'm pretty sure this is valid if you call it a REPL answer. When I run x from the REPL, I get the following output: DJ@DJ-PC:~$x; bash: x: command not found; DJ@DJ-PC:~$; (Note that the semicolons are newlines) (Also note that I tested it on git-bash) Feb 15 '17 at 17:26
• changed it completely now, the new version is reproducible Feb 21 '17 at 9:54

## T-SQL - 58 Bytes

print left(char(84)+char(45)+substring(@@version,11,3),5)


Making use of the casing difference on the highlighted chars.

# Python 2, 44 bytes

exec('pRINt'.upper().swapcase()+' "pYTHON"')


Try it online!

It works by taking a weirdly capitalized string and making it normal, then executing it. I originally solved this by using this method to import sys, but then I realized I could just use it with print.

• 38 bytes
– Jo King
Mar 25 '18 at 1:20

# Ly, 10 bytes

(76)(89)&o


Pretty easy with Ly, due to the short name and little use of letters.

Outputs:

LY


Try it online!

• I thought the y was lower case so I cam up with '&2*o'z1-o which is the same length (so no improvement on your answer). In fact I found lots (and lots) of different ways to generate the codepoint for L and y in 4 characters, leading to lots of 10 character options. :) Jun 11 '21 at 21:07
• This one is fun IMO since it uses two different approaches and it's 8 chars :) 76Jo'z,o Nov 4 '21 at 8:10

# UPL, 0 bytes

I tried to be funny by finding an unnamed programming language where an empty file produces no output, instead I found this. Trying to compile anything with the Unnamed Programming Language compiler results in:

This is going to be the UPL compiler...


# ><>, 9 bytes

"-o_!\ _!


Try it online!

Same byte count, much cleaner output. Now it only outputs ><> and nothing else by subtracting the difference between pairs of no-ops. I was very lucky that > + ! is _ which is a no-op when traveling horizontally.

# ><>, 9 bytes

"2*4-o! !


Try it online!

### How It Works:

Initially the " pushes the source code in reverse. 2*4-o multiplies the value of the final ! by 2 and subtracts 4 to make it correspond to >. The ! skips over the " so no more code is pushed to the stack, and it repeats the operation over the rest of the source code, resulting in an output of ><>ÚVdP 

# MathGolf, 10 bytes

ÿ∙╤Æⁿ½]$╦y  Try it online! ## Explanation ÿ∙╤Æⁿ Push "∙╤Æⁿ" ½ uninterleave, pushing "∙Æ" and "╤ⁿ" to the stack ] wrap stack in array$     push ord(a) for each element in the array
╦    fetch dictionary words ("Math" and "Golf")
y   join array without separator to string or number


With dictionary popping using strings, which should be coming in the next version, this will be 1 byte shorter (remove $). ## The boring solution (1 byte) '  From TIO: Traceback (most recent call last): File "/opt/mathgolf/math_golf.py", line 750, in <module> result = evaluate(code_list[:], stdin, Stack([])) File "/opt/mathgolf/math_golf.py", line 115, in evaluate stack.append(code.pop().char) IndexError: pop from empty list  This is implementation dependent, but if you're planning on using MathGolf, you'll probably pull the git repository, which is named mathgolf, meaning that unless the directory is renamed, the error will persist. • More boring 10 bytes alternative (using MathGolf's strength of implicitly joining and printing the stack) which would be 2 bytes shorter once we can remove the $s. :) Aug 12 '19 at 9:42
• @KevinCruijssen Haha, of course... didn't even think to test the simpler method. Nice catch. I still have to check how dictionary fetching using strings should work when mapped to lists, but once I have verified that there should be a new version coming to TIO.
– maxb
Aug 12 '19 at 9:47

# 05AB1E, 7 bytes

•₄)í•hÁ


Try it online.

Explanation:

•₄)í•    # Push compressed integer 5943776
h   # Convert it to hexadecimal: "5AB1E0"
Á  # Rotate it once towards the right: "05AB1E"
# (after which the result is output implicitly)


See this 05AB1E tip of mine (section How to compress large integers?) to understand why •₄)í• is 5943776.

# Unix shells (bash, sh, zsh, etc) to STDERR, 1 byte

The shells bash, ksh, sh, zsh all output their name to STDERR when you give them an unknown command, e.g.

1


Examples:

λ bash<<<1

λ zsh<<<1

λ ksh<<<1

λ sh<<<1

λ fish<<<1
fish: Unknown command 1


If the challenge requires output to STDOUT, add 5 bytes 2>&1 to redirect it:

λ bash<<<1 2>&1


If the challenge had specified "use a valid program"... zsh, 18 bytes

<<<$'\x7a\x73\x68'  • try it online • not like this! echo "\x7a\x73\x68", as Gamma pointed out • NB: csh and tcsh don't do this STDERR trick.. Aug 12 '19 at 4:58 • You can't use echo, "h" is in zsh. <<<$'\x7a\x73\x68' works for -1 byte though. Aug 13 '19 at 3:27
• The challenge popped up again on active, so hi again. zsh and bash can use $'\x73'et for stdout. Oct 2 '19 at 18:29 # Go, 0 bytes Try it online! Output: package main: code.go:1:1: expected 'package', found 'EOF' # Linux, Unix Shell (sh/bash...) (6 bytes) find /  # Whitespace, 94 bytes   Try it online! ssslssttslssttsslssststtlssstttslssslsssttttlssstsslsssttlssttttsl push [0, -2, -4, 11, 14, 0, 15, 4, 3, -14] lssl label print sssttsststl push 101 tsss add tlss print char lsll jmp print  # Pxem, (See below) ## Depends on invokation ### pxemi.7z, 0 bytes (on invokation). Compile the source code in C++ and run the interpreter with no arguments, like this: /path/to/pxemi. The following line is output to stderr: usage: pxemi pxemFileName. ### RPxem, 0 bytes (on invokation) Just like nk.'s pxemi, run with no arguments: Usage: rpxem path-to-pxem-file.pxe can be seen. ## Programs ### Pxem, 6 bytes of filename only, case-insensitive, boring. • Filename: pXEM.p. • Content: none. ### Pxem, 18 bytes of filename only, case-sensitive output, depends on ASCII-compatible filesystem. • Filename: @-.+23.+7A.+%+.+.p • Content: None How it works On every ??.+ each character is generated with sum of two characters' ASCII code from backwards. • Pxem is interesting. Mar 19 '21 at 10:09 # Pyth, 1 byte .  Try it here! On the online interpreter, prints the following to stderr: Traceback (most recent call last): File "pyth.py", line 737, in <module> py_code_line = general_parse(pyth_code, safe_mode_on) File "pyth.py", line 46, in general_parse parsed, tokens = parse(tokens, safe_mode) File "pyth.py", line 74, in parse raise PythParseError(active_token, rest_tokens) extra_parse.PythParseError: . is not implemented, 1 from the end.  The exact error message differs depending on the environment Pyth is running in, but it always includes PythParseError. # Red, 9 bytes prin 'rED  Due to the rules, this is valid, but it's boring, so let's not do that, ok? ## Non-trivial, 35 bytes prin#"Q"+ 1 prin#"f"- 1 prin#"c"+ 1  This takes Q, f, and c as character codes, adds or subtracts 1, then prints them without newlines. Q + 1 = R, f - 1 = e, c + 1 = d. Unfortunately, this doesn't work on TIO, but you can try it locally. # BQN, 17 bytes With this magic trick, I will turn apples into bacon! 1⊸+⌾(¯1⊸⊏)1+"APL"  Try it! ## Explanation 1⊸+⌾(¯1⊸⊏)1+"APL" "APL" - Take each letter of "APL" 1+ - Add one to it, giving the next letter. ⌾(¯1⊸⊏) - Then take the last letter of "BQM" 1⊸+ - And add one to it.  # BQN, 7 bytes And now for the golfy answer. "APM"+1  Try it! ## Explanation "APM"+1 "APM" - Take each letter of "APM" +1 - ...and add one to it, giving the next letter.  ## JavaScript (ES6), 29 45 bytes There's probably a better way. let f = _=>'\x4A\x61\x76\x61\x53\x63\x72\x69\x70\x74' console.log(f()) • @ETHproductions This turns out to be more complicated than I expected. Here is a fixed (but weak) version. Jan 25 '17 at 0:27 • Huh, none of the hex values contain a letter, except for J. Perhaps that could be useful in some way (though I highly doubt it...) Jan 25 '17 at 0:30 • Abuse case-insensitive requirements for output to print jAVAsCRIPT? Jan 25 '17 at 0:48 • @ValueInk I supposed I could do that but I actually wish this rule didn't exist. It kinda ruins the game. Jan 25 '17 at 1:03 • How about just _=>'\x45\x53'+(5+1)? It is technically ECMAScript6 Jan 25 '17 at 1:20 # CJam, 8 6 bytes "cjAM"  Try it online! ### Old version "BIl":)  Try it online! "BIl" e# Push this string :) e# Add 1 to the code point of each char. Implicitly display  # QC 16 bytes &000051430A0D00# &0000 Write hex to memory at address 00 until 000 is reached 51430A0D00 QC with a new line and the terminator at the end # Print contents of memory until first 00 is reached  # 05AB1E, 11 bytes ¾4>'§ÅX69çJ  Try it online! Explanation ¾ # push counter (initially 0) 4> # push 4+1 '§Å # push the word "ab" X # push variable X (initially 1) 69ç # push char value of 69: "E" J # join as string  • •äƵí•hR works for 7. Mar 19 '21 at 15:50 ## Chicken, 1 byte g  This could be pretty much any character and it would be the same. Outputs Error on line 1: expected 'chicken'. ## Excel 2010 VBA 113 bytes I am assuming paragraph spacing is 1 byte. This won't work with earlier versions of Excel. For those who dont have/use Excel, column 14925 is VBA n = 14925 Do While n > 0 c = ((n - 1) Mod 26) s = Chr(c + 65) & s n = (n - c) \ 26 Loop Debug.Print s  Credit where credit is due. • Welcome to PPCG! For further reference, you don't need to CW-ify an answer if you didn't make it. Simply linking to the source works. Also, you should probably post the plain VBA answer separately. Jan 25 '17 at 16:13 • @EasterlyIrk Ok, I didn't know if it was necessary or not to CW an answer but I wouldn't feel right if I didnt .. the plain VBA answer I will leave, I made that within the first minute of reading the question and found it uninteresting Jan 25 '17 at 16:18 # Ruby, 18167 6 bytes Feels like cheating to be able to use different cases, but OK sure The language can be case-insensitive??? Wow -1 byte from @manatwork p:rUBY  • As all kind of garbage is accepted around the name: p:rUBY. Jan 25 '17 at 14:54 # JavaScript, 19 bytes Sadly, the shortest answer is also the least interesting: _=>'jAVAsCRIPT'  Yes, the challenge allows for this. I also wish it didn't. I first tried to do this using atob, but forgot that the name of that function contains forbidden letters. I also tried using open with a data URI using base64-encoding, only to realize once I had finished writing my answer that open also contains a forbidden character… One valid solution that outputs JavaScript with the correct casing would be encoding the whole name as \x4A\x61\x76\x61\x53\x63\x72\x69\x70\x74, but that solution was already taken. Edited multiple times because various solutions turned out to be invalid. • Your code is invalid, it contains t & a Jan 25 '17 at 1:31 • Isn't this still invalid as the code contains both A and t which are found in ECMAScript? Jan 25 '17 at 14:03 • and the c in EMCAScript Jan 25 '17 at 20:33 • @Emigna Apologies, I seem to keep overlooking those invalid characters. Case in point: I just wasted another 45 minutes on a solution that turned out to be invalid... So for now I'll just go for the boring-but-valid solution. Jan 26 '17 at 15:17 • @TrojanByAccident The console.log fragment was not part of the solution, I just put it there so you could see the output using the Stack Snippet. Anyway, I updated my submission. After writing a new solution that turned out to be also invalid, with the valid (but boring) solution above. Jan 26 '17 at 15:18 ## PowerShell, 2 bytes gv Sample output: Name Value ---- -----$                              $gv ? True ^$gv
args                           {}
ChocolateyProfile              C:\ProgramData\chocolatey\helpers\chocolateyProfile.psm1
ChocolateyTabSettings          @{AllCommands=False}
ConfirmPreference              High
ConsoleFileName
DebugPreference                SilentlyContinue
Error                          {System.Management.Automation.ParseException: At line:1 char:11...
ErrorActionPreference          Continue
ErrorView                      NormalView
ExecutionContext               System.Management.Automation.EngineIntrinsics
false                          False
FormatEnumerationLimit         4
Host                           System.Management.Automation.Internal.Host.InternalHost
input                          System.Collections.ArrayList+ArrayListEnumeratorSimple
MaximumAliasCount              4096
MaximumDriveCount              4096
MaximumErrorCount              256
MaximumFunctionCount           4096
MaximumHistoryCount            4096
MaximumVariableCount           4096
MyInvocation                   System.Management.Automation.InvocationInfo
NestedPromptLevel              0
null
OutputEncoding                 System.Text.ASCIIEncoding
PID                            7912
PROFILE                        \\thing\user$\user_folders\username\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 ProgressPreference Continue PSBoundParameters {} PSCommandPath \\thing\user$\user_folders\username\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
PSCulture                      en-AU
PSDefaultParameterValues       {}
PSEmailServer
PSHOME                         C:\Windows\System32\WindowsPowerShell\v1.0
PSScriptRoot                   \\thing\user$\user_folders\username\My Documents\WindowsPowerShell PSSessionApplicationName wsman PSSessionConfigurationName http://schemas.microsoft.com/powershell/Microsoft.PowerShell PSSessionOption System.Management.Automation.Remoting.PSSessionOption PSUICulture en-US PSVersionTable {PSVersion, WSManStackVersion, SerializationVersion, CLRVersion...} PWD C:\Windows\system32 ShellId Microsoft.PowerShell StackTrace at CallSite.Target(Closure , CallSite , Object )... true True VerbosePreference SilentlyContinue WarningPreference Continue WhatIfPreference False  This is shorthand for the cmdlet Get-Variable, which displays the name and value of all variables in scope. Among these are a few environment variables which are also regular variables, like $PSHOME and \$PROFILE which contains paths for powershell to run in, and where to find the script to run for every new session.

## GNU M4, 5 bytes

dnl()


Output:

m4:stdin:1: Warning: excess arguments to builtin dnl' ignored


## GNU M4, 10 bytes, clean output

m'incr(3)


Output:

m4


## GNU M4, 40 bytes, clean output, correct case

translit(ulinzg,a-z,z-a)(%c,77)'incr(3)


Output:

M4


## Hoon, 13 bytes

@t0w1.KrSZ8


Hoon has an atom encoding @uw, which is base-64. This simply casts an @uw literal back to a cord (@t), which is the value 'Hoon'

# PHP, 1 byte

_


This leads to a parse error. Run like this:

php -r '_'
> PHP Parse error:  syntax error, unexpected end of file in Command line code on line 1


# Version without resorting to STDERR (8 bytes)

Note: uses IBM-850 encoding

<?=~»À»;


Run like this:

echo '<?=~»À»;' | php 2>/dev/null
> PHP


This just uses the binary opposite of PHP, and negates it using the ~ operator.