Programming Puzzles & Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Challenge:

In the programming language of your choice, take no input and output your programming languages 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.

share|improve this question
6  
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. – Level River St yesterday
4  
Obligatory "Just having your code be blank but have a flag like --version isn't allowed"? – Value Ink yesterday
39  
Have case-insensitive output while banning the language name case-sensitively allows boring solutions that just output the language name case-swapped. – xnor yesterday
1  
Does the output need to go to the screen/be printed, or can it be returned as well? – simbabque yesterday
1  
@xnor Agreed. This should be changed. – mbomb007 yesterday

72 Answers 72

MATL, 1 byte

Y

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

share|improve this answer
3  
Should you merge with this? – wizzwizz4 20 hours ago
    
@wizzwizz4 I'm not sure. I asked in chat and got these two replies, so it's not really clear – Luis Mendo 19 hours ago
    
yeah but Y tho? – sagiksp 5 hours ago
    
@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 – Luis Mendo 4 hours ago

SmileBASIC, 11 bytes

sPsET.,1474

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

Screenshot

share|improve this answer

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

1

Error:

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

Lua, 1 byte

1

Error:

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

(file name is unimportant)

Batch, 1 byte

~

Error:

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

tinylisp, 5 bytes

(c()1

Error:

Error: cannot cons to non-list in tinylisp

C (gcc), 1 byte

9

Error:

/dev/stdin:1:1: error: expected identifier or ‘(’ before numeric constant

R, 1 byte

)

Error:

Error: unexpected ')' in ")"

Java bytecode, 0 bytes

Error:

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

Groovy, 1 byte

a

Note that a can be replaced with any other character

Error:

groovy.lang.MissingPropertyException: No such property: a ...
share|improve this answer
9  
Isn't the empty string contained in the language's name? :D – mbomb007 yesterday
3  
The C and R ones are clever. – DLosc 7 hours ago

Commodore 64 BASIC, 0 bytes

The name of the language is displayed when you start the computer:

enter image description here

In fact, there are many computers displaying similar information upon booting.

share|improve this answer
    
I don't think this counts, since you aren't actually running any BASIC code. – 12Me21 17 hours ago
1  
@12Me21 Well, yes, since its (the code's) length is 0 bytes... The classical mathematical "every element of the empty set" argument. – Radovan Garabík 17 hours ago
9  
There's a difference between running a 0 byte program and not running a program at all. – 12Me21 17 hours ago
    
@12Me21 That's a fair point.Anyway, typing RUN will just display READY and won't erase the "BASIC V2" message :-) – Radovan Garabík 6 hours ago

HTML, 24 20 bytes

&#72;&#84;&#77;&#76;


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.

&#72&#84&#77&#76


Also, see my CSS answer.

share|improve this answer
3  
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). – Bob yesterday
    
@Bob Thanks for the tips! – darrylyeo yesterday
    
Why doesn't HTML count? – OrangeDog yesterday
    
@OrangeDog "You can't use any character that is included in your programming language's name in your code" – darrylyeo 20 hours ago

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!

share|improve this answer
    
where is the name ? Or do you refer to the c characters in there ? – HopefullyHelpful 3 hours ago
    
This should be marked as C (gcc), because other compilers have different messages. – orlp 2 hours ago

Python 3, 28 17 bytes

exec("\150elp()")

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.

share|improve this answer
    
Not sure help counts, it only works in a REPL environment. – xnor yesterday
    
It still prints out the Python. That's all that's required. – Jack Bates yesterday
    
If it works in TIO surely it's a valid answer? – Jack Bates yesterday
1  
Never mind, I was mistaken and it works as a program. Sorry about that. – xnor yesterday
2  
p is allowed but P isn't. Rule 1. – Jack Bates 21 hours ago

V, 2 bytes

¬U

Try it online!

The obvious answer is:

év~

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

share|improve this answer

MATLAB, 3 bytes

ver

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: 8.6.0.267246 (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)
share|improve this answer
    
Uses a v and an e – Jack Bates yesterday
    
Your language is Octave, so you can't use v and e. – JungHwan Min yesterday
3  
Woops. Corrected by changing language to Matlab (which was my initial intent anyway) – Luis Mendo yesterday

JAVA, 1 byte

1

The output to stderr is:

Main.java:1: error: class, interface, or enum expected
1
^
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 
share|improve this answer
7  
This is output from compilation, rather than running the program. I don't know whether this is allowed by default. – CAD97 yesterday
2  
Also, if you chose a different file extension, it wouldn’t output "java" would it? (Not sure if that’s possible with java) – Jonas Wielicki yesterday
6  
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 – user902383 yesterday
2  
Programs outputting to stderr should be edited into this answer. – mbomb007 yesterday

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

share|improve this answer
    
echo $0 should work – squeamish ossifrage yesterday
    
