57
\$\begingroup\$

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.

\$\endgroup\$
15
  • 8
    \$\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\$ Jan 24, 2017 at 23:47
  • 9
    \$\begingroup\$ Obligatory "Just having your code be blank but have a flag like --version isn't allowed"? \$\endgroup\$
    – Value Ink
    Jan 25, 2017 at 0:00
  • 106
    \$\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, 2017 at 0:47
  • 20
    \$\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, 2017 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, 2017 at 18:30

169 Answers 169

5
\$\begingroup\$

Vim, 3 bytes

:h<CR>

Try it online!

This opens up the default help file and outputs:

*help.txt*  For Vim version 7.4.  Last change: 2016 Mar 31

                        VIM - main help file
                                                                         k
      Move around:  Use the cursor keys, or "h" to go left,        h   l
                    "j" to go down, "k" to go up, "l" to go right.   j
Close this window:  Use ":q<Enter>".
   Get out of Vim:  Use ":qa!<Enter>" (careful, all changes are lost!).

Jump to a subject:  Position the cursor on a tag (e.g. |bars|) and hit CTRL-].
   With the mouse:  Double-click the left mouse button on a tag, e.g. |bars|.
        Jump back:  Type CTRL-T or CTRL-O.  Repeat to go further back.

Get specific help:  It is possible to go directly to whatever you want help
                    on, by giving an argument to the |:help| command.
                    Prepend something to specify the context:  *help-context*

                          WHAT          PREPEND    EXAMPLE  ~
                      Normal mode command          :help x
                      Visual mode command     v_       :help v_u
                      Insert mode command     i_       :help i_<Esc>
                      Command-line command    :    :help :quit
                      Command-line editing    c_       :help c_<Del>
                      Vim command argument    -    :help -r
                      Option              '    :help 'textwidth'
                      Regular expression      /    :help /[
                    See |help-summary| for more contexts and an explanation.

  Search for help:  Type ":help word", then hit CTRL-D to see matching
                    help entries for "word".
                    Or use ":helpgrep word". |:helpgrep|

VIM stands for Vi IMproved.  Most of VIM was made by Bram Moolenaar, but only
through the help of many others.  See |credits|.
------------------------------------------------------------------------------
                                                *doc-file-list* *Q_ct*
BASIC:
|quickref|  Overview of the most common commands you will use
|tutor|     30 minutes training course for beginners
|copying|   About copyrights
|iccf|      Helping poor children in Uganda
|sponsor|   Sponsor Vim development, become a registered Vim user
|www|       Vim on the World Wide Web
|bugs|      Where to send bug reports

USER MANUAL: These files explain how to accomplish an editing task.

|usr_toc.txt|   Table Of Contents

Getting Started ~
|usr_01.txt|  About the manuals
|usr_02.txt|  The first steps in Vim
|usr_03.txt|  Moving around
|usr_04.txt|  Making small changes
|usr_05.txt|  Set your settings
|usr_06.txt|  Using syntax highlighting
|usr_07.txt|  Editing more than one file
|usr_08.txt|  Splitting windows
|usr_09.txt|  Using the GUI
|usr_10.txt|  Making big changes
|usr_11.txt|  Recovering from a crash
|usr_12.txt|  Clever tricks

Editing Effectively ~
|usr_20.txt|  Typing command-line commands quickly
|usr_21.txt|  Go away and come back
|usr_22.txt|  Finding the file to edit
|usr_23.txt|  Editing other files
|usr_24.txt|  Inserting quickly
|usr_25.txt|  Editing formatted text
|usr_26.txt|  Repeating
|usr_27.txt|  Search commands and patterns
|usr_28.txt|  Folding
|usr_29.txt|  Moving through programs
|usr_30.txt|  Editing programs
|usr_31.txt|  Exploiting the GUI
|usr_32.txt|  The undo tree

Tuning Vim ~
|usr_40.txt|  Make new commands
|usr_41.txt|  Write a Vim script
|usr_42.txt|  Add new menus
|usr_43.txt|  Using filetypes
|usr_44.txt|  Your own syntax highlighted
|usr_45.txt|  Select your language


REFERENCE MANUAL: These files explain every detail of Vim.  *reference_toc*

General subjects ~
|intro.txt| general introduction to Vim; notation used in help files
|help.txt|  overview and quick reference (this file)
|helphelp.txt|  about using the help files
|index.txt| alphabetical index of all commands
|help-tags| all the tags you can jump to (index of tags)
|howto.txt| how to do the most common editing tasks
|tips.txt|  various tips on using Vim
|message.txt|   (error) messages and explanations
|quotes.txt|    remarks from users of Vim
|develop.txt|   development of Vim
|debug.txt| debugging Vim itself
|uganda.txt|    Vim distribution conditions and what to do with your money

Basic editing ~
|starting.txt|  starting Vim, Vim command arguments, initialisation
|editing.txt|   editing and writing files
|motion.txt|    commands for moving around
|scroll.txt|    scrolling the text in the window
|insert.txt|    Insert and Replace mode
|change.txt|    deleting and replacing text
|indent.txt|    automatic indenting for C and other languages
|undo.txt|  Undo and Redo
|repeat.txt|    repeating commands, Vim scripts and debugging
|visual.txt|    using the Visual mode (selecting a text area)
|various.txt|   various remaining commands
|recover.txt|   recovering from a crash

Advanced editing ~
|cmdline.txt|   Command-line editing
|options.txt|   description of all options
|pattern.txt|   regexp patterns and search commands
|map.txt|   key mapping and abbreviations
|tagsrch.txt|   tags and special searches
|quickfix.txt|  commands for a quick edit-compile-fix cycle
|windows.txt|   commands for using multiple windows and buffers
|tabpage.txt|   commands for using multiple tab pages
|syntax.txt|    syntax highlighting
|spell.txt| spell checking
|diff.txt|  working with two to four versions of the same file
|autocmd.txt|   automatically executing commands on an event
|filetype.txt|  settings done specifically for a type of file
|eval.txt|  expression evaluation, conditional commands
|fold.txt|  hide (fold) ranges of lines

Special issues ~
|print.txt| printing
|remote.txt|    using Vim as a server or client
|term.txt|  using different terminals and mice
|digraph.txt|   list of available digraphs
|mbyte.txt| multi-byte text support
|mlang.txt| non-English language support
|arabic.txt|    Arabic language support and editing
|farsi.txt| Farsi (Persian) editing
|hebrew.txt|    Hebrew language support and editing
|russian.txt|   Russian language support and editing
|ft_ada.txt|    Ada (the programming language) support
|ft_sql.txt|    about the SQL filetype plugin
|rileft.txt|    right-to-left editing mode

GUI ~
|gui.txt|   Graphical User Interface (GUI)
|gui_w32.txt|   Win32 GUI

Interfaces ~
|if_cscop.txt|  using Cscope with Vim
|if_pyth.txt|   Python interface
|if_ruby.txt|   Ruby interface
|debugger.txt|  Interface with a debugger
|sign.txt|  debugging signs

Versions ~
|vim_diff.txt|  Main differences between Nvim and Vim
|vi_diff.txt|   Main differences between Vim and Vi
                                                *sys-file-list*
Remarks about specific systems ~
|os_win32.txt|  MS-Windows
                                                *standard-plugin-list*
Standard plugins ~
|pi_gzip.txt|      Reading and writing compressed files
|pi_netrw.txt|     Reading and writing files over a network
|pi_paren.txt|     Highlight matching parens
|pi_tar.txt|       Tar file explorer
|pi_vimball.txt|   Create a self-installing Vim script
|pi_zip.txt|       Zip archive explorer

LOCAL ADDITIONS:                *local-additions*

------------------------------------------------------------------------------
*bars*      Bars example

Now that you've jumped here with CTRL-] or a double mouse click, you can use
CTRL-T, CTRL-O, g<RightMouse>, or <C-RightMouse> to go back to where you were.

Note that tags are within | characters, but when highlighting is enabled these
characters are hidden.  That makes it easier to read a command.

Anyway, you can use CTRL-] on any word, also when it is not within |, and Vim
will try to find help for it.  Especially for options in single quotes, e.g.
'hlsearch'.

