Your goal is to write "Hello, World!" (minus the quotes). This is a , so most up votes wins. Code length will be used to break ties.
Anything goes, as long as it is within the following rules:

  • All characters must be either letters or numbers, so you may only use characters in the string "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".
  • All code you use must be in one file, with the exception of imported modules/classes/whatever they're called in your favourite language.
  • Only the standard libraries/frameworks for your language of choice are allowed (for example, Python's Math module is allowed, but Numpy, Scipy, and Pygame are not). I will allow TkInter as it is the de facto standard for GUIs in Python.
  • No input is permitted, be it reading from stdin, reading a file, displying an image, or reading from the web.

+10 brownie points if you figure out how to do it in Java without bending the rules.

On your marks, get set, code!

EDIT: braces ({}), brackets ([]), and parentheses (()) are allowed as this would be pretty much impossible for most languages without them. I'm also removing the character limit rule. Hopefully this will make it more interesting.

EDIT^2: white space is also allowed. My brain isn't working properly, sorry. >.<

  • 1
    \$\begingroup\$ Up to you, I'm just making sure. What about whitespace? \$\endgroup\$ – Geobits Mar 5 '14 at 14:04
  • 1
    \$\begingroup\$ Oh, right white space. My brain is clearly not functioning properly today. That should be allowed. One second, let me fix the rules. \$\endgroup\$ – wec Mar 5 '14 at 14:15
  • 9
    \$\begingroup\$ So, no operators? And, most importantly, no ;? How can I write anything in C? \$\endgroup\$ – Oberon Mar 5 '14 at 14:22
  • 1
    \$\begingroup\$ esolangs.org Hello, World! \$\endgroup\$ – Geobits Mar 5 '14 at 22:41
  • 3
    \$\begingroup\$ +1 for figuring out how to exclude J in a natural way: 72 101 108 108 111 44 32 87 111 114 108 100 33{a. requires the period at the end to work, and a path through u: similarly requires a colon. Without . and : we are nothing. \$\endgroup\$ – algorithmshark Mar 5 '14 at 23:32

52 Answers 52



Some say perl is a language full of ascii noise and random symbols like $... That is not true :P

s zzHelloq worldmz and s zqzchr 44ze and s zmzchr 33ze and print

Let's break this up into subexpressions:

(s zzHelloq worldmz) and (s zqzchr 44ze) and (s zmzchr 33ze) and (print)
It should be obvious that it executes from left to right as long as every expression returns true. But what on earth is s zqzchr 44ze?

In perl, there is a group of "quote-like operators" which includes q(str), qw(li st), /regex/, s/from/to/ among other things. It turns out all of these operators can use almost any character as a delimeter, with a couple pecularities: opening parethesis has to be closed by a matching closing parenthesis, and if you wish to use a letter as a delimiter you have to put a space after the operator letter (to disambiguate it from a bareword).

In this case we see three uses of the s/// (regex substitution) operator:

s//Helloq worldm/
s/q/chr 44/e
s/m/chr 33/e
All delimited by the character z. The /e flag on the last two causes the substitution to be interpreted as code to be evaluated, rather literal text.

A fairly well-known fact about perl is that most operations default to operating on the $_ builtin variable unless otherwise specified. All these three substitutions and the print operate on $_ in this case, so first we put the words Hello world into the variable, then we fix the punctuation by using the numeric ascii values of the characters, then we print the contents of the variable.

  • 47
    \$\begingroup\$ +1 I don't know what the hell is going on here, but it works! \$\endgroup\$ – r3mainer Mar 5 '14 at 19:23
  • 99
    \$\begingroup\$ @squeamishossifrage That could be the perl motto \$\endgroup\$ – mniip Mar 5 '14 at 19:54
  • 7
    \$\begingroup\$ If you could, would you add a small explanation? \$\endgroup\$ – user12205 Mar 5 '14 at 22:21
  • 11
    \$\begingroup\$ I'm by no means an expert, but in perl a replacement is usually indicated by s/PATTERN/REPLACEMENT/FLAGS, but you can actually use most anything you want instead of the slashes. The code here uses "z" instead of slashes and turns (nothing) into "Helloq Worldm" then replaces "q" for chr 44 (using the \e flag to evaluate REPLACEMENT aka "chr 44" as an expression) which is ",". It then replaces "m" with chr 33, a "!", and prints it. \$\endgroup\$ – Amory Mar 6 '14 at 0:20
  • 3
    \$\begingroup\$ @ace in a quote-like operator, e.g q//, any delimiter can be used, q!! q** q\\ q;;. A few exceptions are that to close ( you use ), q() q[] q{} q<>, and that to use an alphanumeric as a delimiter, it should be spaced from the operator to disallow ambiguity, eg q qq, q 66. The same tricks apply to other quote-like operators. \$\endgroup\$ – mniip Mar 6 '14 at 9:57


int main(void) {
  if (putchar(72))
    if (putchar(101))
      if (putchar(putchar(108)))
        if (putchar(111))
          if (putchar(44))
            if (putchar(32))
              if (putchar(87))
                if (putchar(111))
                  if (putchar(114))
                    if (putchar(108))
                      if (putchar(100))
                        if (putchar(33)) 
  • 4
    \$\begingroup\$ Awesome! It CAN be done in C. And I thought I'd won this... \$\endgroup\$ – Level River St Mar 5 '14 at 21:42
  • 2
    \$\begingroup\$ @ace Only if you have cases defined. You can easily rewrite this as switch(putchar(72)){}switch(putchar(101)){}, etc. \$\endgroup\$ – Comintern Mar 5 '14 at 23:56
  • 28
    \$\begingroup\$ +1 for putchar(putchar(108)) \$\endgroup\$ – Ilmari Karonen Mar 6 '14 at 7:54
  • 2
    \$\begingroup\$ Just missing an "if(putchar(44))" for the comma. \$\endgroup\$ – Desty Mar 6 '14 at 13:07
  • 1
    \$\begingroup\$ Well spotted, not sure how I missed the comma in the question. Fixed. \$\endgroup\$ – mattnewport Mar 6 '14 at 15:41

(edit - BBC basic moved to separate answer as suggested. Most of the votes on this are definitely for the LOGO answer.)


Interpreter at http://www.calormen.com/jslogo/#

TO h        pd  fd 100 rt  90  pu  fd 50  rt 90  pd  fd 100  rt 180 fd 50  lt 90  fd 50  rt 90  pu END 
TO e        pu  fd 25  rt  90  pd  fd 25  rt 90  arc 270 25  lt 90  fd 25  lt 90  pu END  
TO l        pd  fd 100 pu  END  
TO o        rt  45 fd  35  pd  arc 360 25  lt  45  pu END 
TO comma    pd  rt 90  arc 90  15  lt  90  pu END 
TO w         l  rt 180 l   pd  lt  135 fd  35  rt  90  fd 35  lt 135  l  END  
TO r        pd  fd 25  rt  90  pu  fd  25  rt 180  arc 180 25 rt 90 END 
TO d         o  rt 135 fd  35  lt  135  l  END      
TO exclaim arc 360 5   fd  10  l  END 
setpencolor 4 pu 
setxy 0 150      h 
setxy 100 150    e  
setxy 200 150    l 
setxy 250 150    l 
setxy 300 150    o 
setxy 350 150    comma  
setpencolor 1 
setxy 0 0        w 
setxy 100 0      o 
setxy 200 0      r  
setxy 300 0      l 
setxy 350 0      d 
setxy 450 0      exclaim 
fd 100

Output (the green triangle is the turtle cursor)

enter image description here

  • 2
    \$\begingroup\$ You should split this answer into two. \$\endgroup\$ – Justin Mar 5 '14 at 19:11
  • \$\begingroup\$ @WallyWest I hardly know the language, but it was the tool for the job. You can print text too (it's called a label on your drawing) but you need a quotation mark for that (I think only the opening quote is required and the closing quote is optional.) \$\endgroup\$ – Level River St Mar 6 '14 at 1:01
  • 2
    \$\begingroup\$ +1 for drawing it instead of printing words. \$\endgroup\$ – wec Mar 7 '14 at 17:58
  • \$\begingroup\$ @steveverril The second quote would be a syntax error, actually. \$\endgroup\$ – tomsmeding May 21 '14 at 15:01


No brackets [], braces {} or parentheses () at all in this one:

set s to ASCII character 72
set s to s as list
set end of s to ASCII character 101
set end of s to ASCII character 108
set end of s to end of s
set end of s to ASCII character 111
set end of s to ASCII character 44
set end of s to space
set end of s to ASCII character 87
set end of s to item 5 of s
set end of s to ASCII character 114
set end of s to third item of s
set end of s to ASCII character 100
set end of s to ASCII character 33
display dialog s as text

Output is: enter image description here

  • 12
    \$\begingroup\$ Unbelievable! (Having to write the word "character" in full, I mean!) Now I understand what they mean about Apples being expensive. Only joking, +1 for something different :-) \$\endgroup\$ – Level River St Mar 5 '14 at 23:52
  • 11
    \$\begingroup\$ AppleScript is ridiculously verbose, but the result is it really is one of the most comprehensible programming languages for a layperson. \$\endgroup\$ – Jonathan Van Matre Mar 6 '14 at 4:40
  • 3
    \$\begingroup\$ @JonathanVanMatre Hard to write, easy to read \$\endgroup\$ – Digital Trauma Mar 6 '14 at 4:53
  • 2
    \$\begingroup\$ even C is easier to read... \$\endgroup\$ – Display Name Mar 10 '14 at 11:41
  • 1
    \$\begingroup\$ @Cruncher — This is easy. The command set s to s as list transforms "H" into {"H"} (a list). In other languages, like Java, it is usually way more complicated to do that. \$\endgroup\$ – Nicolas Barbulesco May 15 '14 at 13:22


This sort of works, if you squint your eyes:

echo NN i NN i i i iNN NNi i i i i i i NN i NN i i i i i i i NNi i i NN NN
echo NN i NNi i i i NN NN i i i i i i iNN i NN i i i i i i i NN i i iNN NN
echo NN i NN iNNNNi NN NN iNNNNi i i i NN i NN iNNNNi NN NN iNN iNNN NN NN
echo NN i NN NNNNNN NN NN NNi NN i i i NN N NN NNi NN NN i i NN NNi iNN N
echo NN i NN NN i i NN NN NN iNN i i i NNN NNN NN iNN NN i i NN NN i NN
echo NN i NN iNNNi iNN NN iNNNNi N i i NN i NN iNNNNi NN i i NN iNNNN N NN
echo i i i i i i i i i i i i i i N
  • 1
    \$\begingroup\$ this works in windows bat/cmd file too \$\endgroup\$ – phuclv Mar 10 '14 at 5:45
  • \$\begingroup\$ banner Hello World or figlet Hello World \$\endgroup\$ – user16402 Jun 15 '14 at 19:46
  • 2
    \$\begingroup\$ @professorfish The tricky part of this challenge is getting the , and !. Otherwise, I'd just use plain old echo. \$\endgroup\$ – Digital Trauma Jun 16 '14 at 16:49
  • \$\begingroup\$ @DigitalTrauma oh, sorry, didn't see that... a bit slow \$\endgroup\$ – user16402 Jun 16 '14 at 18:23


So what, we just assume everybody reads horizontally? For those users who like to read vertically:

print chr(72) 
print chr(101)
print chr(108)
print chr(108)
print chr(111)
print chr(44)
print chr(32)
print chr(87)
print chr(111)
print chr(114)
print chr(108)
print chr(100)
print chr(33)
  • \$\begingroup\$ +1 and hahaha! This question had so many downvotes at the beginning, because people believed it was impossible. I don't know Python, but given all the moaning I couldn't believe it was THAT easy in such a common language. \$\endgroup\$ – Level River St Mar 5 '14 at 19:44
  • 1
    \$\begingroup\$ I just wrote the exact same code before this answer was posted. I refreshed to post my answer and found this... \$\endgroup\$ – grovesNL Mar 5 '14 at 19:45
  • 1
    \$\begingroup\$ @steveverrill The moaning wasn't for no reason. There's not a single answer here that would have passed the original rules (no braces/parens/brackets, no characters repeated more than once) \$\endgroup\$ – Geobits Mar 5 '14 at 19:47
  • 1
    \$\begingroup\$ @grovesNL If it makes you feel better, this is the first thing I've ever used python for. I spent a while combing through docs, trying to figure out if there was any feasible way to concat them into one line before posting. \$\endgroup\$ – Geobits Mar 5 '14 at 19:48
  • \$\begingroup\$ @Geobits sys.stdout.write is the standard way to output text without newlines in most versions on Python (the behavior is slightly changed in 3.0). We can't do that here because of the periods. \$\endgroup\$ – grovesNL Mar 5 '14 at 20:05


       05  HE                       COMP    PIC 9999 
       05  LL                       COMP    PIC 9999 
       05  OCOMMA                   COMP    PIC 9999 
       05  SPACEW                   COMP    PIC 9999 
       05  ORTEXT                   COMP    PIC 9999 
       05  LD                       COMP    PIC 9999 
       05  EXCLAMATION              COMP    PIC 9999 
       05  HELLOWORLDTEXT                   PIC XXXXXXXXXXXXX
       05  FILLER                           PIC X 
       MOVE 51333                   TO HE 
       MOVE 37779                   TO LL 
       MOVE 38507                   TO OCOMMA 
       MOVE 16614                   TO SPACEW 
       MOVE 38553                   TO ORTEXT 
       MOVE 37764                   TO LD 
       MOVE 23104                   TO EXCLAMATION 

Required some changes to become truly alphanumeric source only.

PROGRAM-ID can be dropped. You get a generated program name (see messages).

WORKING-STORAGE can be dropped. Again the compiler moans.

Since both of these lines previously had missing full-stops/periods, which are no longer relevant now that the descriptions are entirely missing, the number of error messages is the same as before, and still does not affect the generated code for the program.

In changing COMP-5 to COMP, the VALUE clauses are no longer allowed, as COMP 9999 is only four decimal digits whereas COMP-5 is a two-byte binary with all bit-values available.

The values in the MOVEs are the decimal values which give the binary values which give the pairs of characters.

Even though the COMP fields have four digits, and do not allow VALUE clauses with more than four digits, you can use more digits in the MOVE of a literal value without truncation at that point... don't ask me why. Compiler option DIAGTRUNC (which I have turned off) will produce Warning diagnostics for these.

Compiler option TRUNC(BIN) could be used to treat COMP as COMP-5, but the MOVEs are another way to do it.

Since it is COBOL, the output must be in UPPER CASE (a lie, but just for fun).


OK, relented, now produces:

Hello, World!

Which, being an odd-number of characters, required some further changes, since we can't have odd-number-byte binary fields with this compiler. Look at that line of 13 Xs! It would normally be written as X(13), but can be as I've shown...

And ORTEXT is needed (or not OR, anyway) as a name because OR is a reserved word to the compiler (it means OR, of course).

These are EBCDIC values, not ASCII, since it is running on an EBCDIC-aware, and Big Endian, box.

Oh, COBOL requires lots of full-stops/periods. I left them out (they're banned) so got lots of compile messages. Just told the compiler to generate the code anyway (none of the messages relate to the object code).

Even without DIAGTRUNC, the messages are now up to 17...

  1  IGYDS1003-E   A "PROGRAM-ID" paragraph was not found. 
  Program-name "CBLNAM01" was assumed. 

  2  IGYDS1082-E   A period was required.  A period was assumed 
  before "DATA". 

  3  IGYDS1082-E   A period was required.  A period was assumed 
  before "01". 

                   Same message on line:     11 

  3  IGYDS1040-E   A data item was found in the "DATA DIVISION" 
                   before a section header was encountered. 
                   "WORKING-STORAGE SECTION" was assumed. 

  4  IGYDS1082-E   A period was required.  A period was assumed 
  before "05". 

                   Same message on line:      5      6      7      8
                   9     10     12     13 

 14  IGYDS1082-E   A period was required.  A period was assumed 
 before "PROCEDURE". 

 15  IGYPS2145-E   A period was required.  A period was assumed 
 before "MOVE". 

 23  IGYSC1082-E   A period was required.  A period was assumed 
 before "END OF PROGRAM". 
  • 1
    \$\begingroup\$ I don't think - is allowed \$\endgroup\$ – mniip Mar 5 '14 at 19:00
  • 1
    \$\begingroup\$ Good point. Fixing. Habits. \$\endgroup\$ – Bill Woodger Mar 5 '14 at 19:06
  • \$\begingroup\$ @mniip Mmmm.... a little more tricky... I'll have to fix up the WORKING-STORAGE later. I have to leave now... \$\endgroup\$ – Bill Woodger Mar 5 '14 at 19:09
  • 1
    \$\begingroup\$ I laughed at "Since it is COBOL, the output must be in UPPER CASE". Nice work! \$\endgroup\$ – Jonathan Van Matre Mar 13 '14 at 16:56

Polyglot: HQ9+, H9+, HQ9++, CHIQRSX9+, HQ9+B and HQ9+2D (1 byte)


Thank you @victor for the list of languages.

  • 7
    \$\begingroup\$ This is a polyglot. It works too in H9+, HQ9++, CHIQRSX9+, HQ9+B and HQ9+2D. \$\endgroup\$ – Victor Stafusa Mar 6 '14 at 4:43
  • \$\begingroup\$ I'm pretty sure it also works in Hello. \$\endgroup\$ – wec Mar 7 '14 at 17:15
  • 6
    \$\begingroup\$ It works in any language that you invent. \$\endgroup\$ – Zero Fiber Mar 7 '14 at 17:16
  • 2
    \$\begingroup\$ I didn't invented anything... \$\endgroup\$ – Ismael Miguel Mar 7 '14 at 18:14
  • 7
    \$\begingroup\$ Unfortunately the output is "hello, world" (esolangs.org/wiki/HQ9%2B), or according to this interpreter "Hello world." (almnet.de/esolang/hq9plus.php) To get "Hello, world!" you might need to increment the accumulator a few times. \$\endgroup\$ – tttppp Mar 10 '14 at 10:03



Satisfies the original rules.

  • 2
    \$\begingroup\$ Is base64 a language? And what's your output? Does it have the correct capitalization? \$\endgroup\$ – Level River St Mar 5 '14 at 14:55
  • 24
    \$\begingroup\$ Sure it's a language, it's just not Turing-complete. Also, base64decode.org \$\endgroup\$ – Kendall Frey Mar 5 '14 at 14:56
  • 1
    \$\begingroup\$ Haha. For that response, +1 your comment, but not your answer. Maybe your answer later if I feel like it. \$\endgroup\$ – Level River St Mar 5 '14 at 15:06
  • 2
    \$\begingroup\$ @Neil you used " \$\endgroup\$ – mniip Mar 6 '14 at 10:51
  • 2
    \$\begingroup\$ @KendallFrey By that logic, base10 is a language: 1234567890. \$\endgroup\$ – Cole Johnson Mar 7 '14 at 0:19


I'm a big fan of esoteric languages. Luckily OMGROFL is alphanumeric:

lol iz 72
rofl lol
lol iz 101
rofl lol
lol iz 108
rofl lol
rofl lol
lool iz 111
rofl lool
loool iz 44
rofl loool
loool iz 32
rofl loool
loool iz 87
rofl loool
rofl lool
lool iz 114
rofl lool
rofl lol
lol iz 100
rofl lol
lol iz 33
rofl lol

The iz command sets a value to a variable, in this case lol, lool and loool serve as variables...

The rofl command echoes out the ASCII equivalent to the number stored in the variable.

The stfu command terminates the program ;)

  • \$\begingroup\$ haha, nice! I wanted to attempt a LOLCODE version but the language requires using a colon and quotation marks to coerce ints to chars. \$\endgroup\$ – Jonathan Van Matre Mar 6 '14 at 4:41


with (function SGVsbG8sIFdvcmxkIQ(){}) atob(name)

Use browser's console to test.

  • \$\begingroup\$ Please could you explain how this works? How does atob(name) get the name of the function SGVsbG8sIFdvcmxkIQ()? \$\endgroup\$ – ΛRYΛN Oct 24 '20 at 14:10
  • \$\begingroup\$ @AryanBeezadhur See this. Since a function is just an object, you can access the function.name property. \$\endgroup\$ – Fabricio Oct 24 '20 at 19:26
  • \$\begingroup\$ Thanks. because the braces ({}) were omitted I mistakenly thought that the function atob(name) was outside of the with() function \$\endgroup\$ – ΛRYΛN Oct 24 '20 at 19:29

Ruby (using only alnums and whitespace)

putc 72
putc 101
putc 108
putc 108
putc 111
putc 44
putc 32
putc 87
putc 111
putc 114
putc 108
putc 100
putc 33

Output: Hello, World!



with (String) with ([]) {
  • 1
    \$\begingroup\$ ARGH! I hit the same solution, but decided that since it was 2:00 am, I should go to bed and post it in the morning. Kudos to you! \$\endgroup\$ – DocMax Mar 6 '14 at 16:03


h E R
e I S
h E
l L O
w O
r L
d U S
i N G
o N L
y L E
t T E
r S

H e L L o W O R
L d h E L l O w
O r l D h e L L
O w o R l d H E
L l o W o r l d
H E l L o w O R
L D h E L L O W
O r L d H e l l
O w o R l d h e
L l o w O R l D
H e l L o w O R
L d h E L l O W
O R l D H E L l
O w O
r L d
  • \$\begingroup\$ Missing Comma and ! \$\endgroup\$ – VoronoiPotato Mar 5 '14 at 19:44
  • \$\begingroup\$ @VoronoiPotato: works fine over here \$\endgroup\$ – marinus Mar 5 '14 at 20:44
  • \$\begingroup\$ whoops sorry :X \$\endgroup\$ – VoronoiPotato Mar 5 '14 at 20:50


Emulator at bbcbasic.co.uk

Split from my LOGO answer.

The easy way

The numbers on the right are just ASCII codes. This is just the same as printing. If I was allowed a comma I could do it on a single line (VDU 72,101,108,etc.)

   10 VDU 72
   20 VDU 101
   30 VDU 108
   40 VDU 108
   50 VDU 111
   55 VDU 44
   60 VDU 32
   70 VDU 87
   80 VDU 111
   90 VDU 114
  100 VDU 108
  110 VDU 100
  120 VDU 33

A more creative way

    5 MODE 6
   10 READ B
   12 WHILE B
   15   PROC1(B)
   16   PRINT
   17   READ B
   20 END

REM procedure prints first square on line, 
REM then calls itself recursively with A DIV 2 to print the next
REM VDU 17 tell VDU controller we want to change colour
REM Next line changes background colour. 
REM Then following line VDU 32 prints a space in that background colour.

  110 DEFPROC1(A)
  115 VDU 17
  125 VDU 32

REM binary bitmap data for each row, least significant at left
  150 DATA 463221
  160 DATA 332053
  170 DATA 332151
  180 DATA 332053
  190 DATA 2586485
  200 DATA 1048576
  210 DATA 4395895
  220 DATA 4527447
  230 DATA 4526935
  240 DATA 333143
  250 DATA 4420981
  260 DATA 0

enter image description here



And they said that it couldn't be done... No assignment operators, no concatenators, no quotes! Arghhhh!

Fear not... For the force is with you...

function w(x){

Output (on browser screen): Hello, World!
  • \$\begingroup\$ He said "Bonus if you can do it in Java" not Javascript. \$\endgroup\$ – Almo Mar 7 '14 at 18:39
  • 1
    \$\begingroup\$ @Almo I wasn't aiming to do it in Java... I was focussing on JavaScript, which is my main strength here on this site... \$\endgroup\$ – WallyWest Mar 7 '14 at 19:22
  • \$\begingroup\$ But you said "And they said that it couldn't be done" which I thought was referring to the puzzle stating bonus for doing it in Java. Many people still confuse Java with Javascript. \$\endgroup\$ – Almo Mar 7 '14 at 19:23
  • \$\begingroup\$ @Almo, I was just using a general saying... And when I refer to "Javascript", I intend to use JavaScript... Trust me, I wasn't planning on going for a bonus... \$\endgroup\$ – WallyWest Mar 7 '14 at 19:28


DC is just about the perfect tool for the job.


DCs P-command pops one number from the stack and outputs its raw computer representation to STDIO. Seeing as 5735816763073854918203775149089 = 0x48656C6C6F2C20576F726C6421, which is represented as 0x21, 0x64, 0x6C... = 'H', 'e', 'l'... in a little-endian architecture, it outputs Hello, World!.

  • \$\begingroup\$ How does this work? Would you mind adding an explanation? \$\endgroup\$ – wec Mar 7 '14 at 17:52
  • 1
    \$\begingroup\$ Not at all. An explanation will be added shortly. \$\endgroup\$ – Fors Mar 7 '14 at 17:55
  • 2
    \$\begingroup\$ +1. You could do it in hex to save a few chars: 16i48656C6C6F2C20576F726C6421P \$\endgroup\$ – Digital Trauma Mar 7 '14 at 19:12


Alphanumeric only solution:

prin quote Hello prin add space 12 prin space prin quote World print add space 1

Above is an update which uses Dr Rebmu excellent suggestion of add space 1 (which produces !) to get to all the characters.

Below is the original version:

prin quote Hello prin pick mold system 264 prin space prin quote World print pick mold system 12

Shorter version with brackets:

print rejoin [quote Hello pick mold system 264 space quote World pick mold system 12] 

And even shorter version with braces:

print join {Hello} join pick mold system 264 join { World} pick mold system 12

And shortest version with both brackets & braces:

print rejoin [{Hello} pick mold system 264 { World} pick mold system 12]

Rebol uses braces {} for multi-line quoting. So completely valid under rule changes but not quite in full spirit (IMHO) as my first two answers above.

NB. Printing the ! was a pain!

Rebol allows and uses punctuation characters routinely for function names and datatypes. So options like to-char 33 or to char! 33 would not be allowed under the rules (even though these punctuations are not operators par se).

Fortunately I found a cheeky way by turning the Rebol system object: make object! [...] into a string and cherry pick that ! from it :)

Update: And now also cherry picked comma from license text in system object.

  • 1
    \$\begingroup\$ ! is not allowed \$\endgroup\$ – grovesNL Mar 5 '14 at 20:19
  • 2
    \$\begingroup\$ @grovesNL - Solution no longer uses - or ! so you may now remove the down vote \$\endgroup\$ – draegtun Mar 5 '14 at 21:12
  • 1
    \$\begingroup\$ You are missing the comma \$\endgroup\$ – mniip Mar 6 '14 at 12:14
  • 1
    \$\begingroup\$ @mniip - Thanks missed that! Have now fixed. \$\endgroup\$ – draegtun Mar 6 '14 at 12:32
  • 1
    \$\begingroup\$ Pretty tricky, but you could have just added to space to get the characters... ;-) See the Rebmu solution, which clocks in at 46 chars... \$\endgroup\$ – HostileFork says dont trust SE Apr 6 '14 at 23:33


Uses only alphanumeric characters, spaces and braces {}, brackets [] and parenthesis ().

        if(printf((long long []){0x202c6f6c6c6548}))
                if(printf((long long []){0x21646c726f57})){}

printf( ) accepts a char * as an argument, but since we can't use quotes("), I typecast the string as a long long array. The values seen here are ASCII strings, in little endian (0x48=H, 0x65=e, 0x6c=l, and so on). I typecast it to long long [] since that way I can pass an 8-byte argument and hence use only two printf( ) calls instead of four.

  • \$\begingroup\$ This breaks rule #1 \$\endgroup\$ – Timtech Mar 7 '14 at 21:31
  • 1
    \$\begingroup\$ Chars, numbers, spaces and {} () [] are allowed. \$\endgroup\$ – pank4j Mar 8 '14 at 3:13
  • \$\begingroup\$ you can cast an int literal to array? I've never seen this before \$\endgroup\$ – phuclv Mar 10 '14 at 5:48
  • \$\begingroup\$ What does this do ? \$\endgroup\$ – Nicolas Barbulesco May 24 '14 at 8:54
  • \$\begingroup\$ @LưuVĩnhPhúc Array is a pointer. Pointer is an integer. \$\endgroup\$ – seequ Jun 5 '14 at 6:17


Print[Hello FromCharacterCode[44] world FromCharacterCode[33]]
  • \$\begingroup\$ Haha, clever. Very nice! \$\endgroup\$ – Jonathan Van Matre Mar 6 '14 at 4:37
  • 1
    \$\begingroup\$ Are the square brackets allowed? \$\endgroup\$ – Michael Stern Apr 7 '14 at 14:24
  • \$\begingroup\$ What is the output ? \$\endgroup\$ – Nicolas Barbulesco May 24 '14 at 8:32
  • 1
    \$\begingroup\$ Isn’t a space missing ? \$\endgroup\$ – Nicolas Barbulesco May 24 '14 at 8:32


Update: Managed to cut a bunch of characters by introducing a World function as well.

Another Javascript solution that writes to console.log:

function World() { with (World) return name }
function Hello() {}
with (console)
with (String)
with (Hello)
with (name)
with (concat(fromCharCode(44)))
with (concat(fromCharCode(32)))
with (concat(World()))

Inspired by this entry.

First, I define functions named Hello and World. This will be used later on.

Then I start my chain of nested withs. The with (console) and with (String) are used so that I can later on invoke console.log and String.fromCharCode without using a dot.

The plan is now to build the string Hello, World! by abusing nested withs. Each time I invoked concat(), the resulting string will be the context in the next with-block. I take a short cut to quickly get "Hello" by accessing the name property of the Hello function. Then I concatenate the comma and space characters by using String.fromCharCode.

The next trick is to get the "World" part of the string. I cannot use the same method I used to get Hello, since I cannot invoke World.name. Instead I put that logic inside the World method, and invoke it.

Finally, I append the final exclamation mark and send the result right to the log function, which is of course console.log.



import antigravity 

causes "Hello, world!" to appear on your screen. Don't believe me? Try it out for yourself! Also, this doesn't actually use the web, it opens a browser, that might lookup a website.

  • 1
    \$\begingroup\$ I have a 768-pixels height screen, so "Hello, world!" doesn't appear on my screen. \$\endgroup\$ – Olivier Grégoire May 16 '14 at 12:57
  • 1
    \$\begingroup\$ This does not write "Hello, world!" anywhere in my field of vision. But this opens xkcd.com/353/ in Safari ! \$\endgroup\$ – Nicolas Barbulesco May 24 '14 at 9:33
  • \$\begingroup\$ I am not using the Web now. I am writing in a browser, that might connect to a Web site. \$\endgroup\$ – Nicolas Barbulesco May 24 '14 at 9:46
  • \$\begingroup\$ sciyoshi.com/2008/12/import-antigravity The code requires Python 3 to appear but will not run in Python 3 (unless that has been backported). \$\endgroup\$ – March Ho Feb 8 '15 at 16:07


In a modern Perl (5.10 or newer):

print q{Hello} and print chr 44 and print q{ World} and say chr 33

In older Perl:

print q{Hello} and print chr 44 and print q{ World} and print chr 33 and print chr 10

Both solutions above use Perl q quote-like operator and allows selective delimiters for quoting a string, for eg. q{} q[] q() q//

This solution requires the rule change that allows braces, brackets or parens. So while totally valid I think mniip excellent Perl answer is more in the true spirit of the rules (+1).

However taking a leaf out of mniip answer my solution could be written like so:

print q xHellox and print chr 44 and print q x Worldx and say chr 33

and while harder on the eye it does work.

  • 1
    \$\begingroup\$ You are missing the comma \$\endgroup\$ – mniip Mar 6 '14 at 10:53
  • 1
    \$\begingroup\$ @mniip - Thanks again. Have now added missing comma. \$\endgroup\$ – draegtun Mar 6 '14 at 12:40
  • \$\begingroup\$ Looks like AppleScript without the verbosity \$\endgroup\$ – Ming-Tang May 17 '14 at 23:51
  • \$\begingroup\$ On my Mac, the first and third Perl lines do not work, only the second Perl line works. I have Perl 5.16.2. \$\endgroup\$ – Nicolas Barbulesco May 24 '14 at 9:16
  • \$\begingroup\$ syntax error at -e line 1, near "say chr" \$\endgroup\$ – Nicolas Barbulesco May 24 '14 at 9:21


print chr hex for qw z48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21z

dc, (26 bytes for the golfers)

Whitespace and [] brackets are now allowed:

[Hello]n44P[ World]n33P[]p


$ dc <<< "[Hello]n44P[ World]n33P[]p"
Hello, World!


Pfff, who needs the numeric part of alphanumeric?

from string import lowercase
from string import uppercase
from string import punctuation
print uppercase[len(str([[[len(str())]]]))]
print lowercase[len(str([[]]))]
print lowercase[len(str([[[[[len(str())]]]]]))]
print lowercase[len(str([[[[[len(str())]]]]]))]
print lowercase[len(str([[[[[[[]]]]]]]))]
print punctuation[len(str([[[[[len(str())]]]]]))]
print uppercase[len(str([[[[[[[[[[[]]]]]]]]]]]))]
print lowercase[len(str([[[[[[[]]]]]]]))]
print lowercase[len(str([[[[[[[[len(str())]]]]]]]]))]
print lowercase[len(str([[[[[len(str())]]]]]))]
print lowercase[len(str([len(str())]))]
print punctuation[len(str())]

This is locale-dependant, so your milage may vary. However, if you really want to replicate this result, you could use the following instead of the import statements:


(this is not part of my submission, it's just sharing my locals for recreatability)


Rebmu, 46 characters


Strongly parallels @dragetun's solution in Rebol (Because Rebmu is a Rebol/Red teaching tool which is a "dialect" that aims to draw attention to the languages by rocking at Code Golf. :-P)

However, to get the missing characters, I did something more obvious. I just added to space, instead of going and looking through system strings. You can get add space 1 to get character literal #"!" and add space 12 to get character literal #",".

If we run this we can see it get "unmushed":

>> rebmu/debug/stats "pnUPPqHELLO01pnADsp12pnSPpnUPPqWORLD01prADsp01"
Original Rebmu string was: 46 characters.
Rebmu as mushed Rebol block molds to: 46 characters.
Unmushed Rebmu molds to: 62 characters.
Executing: [pn upp q hello 1 pn ad sp 12 pn sp pn upp q world 1 pr ad sp 1]
Hello, World!

Which is fairly logial:

; print with no newline the result of doing an uppercase/part
; on the quoting of the symbolic word hello, of only the first
; N characters (where N is 1)
pn upp q hello 1

; print the character you get when you add 12 to the space
; character literal, a.k.a. comma...again no newline
pn ad sp 12

; print a space, no newline
pn sp

; do the same trick of printing the quoted word hello with the
; first letter converted to uppercase
pn upp q world 1

; print the character you get when you add 1 to the space
; character literal, a.k.a. exclamation point...with newline now
pr ad sp 1


Okay, we can use whitespace. It uses only Space, Tab, LineFeed and ignores any other characters.


With comment: S, T or L means Space, Tab or LineFeed respectively.

S S S T S S T   S S S L
T   L
S S S S S T T   S S T   S T L
T   L
S S S S S T T   S T T   S S L
T   L
S S S S S T T   S T T   S S L
T   L
S S S S S T T   S T T   T   T   L
T   L
S S S S S T S T T   S S L
T   L
T   L
S S S S S T T   T   S T T   T   L
T   L
S S S S S T T   S T T   T   T   L
T   L
S S S S S T T   T   S S T   S L
T   L
S S S S S T T   S T T   S S L
T   L
S S S S S T T   S S T   S S L
T   L
S S S S S T S S S S T   L
T   L

With highlighting: http://en.wikipedia.org/wiki/Whitespace_(programming_language)#Sample_code


T-SQL, 52

Ah, this is better! Direct binary conversion, only 52 characters.

SELECT CAST(0x48656C6C6F2C20576F726C6421 AS VARCHAR)


There's a much cleverer and golfier solution to this that would work if we could use = and + (Looking up standard built-in data in msdb and using that to construct an EXEC-able query string)

But since we can't, you get this naive approach:

  • 1
    \$\begingroup\$ I know, the lack of concatenation operators is killing me... I'm trying to think of a way to do it with JavaScript... \$\endgroup\$ – WallyWest Mar 5 '14 at 21:37
  • 1
    \$\begingroup\$ Yeah, although this challenge seems to produce mostly naive answers, it has definitely inspired some interesting brain-twisting to try to find interesting non-concatenative approaches. \$\endgroup\$ – Jonathan Van Matre Mar 5 '14 at 21:46
  • \$\begingroup\$ You can do better. Use PRINT rather than SELECT. And implicitly cast with LTRIM() or RTRIM(). I do something similar here. \$\endgroup\$ – Muqo Sep 24 '14 at 1:23


So updated. Much wat.

def wat(i) { print i
def wat(int i) { wat i as char }
def getProperty(String p) { p }
wat Hello wat 44 wat 32 wat World wat 33

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