@squeamishossifrage That works at the shell command line, but in a script it will output the name of the script. – Digital Trauma yesterday
    
echo $SHELL isn't any better anyway. pastebin.com/BfsWjCni Regardless whether you run it from command line or script and whether you use shebang in that script or not. – manatwork yesterday
1  
'h' is illigal character for you, and you are using it in echo – user902383 yesterday
1  
$'ec\x68o' $0 cures that detail. – manatwork yesterday

R, 1 byte:

T

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

share|improve this answer

dc, 6

25699P

Outputs dc.

Try it online.

share|improve this answer

><>, 12 10 bytes

"2,:o:2-o|

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

Try it online!

share|improve this answer
    
Brilliant solution! – Emigna yesterday
    
@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 – Teal pelican 23 hours ago
    
Nice one ! Here's a 14 bytes version which only prints once and doesn't errors out : "-o-o-o;_!\ _! – Aaron 22 hours ago

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

<Ctrl-C>

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

share|improve this answer
1  
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. – ais523 yesterday

Python, 27 53 49 48 bytes

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!
share|improve this answer
1  
@Arnauld fixed! – Value Ink yesterday
1  
HELP() or HELP(HELP) is shorter. – Gurupad Mamadapur yesterday
    
It doesn't matter if you swap the case of the import string, because you're making it lower-case anyway. -3 bytes. – wizzwizz4 20 hours ago

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):

-[[-<]->+[->]<-]<<.<<<<<--.>>+.<-.+++++.>>>------.<<<<+++.>>++.<---.
share|improve this answer

brainfuck, 105 Bytes

--[----->+<]>----.[--->+<]>----.+++[->+++<]>++.++++++++.+++++.--------.-[--->+<]>--.+[->+++<]>+.++++++++.


Try it online here


share|improve this answer
4  
Well, not a problem in BrainFuck ;) – devRicher yesterday
    
@devRicher not at all ;) – TrojanByAccident yesterday
    
The name of the language is "brainfuck" all lowercase. FYI. – mbomb007 yesterday
    
@mbomb007 I see. – TrojanByAccident 18 hours ago
    
@mbomb007 updated – TrojanByAccident 18 hours ago

R, 11 bytes

cat("\x52")

Try it online!

share|improve this answer
    
version$l 9 bytes – djhurio yesterday
2  
Probably version is enough (7 bytes) – djhurio yesterday
1  
Or just 'r'. 3 bytes. – Konrad Rudolph 20 hours ago
    
@KonradRudolph You can't use... wait; the specs are case sensitive in checking but not output... Clever. – wizzwizz4 20 hours ago
    
@wizzwizz4 Yeah … but I’ve since posted a solution that only needs one character, and even gets the case right. – Konrad Rudolph 20 hours ago

CSS, 25 bytes

:after{content:'\43\53\53

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

<style>:after{content:'\43\53\53

to see the result as intended.

share|improve this answer

C 24 20 Bytes (Clang 3.8.1)

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

main(){putchar(67);}
share|improve this answer
    
How about putchar(67);? – squeamish ossifrage yesterday
    
@squeamishossifrage yep, thanks – Wade Tyler yesterday
    
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. – Jocie yesterday
    
Sure sounds like it would, @jocie, but 67 is shorter than 'c' :-) – Cody Gray yesterday
1  
@Jocie printf needs a char * so I need to use "" – Wade Tyler yesterday

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:

z@8WRz@15
(z8+^707)

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. ;^)

share|improve this answer

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.

share|improve this answer

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:
share|improve this answer

C#, 60 67 bytes

class P{static void Main(){System.\u0043onsole.Write("\x43\x23");}}
share|improve this answer
    
Is this actually your answer, or did a bug messed up your answer? – auhmaan yesterday
    
@auhmaan Sorry, fixed. I initially tested on LINQPad, and forgot it has a few default namespace imports. – Bob yesterday
    
I was referring to the \u0043 and alikes – auhmaan 22 hours ago
1  
@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. – Bob 22 hours ago

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"
share|improve this answer
1  
Very nice! Of course, I have bias towards my import this solution for the creativity factor, but you can take the shorter answer :P – Value Ink yesterday
    
I'm might bewrong here... but you can't use P y t h o n . Which you want to output instead of pYTHON. Doesn't your code miss the point? (Python !== pYTHON is what im saying) – RaisingAgent yesterday
    
@RaisingAgent Rule 4 says The output of the programming language name is not case sensitive. – Jack Bates 23 hours ago

Python 2, 15 bytes

exec"\150elp()"

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

share|improve this answer

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.
share|improve this answer

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 ...
share|improve this answer

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.

share|improve this answer
    
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). – ThisSuitIsBlackNot 15 hours ago
    
@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. – simbabque 15 hours ago
    
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." – ThisSuitIsBlackNot 14 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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