------------------------------------------------------------------------------
 vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:
\$\endgroup\$
5
\$\begingroup\$

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!

\$\endgroup\$
5
\$\begingroup\$

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.

\$\endgroup\$
4
\$\begingroup\$

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.

\$\endgroup\$
7
  • \$\begingroup\$ 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). \$\endgroup\$ Jan 25, 2017 at 23:22
  • \$\begingroup\$ @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. \$\endgroup\$
    – simbabque
    Jan 25, 2017 at 23:36
  • \$\begingroup\$ 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." \$\endgroup\$ Jan 26, 2017 at 0:18
  • \$\begingroup\$ Looking at the rules again, you could actually just do the uber boring perl -E'say$^X'. \$\endgroup\$ Jan 26, 2017 at 21:50
  • 2
    \$\begingroup\$ How about -E'say`$^X -v`' ? That's indisputably a program. \$\endgroup\$
    – hobbs
    Jan 29, 2017 at 18:02
4
\$\begingroup\$

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.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ "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. \$\endgroup\$
    – Billywob
    Jan 25, 2017 at 11:00
  • 2
    \$\begingroup\$ 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. \$\endgroup\$
    – rturnbull
    Jan 25, 2017 at 11:56
  • 1
    \$\begingroup\$ @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. \$\endgroup\$
    – Frédéric
    Jan 25, 2017 at 17:36
