# “Hello, World!”

So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with , and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.

Furthermore, while all of Wikipedia (the Wikipedia entry has been deleted but there is a copy at archive.org ), esolangs and Rosetta Code have lists of "Hello, World!" programs, none of these are interested in having the shortest for each language (there is also this GitHub repository). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest "Hello, World!" programs (similar to how our basic quine challenge contains some of the shortest known quines in various languages). So let's do this!

## The Rules

• Each submission must be a full program.
• The program must take no input, and print Hello, World! to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.
• The program must not write anything to STDERR.
• If anyone wants to abuse this by creating a language where the empty program prints Hello, World!, then congrats, they just paved the way for a very boring answer.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

• Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.
• This is not about finding the language with the shortest "Hello, World!" program. This is about finding the shortest "Hello, World!" program in every language. Therefore, I will not mark any answer as "accepted".
• If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf - these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.

For inspiration, check the Hello World Collection.

## The Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

## Language Name, N bytes


where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

## Ruby, <s>104</s> <s>101</s> 96 bytes


If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

## Perl, 43 + 2 (-p flag) = 45 bytes


You can also make the language name a link which will then show up in the snippet:

## [><>](https://esolangs.org/wiki/Fish), 121 bytes


/* Configuration */

var QUESTION_ID = 55422; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.

/* App */

return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(a) {
var id = +a.share_link.match(/\d+/);
});
if (!data.has_more) more_answers = false;
comment_page = 1;
}
});
}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(c) {
if (c.owner.user_id === OVERRIDE_USER)
});
else process();
}
});
}

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
return a.owner.display_name;
}

function process() {
var valid = [];

var body = a.body;
if(OVERRIDE_REG.test(c.body))
body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
});

var match = body.match(SCORE_REG);
if (match)
valid.push({
user: getAuthorName(a),
size: +match[2],
language: match[1],
});
else console.log(body);
});

valid.sort(function (a, b) {
var aB = a.size,
bB = b.size;
return aB - bB
});

var languages = {};
var place = 1;
var lastSize = null;
var lastPlace = 1;
valid.forEach(function (a) {
if (a.size != lastSize)
lastPlace = place;
lastSize = a.size;
++place;

.replace("{{NAME}}", a.user)
.replace("{{LANGUAGE}}", a.language)
.replace("{{SIZE}}", a.size)

var lang = a.language;
lang = jQuery('<a>'+lang+'</a>').text();

languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
});

var langs = [];
for (var lang in languages)
if (languages.hasOwnProperty(lang))
langs.push(languages[lang]);

langs.sort(function (a, b) {
if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
return 0;
});

for (var i = 0; i < langs.length; ++i)
{
var language = jQuery("#language-template").html();
var lang = langs[i];
language = language.replace("{{LANGUAGE}}", lang.lang)
.replace("{{NAME}}", lang.user)
.replace("{{SIZE}}", lang.size)
language = jQuery(language);
jQuery("#languages").append(language);
}

}
body {
text-align: left !important;
display: block !important;
}

width: 290px;
float: left;
}

#language-list {
width: 500px;
float: left;
}

font-weight: bold;
}

