# 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, 2017 at 23:47
• Obligatory "Just having your code be blank but have a flag like --version isn't allowed"? Jan 25, 2017 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, 2017 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, 2017 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, 2017 at 18:30

# Hexagony, 19 bytes

Basically a direct linear flow wrapped inside the hexagon.

h;E;N;Y;X;A;;@/OG;/

Try this 19 byte un-interesting solution online!

More interesting 28 bytes:

I]f.@]z;.(;[.$>]z(]b]\(]p]h< 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! # Excel, 35 Closing parens already discounted. Simple enough: • A1 - =RIGHT(0=1) - E from FALSE • Output - =A1&ROMAN(90)&A1&ROMAN(50) - EXCEL ROMAN(90) = XC, ROMAN(50) = L • Or is it 0 because of the splash screen when you start up Excel? Jul 25, 2020 at 5:38 # Perl 5, 36 bytes (35 + 1 for -E) $^X=~s/.+(.)(...)$/\U$1\E$2/;say$^X


Run with the -E flag.

$perl -E 'say$^X=~s/.+(.)(...)$/\U$1\E$2/r' Perl  The variable $^X is the path to the executable that is running the current program. Since the Perl interpreter is called perl, we then need to make he first letter upper-case. But the ucfirst function contains an r, which is not allowed, so we have to resort to \U and \E, which turn upper-case-conversion on and off.

We cannot use the /r modifier for s/// to return the changed string because the r is not allowed.

It's important to know that the name of the Perl programming language is Perl, and the name of the interpreter is perl with a lower-case p. There is no PERL.

• Technically, I think perl -v satisfies the constraints of the challenge, but this is much more interesting :) Although it makes assumptions that don't hold on all systems (e.g. $^X is /home/foo/.plenv/versions/5.16.3/bin/perl5.16.3 for me, but it could just as well be /home/foo/python if I were twisted like that). Jan 25, 2017 at 23:22 • @this not sure if that would be within the rules. They say pick a language and do stuff. But perl -v is not anything in Perl. So I think it doesn't count. But I do think there are easier ways. About the different systems, I think we can fix it with a bit more regex magic. Jan 25, 2017 at 23:36 • There are a bunch of zero-byte solutions already that rely on default behavior (e.g. printing of version numbers). Nothing in the rules explicitly prohibits it. But it's definitely boring and feels "cheaty." Jan 26, 2017 at 0:18 • Looking at the rules again, you could actually just do the uber boring perl -E'say$^X'. Jan 26, 2017 at 21:50
• How about -E'say$^X -v' ? That's indisputably a program. Jan 29, 2017 at 18:02 ## R, 10 bytes citation()  Outputs : To cite R in publications use: R Core Team (2016). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/. A BibTeX entry for LaTeX users is @Manual{, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2016}, url = {https://www.R-project.org/}, } We have invested a lot of time and effort in creating R, please cite it when using it for data analysis. See also ‘citation("pkgname")’ for citing R packages. Quite verbose just to have R's name to appear right ? From @djhurio's comment on an this answer using R, version does the trick too. • "The output of the programming language name is not case sensitive." So why not just "r"? Or depending on strict "You can have "junk output" before or after the name of the language." you could also just do T. Jan 25, 2017 at 11:00 • Following on @Billywob 's comment, all that is needed to output is an r or R, so another approach is to output to STDERR via a syntax error. ) outputs Error: unexpected ')' in ")", which contains an r. Jan 25, 2017 at 11:56 • @Billywob I agree to your comment, as well as rturnbull's. I wrote this answer quickly earlier and should have precised that, even though it makes the code and the answer futilely long, I find it funny to output all this junk just to make "R" appears. Moreover, it's the shortest way to my knowledge to write make R write its name on purpose. Jan 25, 2017 at 17:36 ## Perl, 2 bytes The perl is the call to the interpreter from command line: $ perl -M6


Outputs (for my version of Perl):

Perl v6.0.0 required--this is only v5.16.3, stopped at -e line 1.
BEGIN failed--compilation aborted at -e line 1.


## Perl, 17 bytes