4
\$\begingroup\$

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.

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

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.
\$\endgroup\$
4
\$\begingroup\$

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!

\$\endgroup\$
1
  • \$\begingroup\$ Nice loophole lol \$\endgroup\$
    – emanresu A
    Jan 30, 2022 at 20:36
3
\$\begingroup\$

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"
\$\endgroup\$
2
  • 2
    \$\begingroup\$ Very nice! Of course, I have bias towards my import this solution for the creativity factor, but you can take the shorter answer :P \$\endgroup\$
    – Value Ink
    Jan 25, 2017 at 0:44
  • \$\begingroup\$ @RaisingAgent Rule 4 says The output of the programming language name is not case sensitive. \$\endgroup\$
    – user63571
    Jan 25, 2017 at 15:12
3
\$\begingroup\$

C 24 20 Bytes (Clang 3.8.1)

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

main(){putchar(67);}
\$\endgroup\$
7
  • \$\begingroup\$ How about putchar(67);? \$\endgroup\$
    – r3mainer
    Jan 25, 2017 at 1:36
  • \$\begingroup\$ @squeamishossifrage yep, thanks \$\endgroup\$
    – Wade Tyler
    Jan 25, 2017 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\$
    – Vitani
    Jan 25, 2017 at 9:51
  • 1
    \$\begingroup\$ @Jocie printf needs a char * so I need to use "" \$\endgroup\$
    – Wade Tyler
    Jan 25, 2017 at 12:30
  • 2
    \$\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\$ Jan 26, 2017 at 15:16
3
\$\begingroup\$

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.

\$\endgroup\$
4
  • \$\begingroup\$ Nitpick, but this outputs 'jelly' without a capital J. \$\endgroup\$
    – steenbergh
    Jan 30, 2017 at 13:18
  • 2
    \$\begingroup\$ @steenbergh The output of the programming language name is not case sensitive. \$\endgroup\$
    – user45941
    Jan 31, 2017 at 19:47
  • \$\begingroup\$ @Mego Huh, my bad. Could've sworn that it was... \$\endgroup\$
    – steenbergh
    Jan 31, 2017 at 19:53
  • \$\begingroup\$ @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. \$\endgroup\$
    – user62131
    Feb 1, 2017 at 0:16