table td {
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
<h2>Shortest Solution by Language</h2>
<table class="language-list">
<tr><td>Language</td><td>User</td><td>Score</td></tr>
<tbody id="languages">

</tbody>
</table>
</div>
<tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>

</tbody>
</table>
</div>
<table style="display: none">
</tbody>
</table>
<table style="display: none">
<tbody id="language-template">
</tbody>
</table>

• @isaacg No it doesn't. I think there would be some interesting languages where it's not obvious whether primality testing is possible. – Martin Ender Aug 28 '15 at 13:56
• If the same program, such as "Hello, World!", is the shortest in many different and unrelated languages, should it be posted separately? – aditsu quit because SE is EVIL Aug 28 '15 at 15:33
• @mbomb007 Well it's hidden by default because the three code blocks take up a lot of space. I could minify them so that they are a single line each, but I'd rather keep the code maintainable in case bugs come up. – Martin Ender Aug 28 '15 at 19:34
• @ETHproductions "Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge." Publishing the language and an implementation before posting it would definitely be helpful though. – Martin Ender Aug 29 '15 at 23:01
• @MartinEnder ... Almost. If two BF solutions have the same size, the one with smaller lexicographical order will take smaller number of bytes in Unary. Of course the smallest Unary solution translated to BF is guaranteed to be smallest. – user202729 May 20 '18 at 10:20

# ><>, 23 bytes

"!dlroW ,olleH"l?!;oe0.


><>, or "Fish", is a 2D stack-based language like Befunge. Here's the breakdown:

[setup]

"                    Start string parsing
!dlroW ,olleH        Push each of these chars one-by-one onto the stack
"                    Stop string parsing

[main loop]

l?!;                 If the length of the stack is 0, halt
o                    Otherwise, output the top of the stack as char
e0.                  Jump back to just before the l


# Cubix, 31 29 bytes

Saved 2 bytes thanks to @MartinBüttner

./v.o;@?/"!dlroW"S',u/"Hello"


I proudly present Cubix, my new 2-dimensional, stack-based esolang. Cubix is different from other 2D langs in that the source code is wrapped around the outside of a cube.

Test it online! You can now adjust the iteration speed if you want it to run faster or slower.

## Explanation

The first thing the interpreter does is figure out the smallest cube that the code will fit onto. In this case, the edge-length is 3. Then the code is padded with no-ops . until all six sides are filled. Whitespace is removed before processing, so this code is identical to the above:

      . / v
. o ;
@ ? /
" ! d l r o W " S ' , u
/ " H e l l o " . . . .
. . . . . . . . . . . .
. . .
. . .
. . .


Now the code is run. The IP (instruction pointer) starts out on the top left char of the far left face, pointing east. Here's an overview of the basic commands:

• \|/_ are mirrors, and reflect the IP depending on the direction it's traveling.
• >v<^ set the direction of the IP unconditionally.
• ? turns the IP right if the top item is positive, or left if it's negative.
• ' pushes the char code of the next char.
• " toggles string mode, performing ' on each char until the IP encounters another ".
• o outputs a char code.
• ; pops an item.
• @ ends the program.

The first char we encounter is ", which toggles string mode. Each char code is pushed to the stack until we run into the next ". Then we push a space with S, and a comma with ',. The stack now contains !dlroW ,.

Next we hit u, which turns the IP right, then right again before executing the next instruction. The IP is now at the far right of the fifth row in the above diagram, facing west. Now the IP executes "olleH", making the stack !dlroW ,olleH. The / points the IP south, where it travels through the bottom row of the bottom face, back up to the S (which adds an extra space), and finally hits the v.

Now the IP is in what I call the "output loop". First it moves down and hits the ;, which turns pops the unnecessary space. Then it hits the ?, which directs it through o to output, bounces back around to ; to pop the char, then comes back to ?.

This repeats until the stack is empty. Then, since the top of the stack is no longer truthy, ? leaves the IP headed north. The next char is @, which terminates the program.

I'm not sure if this program is optimal; there's four two no-ops which could probably be put to better use. Martin and I will keep looking to find a better solution.

# Fission, 17 bytes

R"Hello, World!";


or

;"!dlroW, olleH"L


or any cyclic permutation of the two. In Fission, we need the R or L to release an atom and get control flow going. " toggles print mode, which just prints everything encountered until switched off. Finally ; destroys the atom to avoid an infinite loop.

# Fortran, 28 bytes

print'("Hello, World!")'
end


You can't write print*,"Hello, World!" because there's a leading space in the default print format. Thus, we pass in our own format that simply contains a constant string.

• Which version of Fortran is this? In F77 you'd need some spacing if I'm not mistaken. – Robert Benson Jul 19 '16 at 12:37
• @RobertBenson F77 would also require fixed form if I'm not mistaken. In any case, this works in GFortran. tio.run/##S8svKilKzNNNT4Mw/v8vKMrMK1HXUPJIzcnJ11EIzy/… – Dennis Jun 6 '17 at 6:24
• Yes, F77 is fixed format, so you'd need some tabs, which adds to byte-count :( – Robert Benson Jun 7 '17 at 15:10
• GFortran: print*,"Hello, World!";end 26 bytes, but it prefixes a space char :( – roblogic Aug 27 '19 at 9:55

# gs2, 2 bytes

\x12h


where \x12 is a raw byte.

# Z80Golf, 19 bytes

00000000: 674a 4343 4003 0f78 405d 434b 0e76 7e23  gJCC@..x@]CK.v~#
00000010: e5ee 2f                                  ../


Try it online!

Z80Golf is, essentially, a Z80 machine hooked up to $8000=putchar and $8003=getchar. The source code is a binary copied to $0000 (all other memory is zeroed out, just like the registers); execution starts there and runs until a halt instruction. It was designed by mokehehe on anarchy golf for code golf competitions there, but seems to have fallen into disuse. It's really fun to golf in, but excelling in it requires a pretty thorough understanding of the Z80 chip (that I myself don't even have, but some golfers like kodera and *yuko* do, and every solution they write is very clever.) A naïve Hello, World! program might look like this: start: ld a, (ix+hello) or a jr nz, okay halt okay: call$8000  ; putchar
inc ix
jr start
hello:
db "Hello, World!"


It assembles into a 27 byte binary. It even cheats a little bit: we don't need to explicitly zero-terminate the string "Hello, World!" ourselves, as all the memory past our source code is zeroed already. And it's still a fair bit longer than our 19-byte solution.

So how does the 19-byte solution work?

It doesn't look much like a Hello, World! program when disassembled:

  ld h,a