80.101.114.108->_


Outputs

Can't locate object method "_" via package "Perl" (perhaps you forgot to load "Perl"?) at -e line 1.


Can be shortened to 14 bytes if PERL is acceptable:

80.69.82.76->_


All solutions make use of version strings.

• That's awesome. Jan 30, 2017 at 8:08
• I believe this updated 2-byte solution should qualify
– Zaid
Jan 30, 2017 at 8:48
• This must be the shortest answer in Perl ever! Jan 30, 2017 at 8:49
• @simbabque I'm trying to figure a way to get perl -x to spit out "No Perl script found in input"
– Zaid
Jan 30, 2017 at 9:13
• @Zaid perl -x -e1 Jan 30, 2017 at 15:16

# 05AB1E (legacy), 0 bytes

An amazing trick that I just learned from Kevin Cruijssen.

Try it online!

It outputs contents of info.txt, which of course contains the name 05AB1E.

# Vyxal, 4 bytes

Flagless and without dictionary compression.

kaṖṅ


This prints out all the possible permutations of the lowercase alphabet.
In the online interpreter the code times out (for understandable reasons). Does it count?
Try it Online!

• Nice loophole lol Jan 30 at 20:36

# Python 2, 25 bytes

exec"pri\156\164'pYTHON'"


Try it online!

Prints pYTHON. Uses octal codes for the banned characters n and t.

If functions are allowed, we can just do:

lambda:"pYTHON"

• Very nice! Of course, I have bias towards my import this solution for the creativity factor, but you can take the shorter answer :P Jan 25, 2017 at 0:44
• @RaisingAgent Rule 4 says The output of the programming language name is not case sensitive.
– user63571
Jan 25, 2017 at 15:12

# C 24 20 Bytes (Clang 3.8.1)

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

main(){putchar(67);}

• How about putchar(67);? Jan 25, 2017 at 1:36
• @squeamishossifrage yep, thanks Jan 25, 2017 at 1:40
• 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. Jan 25, 2017 at 9:51
• @Jocie printf needs a char * so I need to use "" Jan 25, 2017 at 12:30
• 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 Jan 26, 2017 at 15:16

# Jelly, 4 bytes

“Ẏṃ»


Try it online!

Jelly supports a dictionary-compressed string representation which is based off an English dictionary; every word in English (according to the dictionary) has a short compressed representation. Luckily, jelly is an English word, so it's in the dictionary. Ẏṃ is the compressed representation when the word's just by itself like this (although the representation is based on base conversion so the actual characters used depends on what other words appear in the compressed string), and “…» are the necessary delimiters to treat it as a string literal and decompress it.

• Nitpick, but this outputs 'jelly' without a capital J. Jan 30, 2017 at 13:18
• @steenbergh The output of the programming language name is not case sensitive.
– user45941
Jan 31, 2017 at 19:47
• @Mego Huh, my bad. Could've sworn that it was... Jan 31, 2017 at 19:53
• @steenbergh: this technique works to output a capital J just as well, but it's a byte longer. Because the question allows case-insensitive output, I had to exploit that to bring the byte count down.
– user62131
Feb 1, 2017 at 0:16

## Groovy, 1 byte

a


In fact, a can be replaced by any character except the ones in Groovy. This raises a MissingPropertyException and outputs the following to STDERR-

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


## Pyke, 1 byte

v


Try it here!

Outputs file path to stderr. Only guaranteed to work on online interpreter.

### 2 bytes

~f


Try it here!

Outputs every permutation of alphabetical characters

