[Question]
  [
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
 
 
---
 Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win.
Closed 7 years ago.
[Improve this question](/posts/1091/edit) 
Produce only the name of a programming language using only the facilities of the language itself. The name of the language can only be invoked indirectly, i.e., from non custom environment variables, built-in functions or methods or the interpreter/compiler of the language. Output should be the name of the language only.
One example would be:
```
$ awk --v | awk 'NR<2 { print $2}'  # GNU Awk 3.1.8
Awk
```
The answer I select will be the one with the most up votes. In case of a tie, the shortest golfed version (separate or the only given answer), will be the tie breaker.
  
[Answer]
## Whitespace
```
|  	 	 			
	
    		 	   
	
    		 	  	
	
    			 	  
	
    		  	 	
	
    			  		
	
    			    
	
    		    	
	
    		   		
	
    		  	 	
	
|
```
[Answer]
## C
```
#define d(x) x(#x[3])
void main(){d(putchar);}
```
[Answer]
# Python - 23 22
```
print`credits`[97:103]
```
[Answer]
## J,4
```
u:74
```
Having a short language name does kind of help.
[Answer]
# Python (win32) - abuse of the random module
I'm not sure whether this actually *works.* Depends on the implementation.
```
print ''.join([(random.seed(835)==None)and'']+[chr(random.randint(64,90)) for x in range(3)]+[(random.seed(53281)==None)and'']+[chr(random.randint(64,90)) for x in range(3)])
```
[Answer]
## BASH, ~~17~~ 7
```
bash -c 'echo $0'
```
or even
```
echo ${0#-}
```
if you already run bash :D
**update**: `"echo $0"` gets `$0` expanded first so `'echo $0'` is the correct answer.
[Answer]
## BrainFuck
Just for fun (I know this isn't related to the purpose of the task.), I wrote this code...
```
+++++[><-+-+-><><>++<><>+++++<>+<]>>>+
+>><<+<>+><<>+[><-<<+>>><>+<><>++<]>[-<<<
+>>>]+<<+<[><->>+>><>+<<><+<<]>->-><>->
+++++<<>+++++<<>------>><>+.<<[-<>+<>->
+<]>>+><+<>><+><+[<]>-<><>-><<>-<<>+>-.<
+<><>+<>+[><>-<>-><<>-<>><-<><>-><><-+<
++---]>[+>]<<+><+.>><-<<+++++[>+<><><-]
>
+++.>+<+<>+++<>+.+>
-.<><+<+><+><><++>
+++<>+<+>>+<><>+<
+.<><+[->>+>><<++
+<>><++-<<-+-<>+]+
>
>
---.<
---
---
---
<>>
<-.
---
>-<
```
And when I replaced `<`,`>`,`[`,`]`,`.` with space...
```
+++++   -+-+-     ++    +++++  +     +
+    +  +    +   -  +     +    ++    -   
+    +  +    -  +    +    +    - -   - 
+++++   +++++   ------    +    -  +  - 
+    +  +    +  +    -    -    -   + -  
+    +  +    -  -    -    -    -    -+ 
++---   +    +  +    -  +++++  +     - 
+++  + +  +++  + + 
-    + +  +    ++ 
+++  + +  +    + 
+    + -  +    ++
+    ++-  -+-  + +
---  
---
---
---
 - 
---
 - 
```
[Answer]
**Piet, 47x2 pixels**
Using 5x5 codels: ![Piet program to print "Piet"](https://i.stack.imgur.com/MI4RJ.gif)
[Answer]
## Python
```
import sys;print sys.copyright[24:30]
```
This also works for me (sys.executable is '/usr/bin/python')
```
import sys;print sys.executable[9:]
```
[Answer]
## brainfuck 101
```
++++++++[->++++++++++++>+>>++>+++<<<<<]>[->+>+>+>+<<<<]>+>++.>++.<-.<.>>----.<<---.>>>---.<<++.>---.
```
could probably be golfed slightly further, but it's 6am and I should get some sleep...
[Answer]
## **C**
In the spirit of Anon's answer in C (considering a C file always has the extension .c). I'd suggest :
```
#include <stdio.h>
void main(){puts(__FILE__+sizeof(__FILE__)-2);}
```
[Answer]
## Java
```
public class Name {
    public static void main(String[] args) {
        String s = "";
        s = s.getClass().getName();
        s = s.substring(0, 1).toUpperCase() + s.substring(1, 4);
        System.out.println(s);
    }
}
```
[Answer]
## C
Built using DevStudio 2005
```
#include <stdio.h>
void main ()
{
  int i,j,i2;
  for (i=j=0,i2=200;i2<=200;i2-=19,j==putchar(32|(i2<'Q'&&i2>'+'&&(j<20||i<12||i>28))*3)+8?j=0,i2+=i,i+=putchar('\n')-8:(i2+=j,j+=2));
}
```
Slightly shorter version (with compiler warnings)
```
int i,j,k;
for (i=j=k=0;k<=0;k-=19,j==putchar(32|(k<-119&&k>-157&&j<20|i<12|i>28)*3)+8?j=0,k+=i,i+=putchar('\n')-8:(k+=j,j+=2));
```
[Answer]
## Ruby - 27
```
puts RUBY_DESCRIPTION[0..3]
```
Update from Chris Jester-Young's comment:
## Ruby - 24
```
puts RUBY_COPYRIGHT[0,4]
```
Updated from Hauleth:
## Ruby - 15
```
p`ruby -v`[0,4]
```
[Answer]
## cat 3
Create a file with the following content (source code)
```
cat
```
And run it like (execute the file):
```
$ cat filename
```
[Answer]
# Clojure - 16 chars
```
(subs(str =)0 7)
```
[Answer]
## Haskell, 47
```
data H=Haskell deriving Show
main=print Haskell
```
[Answer]
# Ruby
Not short, but very indirectly.
```
4.times{|x|print((82+11.24*x+8.231*Math.tan(111.2*x)).floor.chr)}
```
[Answer]
### Ruby (17)
`p 1299022.to_s 36`
Outputs `"ruby"`
[Answer]
# Bash/Brainfuck/C
```
//bin/bash -c 'echo ${0##*/}'
#define p putchar
#define exit main(){p(p+67);p(10);}
exit
//++++++++[->++++++++++++>+>>++>+++<<<<<]>[->+>+>+>+<<<<]
//>+>++.>++.<-.<.>>----.<<---.>>>---.<<++.>---.
```
[Answer]
## Brainfuck
```
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.
++++++++++++++++++++++++++++++++++++++++++++++++.
-----------------.
++++++++.
+++++.
--------.
+++++++++++++++.
------------------.
++++++++.
```
[Answer]
## Perl
```
$^X=~/([a-z]+)[^\/]+$/;print$1,$/
```
[Answer]
## Scala — 42
```
print(((1,1).getClass+"").substring(6,11))
```
**Update — 39 chars**
```
print(('a.getClass+"").substring(6,11))
```
[Answer]
**C - 34**
I don't have enough reputation to add this as a comment to the previous C entry. Same idea as above, but the filename can be anything.c
```
main(){puts(index(__FILE__,0)-1);}
```
[Answer]
## ><> (Fish) (11)
Even better:
```
'>'::o2-oo;
```
[Answer]
## Visual Basic (version 6.0)
```
MsgBox Right(Error(458), 12)
```
## VBScript
```
On Error Resume Next
Err.Raise 458
MsgBox Right(Err.Description, 8)
```
## Both VB6 and VBScript
```
On Error Resume Next
Err.Raise 458
D = Err.Description
MsgBox Mid(D, InStr(2, D, "V"))
```
[Answer]
## QBasic (37)
I am using version 1.1 of the QBasic interpreter.
```
FOR x=0TO 5:?CHR$(PEEK(2588+x));:NEXT
```
[Answer]
**Lua 25 Chars**
```
print(arg[-1]:match"%w+")
```
Or, analogue to the J B's [J solution](https://codegolf.stackexchange.com/questions/1091/whats-my-name-produce-the-name-of-the-language-indirectly/1138#1138) 17 chars:
```
print"\76\117\97"
```
[Answer]
## GolfScript (13)
```
"#{$0[0..9]}"
```
[Answer]
## Racket (45)
```
racket -e "(display(substring(banner)10 17))"
```
]