ld c,d
ld b,e
ld b,e
ld b,b
inc bc
rrca
ld a,b
ld b,b
ld e,l
ld b,e
ld c,e
ld c,0x76
ld a,(hl)
inc hl
push hl
xor 0x2f


We can look at the program in a slightly more revealing manner.

  db 47 ^ 'H'  ; 67  ld h, a
db 47 ^ 'e'  ; 4a  ld c, d
db 47 ^ 'l'  ; 43  ld b, e
db 47 ^ 'l'  ; 43  ld b, e
db 47 ^ 'o'  ; 40  ld b, b
db 47 ^ ','  ; 03  inc bc
db 47 ^ ' '  ; 0f  rrca
db 47 ^ 'W'  ; 78  ld a, b
db 47 ^ 'o'  ; 40  ld b, b
db 47 ^ 'r'  ; 5d  ld e, l
db 47 ^ 'l'  ; 43  ld b, e
db 47 ^ 'd'  ; 4b  ld c, e
db 47 ^ '!'  ; 0e  ld c,
halt         ; 76        $76 ld a, (hl) inc hl push hl xor 47 ; 32749 nop instructions, and then: ; putchar(A) ; ret  Whenever the PC becomes $8000, Z80Golf is programmed to write the byte in register A to STDOUT, and then effectively execute a ret (the PC is set to (SP) and SP is incremented by 2). In our code, instead of using call $8000 to access this behavior, we let the PC wade through a sea of nops (opcode 00) from $0013 to $7fff. Keeping this in mind, the code will run as follows: • Execute some meaningless instructions (effectively NOPs), starting from ld h,a. • Set A to mem[0] ^ 47, which is 'H'. • Increment HL and push it ($0001).
• Fall through to putchar, and return to the $0001 we pushed. • Execute some meaningless instructions, starting from ld c,d this time. • Set A to mem[1] ^ 47, which is 'e'. • Increment HL and push it ($0002).
• Fall through to putchar, and return to the $0002 we pushed. • Set A to mem[12] ^ 47, which is '!'. • Fall through to putchar, and return to the $000d we pushed.
• We finally jump into the argument of the ld c, $76 — and $76 is the halt opcode!

Of course, the constant 47 was carefully picked so that none of the first instructions 13 influence the execution of the code, and the last one is some opcode that takes a single-byte argument, “hiding” the halt opcode until we jump there after printing '!'.

# BBC BASIC, 20 bytes

PRINT"Hello, World!"


Ahh, this was my first language :)

• so BBC Basic does not accept ? as a shorhand for print? – edc65 Aug 28 '15 at 14:27
• @edc65 I have no idea... I'll try – Beta Decay Aug 28 '15 at 14:28
• @edc65 It doesn't work in BBC BASIC for Windows – Beta Decay Aug 28 '15 at 14:53
• Strange, as it's quite standard in basic. A posted an answer as VBA – edc65 Aug 28 '15 at 14:59
• @edc65, The "?" is NOT accepted, seems it conflicts with BBC Basic's PEEK() variant. But this is: P."Hello, World!" – user3710044 Mar 19 '17 at 8:31

# PDP-11 (Unix) Assembly, 33 38 bytes

Source (No trailing newline required):

sys 4;10;15;sys 1;<Hello, World!>


Binary output:

0000000 000407 000026 000000 000000 000000 000000 000000 000000
0000020 104404 000010 000015 104401 062510 066154 026157 053440
0000040 071157 062154 000041 000000 000000 000000 000000 000000
0000060 000000 000000 000000 000000 000000 000000
0000074


The output is zero-padded to 60 bytes for some reason, but I know enough about the architecture to know that it doesn't matter and can be considered 38 (maybe 37) bytes. Unfortunately, while this works on the terminal, it actually prints to STDIN.