• The online interpreter times out before reaching pyke (on the second solution) :( Jan 25, 2017 at 11:02
• @devRicher I'd be surprised if it didn't. That would use far too much memory in my browser to even display that many permutations (think about 450000 lines of output)
– Blue
Jan 25, 2017 at 17:18

## Labyrinth, 31 28 bytes

76.65.66.89.82.73.78.84.72.@


Try it online!

Prints LABYRINTH.

# Vim, 0 bytes

Starting Vim from the command line with no arguments yields:

~                                        VIM - Vi IMproved
~
~                                          version 8.0.92
~                                     by Bram Moolenaar et al.
~                           Vim is open source and freely distributable
~
~                                  Help poor children in Uganda!
~                          type  :help iccf<Enter>       for information
~
~                          type  :q<Enter>               to exit
~                          type  :help<Enter>  or  <F1>  for on-line help
~                          type  :help version8<Enter>   for version info
~
~
~
~
~
~


# Brachylog, 1 byte

e


Try it online!

Outputs to STDERR:

ERROR: Prolog initialisation failed:
ERROR: brachylog_main/3: Undefined procedure: default/0


The reason being that e, as of this version of Brachylog, is not implemented and is thus linked to no predicate name in the source code. This causes an ill-defined transpiling behavior which causes the main predicate (called brachylog_main) to contain incorrect Prolog code.

• @mbomb007 Completely forgot about that, fixed. e does the exact same thing. Thanks. Jan 25, 2017 at 14:57

# Befunge, 0, 1 or 19 bytes

Assuming the program doesn't need to terminate, then you can use a 0 byte file as the source, and the reference interpreter will by default will output its version header before going into an infinite loop:

Befunge-93 Interpreter/Debugger v2.23


If the program does need to terminate, then a singe byte exit command will suffice.

@


If the version header doesn't count as valid output, here's a more interesting 19 byte solution:

"kmt{lkH">0#,-:#6_@


Try it online!

The string "Befunge" has just been offset by 6 bytes to avoid using any of the characters in the name.

## PHP (2 Byte)

a;


Run it on the console, no opening tag required. a isn't defined and the semicolon closes the statement and because it's not in a block, it gets evaluated immediately.

This will cause the following warning to be printed:

PHP Notice: Use of undefined constant a - assumed 'a' in php shell code on line 1

As you can see, it starts off with the name of the programming language.

I won't go for the really cheap way of saying that the name of the programming language is displayed on the shell, though. On the shell, it reads "php" (lowercase) and PHP is commonly written both ways. In fact, the title of http://php.net is written in all-caps, whereas the logo only contains lowercase letters. The only thing that's for sure in this regard is that people who write it as "Php", are just wrong.

## PHP, 13 bytes

<?=phpinfo();


Returns a lot of information, including a line such as:

PHP Version => 7.0.10


### Command line version, 6 bytes:

php -v


Returns something along those lines:

PHP 7.0.10 (cli) (built: Aug 18 2016 09:48:53) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies


Thanks to Martinj for suggesting this one.

• Commandline php would be php -v, which is 6 :) Jan 26, 2017 at 15:31
• @Martijn You're right. Thanks! Because we need php anyway, I wonder if it's not just 2 bytes for the -v flag... Jan 26, 2017 at 15:39
• You could skip the opening <?= and just print php, which in a webserver context would end up being rendered inside <body> in your browser; 3 bytes Nov 18, 2019 at 14:19

# C, 23 bytes (without Error)

This works on little-endian machine. 67 is 0x00000043 and the layout on memory is {0x43,0x00,0x00,0x00} (32bit, little-endian) . This memory block is a valid c string (zero-ending char array). Then, just pass the pointer of this memory block into puts.

main(i){i=67;puts(&i);}


As the restrictions:

• putchar is not allowed (contains c). Then puts is used.

# C (gcc), 5 bytes

main;


Try it online!

• Output "type defaults to ‘int’ in declaration of ‘main’" to stderr while compile.
• Output "Segmentation fault (core dumped)" to stderr while execute.

-2 bytes, thanks to ceilingcat

# COMMODORE 64 BASIC, 11 bytes

1sY830*78-2


To get around the case-sensitive "can't use the characters of the languages's name" restriction, put the computer in "shifted mode" so you can enter the "s" in lower-case. This code performs a soft reset of the computer, taking it out of shifted mode (so the name is printed in upper-case) and printing out the name. The output printed:

    **** COMMODORE 64 BASIC V2 ****

64 K RAM SYSTEM  38911 BASIC BYTES FREE