3
\$\begingroup\$

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 ...
\$\endgroup\$
3
\$\begingroup\$

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

\$\endgroup\$
2
  • \$\begingroup\$ The online interpreter times out before reaching pyke (on the second solution) :( \$\endgroup\$
    – devRicher
    Jan 25, 2017 at 11:02
  • \$\begingroup\$ @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) \$\endgroup\$
    – Blue
    Jan 25, 2017 at 17:18
3
\$\begingroup\$

Labyrinth, 31 28 bytes

76.65.66.89.82.73.78.84.72.@

Try it online!

Prints LABYRINTH.

\$\endgroup\$
3
\$\begingroup\$

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
~
~
~
~
~
~
\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ @mbomb007 Completely forgot about that, fixed. e does the exact same thing. Thanks. \$\endgroup\$
    – Fatalize
    Jan 25, 2017 at 14:57
3
\$\begingroup\$

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.

\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ Commandline php would be php -v, which is 6 :) \$\endgroup\$
    – Martijn
    Jan 26, 2017 at 15:31
  • \$\begingroup\$ @Martijn You're right. Thanks! Because we need php anyway, I wonder if it's not just 2 bytes for the -v flag... \$\endgroup\$
    – Arnauld
    Jan 26, 2017 at 15:39
  • \$\begingroup\$ 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 \$\endgroup\$
    – Sleavely
    Nov 18, 2019 at 14:19
3
\$\begingroup\$

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...
\$\endgroup\$
0
3
\$\begingroup\$

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
\$\endgroup\$
3
\$\begingroup\$

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

\$\endgroup\$
0
3
\$\begingroup\$

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

READY.
\$\endgroup\$
3
  • \$\begingroup\$ You don't require the line number here as you can execute any sys call in direct mode. \$\endgroup\$ Aug 13, 2019 at 16:01
  • 1
    \$\begingroup\$ @ShaunBebbers, the line number is what makes it a program rather than an immediate command. \$\endgroup\$
    – Mark
    Aug 13, 2019 at 21:38
  • \$\begingroup\$ 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. \$\endgroup\$ Aug 13, 2019 at 21:46
3
\$\begingroup\$

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.
\$\endgroup\$
1
3
\$\begingroup\$

Python 2 (15 Bytes)

exec"\x68elp()"

Python 3 (17 Bytes)

exec('\x68elp()')
\$\endgroup\$
3
\$\begingroup\$

Python 2, 41 39 33 bytes

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

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

Try it online!

\$\endgroup\$
5
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – emanresu A
    Jan 30, 2022 at 18:22
  • \$\begingroup\$ @emanresuA thanks (btw I'm a sock lol) \$\endgroup\$
    – mathcat
    Jan 30, 2022 at 18:27
  • \$\begingroup\$ how did I not see the anagram \$\endgroup\$
    – emanresu A
    Jan 30, 2022 at 18:29
  • \$\begingroup\$ Why use escape codes when you can just use uppercase letters? \$\endgroup\$
    – Wheat Wizard
    Jan 30, 2022 at 19:32
  • \$\begingroup\$ @WheatWizard oh, wait \$\endgroup\$
    – mathcat
    Jan 30, 2022 at 19:42
2
\$\begingroup\$

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

\$\endgroup\$
1
  • 14
    \$\begingroup\$ The Boring Cheaty Way isn't allowed because you're using R and r. \$\endgroup\$
    – flornquake
    Jan 25, 2017 at 16:17
2
\$\begingroup\$

Python 2, 15 bytes

exec"\150elp()"

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

\$\endgroup\$
2
\$\begingroup\$

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 [email protected]
mailing list.
\$\endgroup\$
2
\$\begingroup\$

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....
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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