So, a correct program (I believe it exits with status 1, but that's not important) is:

5200;sys 4;12;15;sys 1;<Hello, World!>


That 5200 in the beginning is actually an "inc r0" instruction, but writing it in octal is shorter. Coincidentally, the length of this source code is also 38 bytes.

0000000 000407 000030 000000 000000 000000 000000 000000 000000
0000020 005200 104404 000012 000015 104401 062510 066154 026157
0000040 053440 071157 062154 000041 000000 000000 000000 000000


Output clocks in at 20 non-zero words, or 39 non-zero bytes, and this time the assembler doesn't insert quite as much padding so the actual output file size is 48 bytes.

Unobfuscated source for the same program:

inc r0
sys write; 0f; 13.
sys exit
0: <Hello, World!>


If you actually assemble this source the output has an extra nonzero byte (value 2) in the second-last word of the output, probably something to do with the fact that named symbols were used for the system calls.

• So is your answer optimized for short machine code, or for short source? Or both? Maybe post two header lines, one for the machine-code count and one for the asm source count? – Peter Cordes Apr 13 '18 at 0:52

# Sed, 14 bytes

I'm hoping the sed exemption from no-input-rules applies here. If so, we can do:

cHello, World!


All that is required as input is one empty line.

• cHello, World! – Mitch Schwartz Aug 28 '15 at 18:28
• @MitchSchwartz excellent - I've never used the c sed command before - thanks! – Digital Trauma Aug 28 '15 at 18:56
• Something like sed -e 'cHello, World!' <<<'' – F. Hauri Dec 9 '18 at 13:41

# GNU Make, 27

$(info Hello, World!) a:;@:  • You can stick these two lines together, in either order, on one line to eliminate one more char. – user3710044 Mar 19 '17 at 8:48 # Carrot (version: ^3), 13 bytes Carrot is a language of Κριτικσι Λίθος. The syntax is stack^commands, where the stack is a string, and the interpreter outputs everything that's on the stack at the end of the program. The carrot is optional if you have no commands. Hello, World!  In version ^, the carrot wasn't optional yet if you had no commands, so then it was 14 bytes: Hello, World!^  • – Addison Crump Nov 1 '15 at 18:11 • Write the version number as "^". – user41805 Nov 2 '15 at 5:51 • @ΚριτικσιΛίθος Sure! Done. – ProgramFOX Nov 2 '15 at 6:40 • Version ^3 makes the ^ optional is you do not want to use any commands. Thus this can be shortened down by one byte. – user41805 Nov 3 '15 at 8:40 • @ΚριτικσιΛίθος Cool! Added that. – ProgramFOX Nov 3 '15 at 8:43 # VSL, 35 33 bytes Saved 2 bytes thanks to @ASCII-Only fn main(){print("Hello, World!")}  Try it online! Okay after over one year development, the day has come where I can post this :D There is a print("Hello, World!") function but this is shorter. As I seperate libc and libvsl this will probably have to switch over to print but for now this is the shortest. • Using fn can save two bytes – ASCII-only Apr 11 '18 at 3:16 # Javascript, 22 bytes alert("Hello, World!")  You don't NEED semicolons in Javascipt! • Don't you need them? – OldBunny2800 Apr 14 '16 at 21:19 • Apparently not for 1 liners (I don't know JS golfably) – Blue Apr 14 '16 at 21:21 • The JS interpreter will automatically insert them where it thinks they should be, if they aren't present – MayorMonty May 8 '16 at 22:54 • It does not print to stdout like the spec says – Valentin Lorentz Jun 1 '16 at 19:45 • @ValentinLorentz Javascript doesn't have a stdout - I used the nearest alternate; see Default for Code Golf: Input/Output methods – Blue Jun 1 '16 at 19:48 # C#, 85 67 bytes class P{static void Main(){System.Console.Write("Hello, World!");}}  I guess it cannot get worse. Did not even beat Java this time. • class P{static void Main(){System.Console.WriteLine("Hello, World!");}} -- 71 bytes. More golfing you must do young padawan. – Stephan Schinkel Aug 28 '15 at 13:36 • You don't need to specify the accessibility modifiers, C# will use defaults so you can remove both instances of public . You can also use the Write method on Console to save a few more bytes. – user20151 Aug 28 '15 at 13:36 • The newline in the output is optional, so use Write instead of WriteLine to save 4 bytes – SLuck49 Aug 28 '15 at 15:49 • Yeah, a lang of Microsoft is worse than Java! – Mega Man Jul 18 '16 at 18:23 # Pancake Stack, 1118 1073 bytes Put this supercalifragilisticexpialidociouseventhoughthesoundofitissomethingquite pancake on top! Show me a pancake! Put this floccinaucinihilipilification pancake on top! Put the top pancakes together! Show me a pancake! Put another pancake on top! Put this piquant pancake on top! Put the top pancakes together! Show me a pancake! Show me a pancake! Put another pancake on top! Put this big pancake on top! Put the top pancakes together! Show me a pancake! Put this osteosarchaematosplanchnochondroneuromuelous pancake on top! Show me a pancake! Put this kolmivaihdekilowattituntimittari pancake on top! Show me a pancake! Put the top pancakes together! Put this scrumptious pancake on top! Put the top pancakes together! Show me a pancake! Eat the pancake on top! Show me a pancake! Put this big pancake on top! Put the top pancakes together! Show me a pancake! Eat the pancake on top! Show me a pancake! Eat the pancake on top! Take off the syrup! Show me a pancake! Put this nonilfenossipolietilenossietonolo pancake on top! Show me a pancake! Eat all of the pancakes!  I've been avoiding this one because I haven't found a good way of golfing it yet, but here's a submission for now. The relevant operations are: Instruction Result -------------------------------------------------------------------------- Put this X pancake on top! Push word length of X to stack Eat the pancake on top! Pop and discard Put the top pancakes together! Add top two Put another pancake on top! Duplicate Show me a pancake! Print as ASCII without popping Take off the syrup! Decrement all stack values by 1 Eat all of the pancakes! Terminate program  If you take a look a Pancake Stack's full instruction set, you'll notice that you only ever have access to the top two stack elements at any time, which makes this language a pain to program in normally. That and the fact that you can only output as ASCII, i.e. no numeric output. Note that, if you're using the Python interpreter, you'll need an extra line with a ~ afterwards if you want to test by piping in a file. We don't use it here, but anything after the ~ is treated as normal STDIN input. # ???, 96 bytes ,;;..;...;.;,,,,;,,"......";...........-,'",-.";;,,,,!;...!;,!!...!;;;!-!-!-!...!,,,,,,!-,!;;;.!  Based on the 95-byte approach by Mitch Schwartz. Note that the 92-byte Brainfuck solution would yield 97 bytes in ???, because the sequential loops require four more apostrophes. • This is... wait, wrong challenge. – Dennis Aug 29 '15 at 4:38 • 80 bytes – ASCII-only Apr 12 '18 at 5:24 # Ziim, 1222 bytes In an unexpected turn of events, I'm counting this submission in UTF-16. ↘ ↓↘↘↘↘↙↓↘↘ ↙↓↘ ↓↘ ↙↘←↓ ↘↘↙↓↘↘↘↙↓↘↘↘↘↙↓↘↘↘↘↙↓ ↘↘↙↓↘↘↙↓↘ ↙ ↘ ↓↘ ↙↘←↓↘ ↙ ↘ ↓ ↘↘↙↓↘↘↙↓↘↘↘↘↙↓ ↘ ↙↘←↓↘ ↙ ↘ ↓ ↘ ↙ ↘ ↓↘↘↙↓↘↘↘↙↓↘↘↘↙↓↘↘ ↙↓↘←↓↘ ↙↓↘ ↓↘↘↙↓ ↘↘↙↓↘↘↙↓↘ ↙↘←↓↘ ↙↘←↓ ↘ ↙↘←↓ ↘↘↙↓↘↘↙↓ ↘ ↙ ↘ ↓↘↘ ↙ ↘ ↓↘ ↙↓↘← ↓→↘ ↑↑↓→↘ ↑↓ ↓→↘ ↓↓↓→↘↘ ↓→↘ ↑↓→↘ ↑↑↓→↘ ↑↑↓→↘↘ ↓→↘ ↓→↘ ↓↓↓↓→↘ ↓↓↓→↘ ↓↓↓↓→↘↘ ↓→↘ ↓→↘ ↑↑↓→↘↘ ↓↓↓→↘ ↓↓↓↓→↘↘ ↓↓↓↓→↘ ↓→↘ ↑↓→↘ ↑↓→↘ ↑↓ ↓→↘ ↓ ↓→↘ ↓→↘↘ ↓→↘ ↓→↘ ↓↓↓→↘ ↓↓↓→↘↘ ↓↓↓→↘↘ ↓→↘ ↓→↘↘ ↓↓↓↓→↘ ↑↓↓↓↓→↘ ↓ ↓→ ↗ ↑↖ ↗ ↑↖↗↑↗↗ ↑↗↗↗ ↑↑↗ ↑↖↗ ↑↖ ↗ ↑↖ ↗ ↑↑↗ ↑↗ ↑↗↗↗↗ ↑↗↗↗ ↑↗↗↗↗ ↑↑↗ ↑↗ ↑↖ ↗ ↑↑↗↗↗ ↑↗↗↗↗ ↑↑↗↗↗↗ ↑↗ ↑↖↗ ↑ ↗ ↑↖↗↑↗↗ ↑↗↑↗↗ ↑↗ ↑↑↗ ↑↗ ↑↗↗↗ ↑↗↗↗ ↑↑↗↗↗ ↑↑↗ ↑↗ ↑↑↗↗↗↗ ↑↖↗↗↗↗ ↑↗↑↗↗  Because the code snippet above will likely not render in a very readable manner for you (either because of missing characters, or because the diagonal arrows aren't as monospaced as they should be), here is an image of the solution. I've marked the concatenators where a new byte starts in red: Click for larger version Well, this is a bit embarrassing. I spent quite some time on this solution, and at 610 characters, it is 267 characters shorter than the one on the esolangs page. However, it contains a lot more arrows, and because those are 3 bytes in UTF-8, it's actually longer than the one on esolangs (1516 vs 1345). But because this solution is so dense and contains far more arrows than spaces, I'm actually saving bytes by using UTF-16 and counting each character as two bytes. Anyway, regardless of how we're counting, this is far from optimal. The above code is entirely linear, and builds one bit at a time. So I'm not reusing any bitstrings (like I could for the ls or os or even other substrings). I chose this approach because I wanted to start with something where it would be easier to pack the arrows very densely. If one used a more square layout, one could make use of a lot more repetition in the output (on a bit level), and thereby make massive savings. • Most 2d languages are generally scored by the area of the bounding box, why not do that here? – SuperJedi224 Jan 29 '16 at 17:31 • @SuperJedi224 [citation-needed]? I've never scored any 2D language like that and the only one which I've seen like that is Piet where I think that's not how we should do it. – Martin Ender Jan 29 '16 at 17:40 • I've definitely seen befunge and <>< scored that way before, and that's how I've generally been scoring BotEngine. – SuperJedi224 Jan 29 '16 at 17:56 • @SuperJedi224 if I saw that I would recommend changing it. Programs should be scored by the size of the source file and I don't know any 2D language that chokes on omitted trailing spaces. Plus, if a submission did use up the entire bounding box, you wouldn't be counting any bytes for the aspect ratio of the grid, which is also important information. – Martin Ender Jan 29 '16 at 18:11 # Foo, 14 bytes "Hello, World!  Not printing Hello World seems to be a lot harder in Foo that the opposite... Try it online! • Would s print Hello World? ;) – OldBunny2800 Apr 14 '16 at 21:18 • Probably. – Dennis Apr 14 '16 at 21:20 • If you find out, you might be able to golf it down to 0 or 1 byte! – OldBunny2800 Apr 14 '16 at 21:22 # Labyrinth, 4645 40 bytes 72.10:1.:8:..:):1:.#2#4..:1..4.:8.0.33.@  Try it online! Labyrinth is my new two-dimensional programming language (although the 2D'ness isn't really used here). Labyrinth operates on two stacks (although this code only uses one). Each character is a separate command. However, as opposed to most similar languages individual digits don't push that digit (which makes it annoying to build up larger numbers), instead they multiply the top of the stack by 10 before adding themselves. This allows you simply to write out the numbers you want to push. (Another language with this concept is Emmental.) The other commands you need to know for the above code are . which prints the top of the stack (modulo 256), : which duplicates the top of the stack, ) which increments it and # which pushes the current stack depth. @ terminates the program. There's only one tricky part: W is printed by appending a 1 to 111 (o), because 1111 % 256 = 87. Here is what the stack and output look like throughout the program: Command(s) Stack Output 72 [72] >< . >H< 10 [10] >H< : [10 10] >H< 1 [10 101] >H< . [10] >He< : [10 10] >He< 8 [10 108] >He< : [10 108 108] >He< .. [10] >Hell< : [10 10] >Hell< ) [10 11] >Hell< : [10 11 11] >Hell< 1 [10 11 111] >Hell< : [10 11 111 111] >Hell< . [10 11 111] >Hello< # [10 11 111 3] >Hello< 2 [10 11 111 32] >Hello< # [10 11 111 32 4] >Hello< 4 [10 11 111 32 44] >Hello< .. [10 11 111] >Hello, < : [10 11 111 111] >Hello, < 1 [10 11 111 1111] >Hello, < .. [10 11] >Hello, Wo< 4 [10 114] >Hello, Wo< . [10] >Hello, Wor< : [10 10] >Hello, Wor< 8 [10 108] >Hello, Wor< . [10] >Hello, Worl< 0 [100] >Hello, Worl< . [] >Hello, World< 33 [33] >Hello, World< . [] >Hello, World!< @  • This maybe could be golfed more if you allow the code to intersect itself. – TheNumberOne Aug 29 '15 at 14:24 • I really don't understand why "1111" is a "W". The ascii code for 'W' is 87. Can somebody explain this to me? – Robert Hickman May 25 '17 at 15:29 • Oh, I see the explanation in the description, but I wasn't aware that . did a % 256 before printing. – Robert Hickman May 25 '17 at 15:41 # ELF 32-bit LSB executable (Linux), 59 bytes 0000000: 7f 45 4c 46 01 00 00 00 00 00 00 00 00 90 43 0d .ELF..........C. 0000010: 02 00 03 00 19 90 43 0d 19 90 43 0d 04 00 00 00 ......C...C..... 0000020: b9 2e 90 43 0d b2 0d cd 80 cc 20 00 01 00 48 65 ...C...... ...He 0000030: 6c 6c 6f 2c 20 57 6f 72 6c 64 21 llo, World!  This exits with INT 3 (breakpoint), so your shell may display a message to indicate this. However, the program itself prints nothing to STDERR. Try it online! ### Verification $ cksum hw32
3205536342 59 hw32
$./hw32 Hello, World!Trace/breakpoint trap$ ./hw32 | cat; echo
Hello, World!
$./hw32 | xxd -g 1 0000000: 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 Hello, World!  • or echo$(./hw32) – F. Hauri Dec 9 '18 at 13:53

# LLVM IR 4.0.1, 149145 152 bytes

declare i8@puts(i8*)@t=global[14 x i8]c"Hello, World!\00"define void@main(){call i8(i8*)@puts(i8*getelementptr([14 x i8],[14 x i8]*@t,i1 0,i1 0))ret void}


I'm not very good in LLVM IR, so chances are good, that it's possible with fewer bytes.

Ungolfed Version:

declare i8 @puts(i8*) ; Declare puts from C standard. i8, was the shortest return type possible.

@t=global [14 x i8] c"Hello, World!\00" ; Hello world string as global, to have a pointer to it.

define void @main(){
call i8(i8*) @puts(i8* getelementptr([14 x i8], [14 x i8] *@t, i1 0, i1 0)) ; Get pointer to constant "Hello, World!" and pass it to puts
ret void
}

• would int main be smaller, with ret 0 instead of ret void? I don't know LLVM IR at all, really >.< – Peter Cordes Apr 13 '18 at 0:54

# Hexagony, 30 29 bytes

H;_e;r;2l.;P.QW;l/P1;@;0d;\o;


Try it online!

Source laid out:

    H ; _ e
; r ; 2 l
. ; P . Q W
; l / P 1 ; @
; 0 d ; \ o
; . . . .
. . . .


One more byte off!

Here's a crappy gif of the program in action.

Given there's 2 nops inside the program itself, I'm confidant this can be golfed by at least one more byte. I'm willing to offer a bounty for a smaller version.

### Old version:

H;e;r;0Pld;P_1;l;;o;Q\;W\;$2@\  Try it online! Source laid out:  H ; e ; r ; 0 P l d ; P _ 1 ; l ; ; o ; Q \ ; W \ ;$ 2
@ \ . . .
. . . .


Reuses the same tricks as Martin Ender's answer, i.e Q2 printed is the comma, P0 is the space, P1 is the bang, but manages to be 2 bytes shorter through clever mirroring to reuse several ;s and the o.

### Explanation:

Here's a coloured Hexagony grid to show the non-branching path that the pointer takes:

The executing code, ignoring mirrors, is:

H;e;l;;o;Q2;P0;W;d$;o;$2r;0Pl;Wd;P1;@


Filtering out the skipped instructions and the literals that are overwritten by other literals, we are left with:

H;e;l;;o;Q2;P0;W;o;r;l;d;P1;@


Which simply prints "Hello, World!"

After a few attempts, I gave up on a size 3 Hexagony answer. You need a minimum of 12 instructions out of 19 reserved for string literals, along with three ;s for printing and one @ for ending the program. This leaves only 3 spaces for IP management and memory management, provided you find the optimal path that reuses both the o and the l. From all this, I'll rule that a size 3 answer is impossible, though I'll give a sizable bounty to anyone who proves me wrong.

• I posted a shorter solution. – user202729 May 19 '18 at 13:55
• I came up with a 25-byte solution by hand - this will be my first answer here! I'm a bit miffed now to find this has already been beaten, albeit by brute force. Up until half an hour ago i thought Martin's original post was the only one for Hexagony. Still, my approach is different from the others. Hope to post soon although it may have to wait till Saturday when I get back from vacation and have access to my computer again. – Oliphaunt - reinstate Monica Aug 22 '18 at 20:29
• @Oliphaunt It's been a while, but I noticed you never posted your 25 byte solution. Do you still have it or remember it? – Jo King Sep 26 '19 at 2:51

# R, 20 bytes

cat("Hello, World!")


# Mouse, 19 bytes

"Hello, World"33!'$ Oddly enough, ! inside of a string makes a newline, so we have to work around that by getting the ASCII code for !, which is 33, and outputting that as a character. # Prelude, 38 bytes 92480969393782833909095806(^+^+^^+++!)  If you're using the Python interpreter, you'll need to make sure that NUMERIC_OUTPUT is set to False. Prelude is a relatively simple stack-based language, with 0-9 pushing the corresponding single digits and the only arithmetic being addition and subtraction. In particular, there is no multiplication. To make the most of the single digit pushing behaviour, I took a look at the code points in various bases. For base 12, we get this: [[6 0] [8 5] [9 0] [9 0] [9 3] [3 8] [2 8] [7 3] [9 3] [9 6] [9 0] [8 4] [2 9]]  Everything here is a single digit - that's perfect! This means that we can encode each character using two digits via base 12, e.g. H -> 72 (base 10) -> 60 (base 12). That's what the long string of 26 digits at the beginning is for. The back half of the code then needs to take each pair of digits a, b and give 12*a+b. But remember, Prelude doesn't have multiplication! What it does have, however, is ^ and v, which get the top stack values from the program rows ("voices") above and below. Since this is a one-line program, ^ effectively duplicates the top of the stack, allowing us to do ^+^+^^++ to multiply the top stack element by 12. We then add the second digit with + and output with !. All of this is wrapped in (), which is a BF-like loop which executes while the top stack element is nonzero. # Emotinomicon, 18 characters / 30 bytes Try it here. 😭!dlroW ,olleH😲⏪⏬⏩  Explanation: 😭 !dlroW ,olleH 😲 ⏪ ⏬ ⏩ explanation 😭 begin quote string !dlroW ,olleH 😲 end quote string ⏪ open loop ⏬ pops and outputs top of stack as character ⏩ close loop  # ELF 64-bit LSB executable (Linux), 104 bytes 0000000: 7f 45 4c 46 02 01 01 03 b0 04 b3 01 b2 0e eb 18 .ELF............ 0000010: 02 00 3e 00 01 00 00 00 08 00 40 00 00 00 00 00 ..>.......@..... 0000020: 30 00 00 00 00 00 00 00 b9 48 00 40 00 90 eb 30 0........H.@...0 0000030: 01 00 00 00 01 00 38 00 01 00 00 00 00 00 00 00 ......8......... 0000040: 01 00 40 00 00 00 00 00 48 65 6c 6c 6f 2c 20 57 ..@.....Hello, W 0000050: 6f 72 6c 64 21 0a 00 00 6f 72 6c 64 21 0a 00 00 orld!...orld!... 0000060: cd 80 b0 01 b3 00 cd 80 ........  This sets as many proper headers as possible without affecting the byte count, prints a trailing linefeed and exits cleanly with exit code 0. Try it online! ### Verification $ cksum hw64
3288151474 104 hw64
$file hw64 hw64: ELF 64-bit LSB executable, x86-64, version 1, statically linked, corrupted section header size$ ./hw64
Hello, World!
$echo$?
0

• Disassembly output of the code stuffed into the ELF headers would be nice, if you needed any special tricks to make instruction bytes also be valid ELF headers. (Future readers: see muppetlabs.com/~breadbox/software/tiny/teensy.html for more about this kind of hack.) – Peter Cordes Apr 13 '18 at 0:57
• O_o why is there an extra orld! – ASCII-only Apr 13 '18 at 4:55
• @ASCII-only The answer saves bytes by storing data in the ELF's program header. The longs at 0x50 and 0x58 encode the virtual and physical addresses of the segment, and they program segfaults if they do not match. – Dennis Apr 13 '18 at 5:26

# USML, 9 bytes

S0h7cWs8h


Try it online!

## Explanation:

S0h7cWs8h
S0h7       # Get characters 0-7 of h ("Hello, world!").
cW     # Get the character "W"
s8h  # Get the remaining characters, starting at character 8, of h.


This program is an interesting problem, as it has a command that outputs "Hello, world!" (and an empty program will also do this), but the capitalization is not correct. As a result, we need to take some substrings and add in the correct character.

• This is probably the first interesting use of a HW-built-in I've seen in this challenge. – Martin Ender Apr 8 '17 at 22:15

# Lost, 5654 45 bytes

Two bytes saved thanks to @MartinEnder

v<<<<<<<<<<>>>>>>>>>>>
>%?"Hello, WorldvU"-+@


Try it online!

## Explanation

This is now a bit outdated, I will try to update soon

Lost is a 2 dimensional language in which the start location and direction are entirely random. As you might imagine it is rather difficult to write deterministic programs in lost. However the language has a couple of design features that allow for deterministic programs to be written.

Here's how this one works:

I'll first give you some information on the operations in Lost that are important here, so you don't have to read the github. I will leave out the more obvious ones.

• @ exits, but only if the "safety" is off. The safety begins on.

• % turns the safety off.

• ? Pops the TOS and jumps if it is non-zero.

• ! jumps unconditionally.

• ( pops a value and saves it for later.

Ok now we are read to dive in.

The main code is the following line

"Hello, WorldvU"-+@


This pushes the string Hello, WorldvU, subtracts the U from the v to get a !, and then terminates the program (we assume the safety is off)

However we have to get to this program so we create a line of arrows to catch the randomly moving pointers

v<<<<<<<<<<<<<<<<<<<<
>%"Hello, WorldvU"-+@


We also add a % to turn the safety off once we have corralled the programs. We can now see that the v is in the string to redirect ips that start inside the string.

Now the problem is that some of the programs accumulate junk before we catch them, for example if you start on the 1 you might get a 1, or even worse if you start in the string going west you will get %>@+!(. So we add some code to clear the stack. >?!| should do the trick, and if we use the > from earlier we can save a byte.

v<<<<<<<<<<<<<<<<<<<<<<<
>%?!|"Hello, WorldvU"-+@


Now there is just one problem. If the program starts on ! going north or south, it will jump the stream back to itself and loop forever. To fix this we add a v below the !.

v<<<<<<<<<<<<<<<<<<<<<<<
>%?!|"Hello, WorldvU"-+@
v


Lastly I reversed some of the upper stream. This just makes the program a little faster, doesn't lose me any bytes so why not.

# INTERCAL, 285 bytes

DO,1<-#14
DO,1SUB#1<-#238
DO,1SUB#2<-#108
DO,1SUB#3<-#112
DO,1SUB#5<-#64
DO,1SUB#6<-#194