• You don't require the line number here as you can execute any sys call in direct mode. Aug 13, 2019 at 16:01
• @ShaunBebbers, the line number is what makes it a program rather than an immediate command.
– Mark
Aug 13, 2019 at 21:38
• Yes you are right; If it specifically says you need it in a program or as an executable in the rules then you require the line number; if not, you have saved one PETSCII character on your submission. Aug 13, 2019 at 21:46

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


# Python 2, 4139 33 bytes

- 2 bytes thanks to emanresu A
- 6 bytes thanks to Wheat Wizard

exec"p"+'RINT"pYTHON"'.swapcase()


Try it online!

• Welcome to Code Golf, and nice first answer! Unfortunately this isn't quite valid as it contains a lowercase o and n. You can get around this using hexadecimal escapes, and it saves two bytes. Jan 30 at 18:22
• @emanresuA thanks (btw I'm a sock lol) Jan 30 at 18:27
• how did I not see the anagram Jan 30 at 18:29
• Why use escape codes when you can just use uppercase letters? Jan 30 at 19:32
• @WheatWizard oh, wait Jan 30 at 19:42

# RProgN, 19 Bytes.

~(70811.911.)71.+c.


Nice and easy! This was the first time (I think) I've gotten to use Stack Constructors in a challenge!

## Explanation

~(70811.911.)71.+c.
~                   # Start a Zero Space Segment
(          )       # Push a Stack
7                 # Literal Numbers, the . concatenates two digits to form a single number.
0                #
8               #
11.            #
9           #
11.        #
71.+   # Add 71 to every value in the stack.
c. # Convert to their char values. Although this stack is configured 'backwards', when . is called, the stack concatenation works backwards. That's just how RProgN does it.
# Print is implicit.


Try it online!

## Boring Cheaty Way

rpROGn


Because the text output isn't case sensitive but the characters is...

• The Boring Cheaty Way isn't allowed because you're using R and r. Jan 25, 2017 at 16:17

# Python 2, 15 bytes

exec"\150elp()"


Takes part of my Python 3 answer and @xnor answer to make this

# Octave, 3 2 bytes

qz


Results in the following error message

 -- LAMBDA = qz (A, B)
-- LAMBDA = qz (A, B, OPT)

Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help@octave.org
mailing list.


# GNU CLISP (2.49+, on Cygwin) (5 or 6 bytes)

'clisp (6 bytes)

Outputs:

CLISP

(answer based on quote usage in https://codegolf.stackexchange.com/a/89234/59547 )

If you reduce it to

clisp (5 bytes)

you can get the error

*** - SYSTEM::READ-EVAL-PRINT: variable CLISP has no value....


# ><>, 8 bytes

f4*:2+oo


Try it online!

Prints the string >< repeatedly.

## FerNANDo, 79 bytes

3 3
1
2 2
0 3 0 0 0 2 2 1
0 3 2 0 1 3 1 2
0 3 2 2 0 1 2 0
0 3 1 0 3 3 3 1
1 1
1


Try it online!

Based on primo's technique for "Hello, World!". The idea is to loop twice through four printing commands, while using the variables 0, 1, 2, 3 for all possible combinations of the values 0/1:

variable                0  1  2  3
value on 1st iteration  0  0  1  1
value on 2nd iteration  0  1  0  1


With these, we can then encode arbitrary pairs of characters to be printed, which allows us to print four characters in each iteration. I used this CJam script to compute the printing commands (change the 4 to a different value if you want to print a different number of characters per iteration).

I also tried doing 3 iterations, like primo's answer (which would require printing a trailing linefeed), but that ends up being a few bytes longer. It might be possible to save bytes by using 4 iterations, since you need only a few of the possible byte combinations (0 2 4 7 9 12 15, specifically), but I need to take more time to figure out how to compute them efficiently.

# PHP, 2 bytes (0 bytes of code plus 2 bytes for extra command line arguments)

-i


Outputs a ton of stuff, including:

PHP Version => 7.1.1
PHP API => 20160303
PHP Extension => 20160303
PHP Extension Build => API20160303,NTS

• -i` doesn't run a program. Not sure if this is valid Jan 30, 2017 at 9:38