523
\$\begingroup\$

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 */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  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;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });  
}

getAnswers();

var SCORE_REG = (function(){
  var headerTag     = String.raw `h\d`
  var score         = String.raw `\-?\d+\.?\d*` // with negative/floating-point support
  var normalText    = String.raw `[^\n<>]*` // no HTML tag, no newline
  var strikethrough = String.raw `<s>${normalText}</s>|<strike>${normalText}</strike>|<del>${normalText}</del>`
  var noDigitText   = String.raw `[^\n\d<>]*`
  var htmlTag       = String.raw `<[^\n<>]+>`

  return new RegExp(
  String.raw  `<${headerTag}>`+
  String.raw    `\s*([^\n,]*[^\s,]),.*?`+
  String.raw    `(${score})`+
  String.raw    `(?=`+
  String.raw      `${noDigitText}`+
  String.raw      `(?:(?:${strikethrough}|${htmlTag})${noDigitText})*`+
  String.raw      `</${headerTag}>`+
  String.raw    `)`
  );
})();

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

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

function process() {
  var valid = [];
  
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      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],
        link: a.share_link,
      });
    
  });
  
  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;
    
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery('<i>' + a.language + '</i>').text().toLowerCase();
    
    languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link, uniq: lang};
  });

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

  langs.sort(function (a, b) {
    if (a.uniq > b.uniq) return 1;
    if (a.uniq < b.uniq) 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)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  float: left;
}

#language-list {
  padding: 10px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}
<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/primary.css?v=f52df912b654">
<div id="language-list">
  <h2>Winners by Language</h2>
  <table class="language-list">
    <thead>
      <tr><td>Language</td><td>User</td><td>Score</td></tr>
    </thead>
    <tbody id="languages">

    </tbody>
  </table>
</div>
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
    </thead>
    <tbody id="answers">

    </tbody>
  </table>
</div>

<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr>
  </tbody>
</table>

\$\endgroup\$
22
  • 4
    \$\begingroup\$ @isaacg No it doesn't. I think there would be some interesting languages where it's not obvious whether primality testing is possible. \$\endgroup\$ Commented Aug 28, 2015 at 13:56
  • 7
    \$\begingroup\$ If the same program, such as "Hello, World!", is the shortest in many different and unrelated languages, should it be posted separately? \$\endgroup\$ Commented Aug 28, 2015 at 15:33
  • 2
    \$\begingroup\$ @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. \$\endgroup\$ Commented Aug 28, 2015 at 19:34
  • 8
    \$\begingroup\$ @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. \$\endgroup\$ Commented Aug 29, 2015 at 23:01
  • 2
    \$\begingroup\$ @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. \$\endgroup\$
    – user202729
    Commented May 20, 2018 at 10:20

1002 Answers 1002

1
14 15
16
17 18
34
2
\$\begingroup\$

Arcyóu, 18 15 bytes

"Hello, World!"

Arcyóu is a LISP-like golfing language. Since this is the only thing in the program, we don't need a p function or even parentheses. Just quotes.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ No need for the disclaimer here. Newer languages are allowed and even encouraged this time. \$\endgroup\$ Commented Nov 22, 2015 at 15:11
2
\$\begingroup\$

AutoHotkey, 61 bytes

DllCall("AllocConsole")
FileAppend % "Hello, World!", CONOUT$

AHK was written to automate Windows tasks and it seems as if the authors considered StdOut/In as an after thought. This is the shortest method I could come up with. When executed the console will flash with Hello World! and exit immediately, it would require additional code (either adding a Hotkey or #persistent or sleep command) to keep the console active, however I feel this does the job and meets the requirements. I could also make the program with DLLCall("AttachConsole, Int, -1") so that it can be executed from the command line and write to the same console it was executed from, however this code golf.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Greetings from the future! I can't tell if this worked at the time but it works now and its 27 bytes: FileAppend,Hello`, World!,* \$\endgroup\$ Commented Apr 5, 2017 at 15:53
2
\$\begingroup\$

Hodor, 66 bytes

hodor.hod("Hhodor? Hodor!? Hodor!? o, Hooodorrhodor orHodor!? d!")

This only works in the previous version of Hodor (the one before the update from 1 July 2015). The latest version prints HODOR instead, which could be fixed at the cost of 3 bytes:

hodor.hod("Hhodor? Hodor!? Hodor!? o, Hooodorrhodor orHodor!? "+"d!")
\$\endgroup\$
0
2
\$\begingroup\$

TRANSCRIPT, 36 bytes

He is here.
>HE, Hello, World!
>X HE

The second line sets HE, and the third line outputs it.

\$\endgroup\$
3
  • \$\begingroup\$ I was initially going to post this, but for some reason I kept getting errors whenever I tried to use single-char NPC names... \$\endgroup\$
    – Sp3000
    Commented Sep 1, 2015 at 13:02
  • \$\begingroup\$ @Sp3000 You're right, I just looked at the interpreter and found that it only matches two-letter words or longer. \$\endgroup\$ Commented Sep 1, 2015 at 21:15
  • 1
    \$\begingroup\$ @LegionMammal978 You should use He. \$\endgroup\$
    – mbomb007
    Commented Sep 1, 2015 at 21:55
2
\$\begingroup\$

Seriously 0.1, 1 byte

H

Try it online

Yes, I made my language have a one-byte Hello World program. A less boring answer for 16 bytes:

"Hello, World!".

"Hello, World!" pushes that string onto the stack, and . pops the top value on the stack and prints it.

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

Par, 14 bytes

`Hello, World!

I don't know Par, but it looks golfy.

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

Templates Considered Harmful, 50 bytes

St<72,'e','l','l','o',44,32,87,'o',114,'l','d',33>

Templates Considered Harmful is a language defined by C++ templates. The St template creates a string of characters, which is then implicitly printed to STDOUT.

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

Jolf, 14 bytes

"Hello, World!

Records a string, implicit output. Try it here.


Jolf, 9 bytes, cheating

(unprintable chars replaced with ?):

e.$nsp#0?
e         evaluate as Jolf code
 .         from the object
  $   #     nsp, get
       0    property 0
        ? (08, backspace character; restrain implicit output)

nsp is an object on the interpreter page that contains example programs. The zeroth one is the Hello, World! program. Try it here.

\$\endgroup\$
2
  • \$\begingroup\$ This is a catalogue, is it not? Therefore, this answer is completely valid. \$\endgroup\$ Commented Dec 15, 2015 at 23:13
  • \$\begingroup\$ @SuperJedi224 Indeed, yes. Fixing. \$\endgroup\$ Commented Dec 15, 2015 at 23:14
2
\$\begingroup\$

Eodermdrome, 18 bytes

al(Hello, World!)a

Replaces the a - l edge on the initial graph with the a node, and outputs Hello, World! in the process.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Hi, your program works, but not for the reason you think - it actually matches the o-g edge, because the l in your program must represent a node with only one outgoing edge. \$\endgroup\$ Commented Apr 18, 2017 at 1:41
2
\$\begingroup\$

BASIC-80, 16 bytes

BASIC-80 aka MBASIC does not need a trailing " to end string constants at the end of the line, so...

1?"Hello, World!

...is all you need.


CP/M nostalgia...

A>mbasic
BASIC-80 Rev. 5.21
[CP/M Version]
Copyright 1977-1981 (C) by Microsoft
Created: 28-Jul-81
32824 Bytes free
Ok
1?"Hello, World!
run
Hello, World!
Ok
system
A>_
\$\endgroup\$
2
\$\begingroup\$

ROOP, 17 bytes

"Hello, World!"
h

At the beginning an object is created with the string that is in quotation marks, then the h operator prints all existing objects and ends the program.

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

X.so, 48 42 bytes

$A($Main("X"Include"Hello, World!"X.Show))

Requires XCore to run, so it can use the X.Show command.

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

Visual Basic.NET, 63 bytes

Module A
Sub Main
System.Console.Write("Hello, World!")
End Sub
End Module
\$\endgroup\$
2
\$\begingroup\$

JavaScript function golf, 19 bytes

p("Hello, World!");

I made this[1] for you!

JavaScript function golf is included into the language page HTML, so use it right from the console!

If you want it as an alert, here you are (21 byte):

p2a("Hello, World!");

That said, I finally got time for improvement of the framework.

[1]: I mean, the language golfing framework.

\$\endgroup\$
6
  • 2
    \$\begingroup\$ Welcome to PPCG. This is a good start for a Golfing language, however there a lot of features of JavaScript, like Prototypes, that you might want to take advantage of (e.g. 42.s() could turn a number into a string instead of i2s(42).) If you want help or tips, feel free to visit chat.stackexchange.com/rooms/27364/… for help, tips and showcasing your language. \$\endgroup\$
    – wizzwizz4
    Commented Jan 2, 2016 at 12:39
  • \$\begingroup\$ @wizzwizz4 thanks, but my real introduction to PPCG was a question. :P Also, I have still to learn about prototypes, and I'm not active enough to chat in the PPCG rooms. \$\endgroup\$
    – user48538
    Commented Jan 2, 2016 at 12:43
  • \$\begingroup\$ @wizzwizz4 42.s() is a syntax error in some js engines, you'd have to do (42).s() which doesn't actually save anything \$\endgroup\$ Commented Jan 2, 2016 at 14:49
  • \$\begingroup\$ @SuperJedi224 That was an example. :-P \$\endgroup\$
    – wizzwizz4
    Commented Jan 2, 2016 at 15:19
  • \$\begingroup\$ @zyabin101 You don't need much reputation to chat. \$\endgroup\$
    – wizzwizz4
    Commented Jan 2, 2016 at 15:19
2
\$\begingroup\$

Boo, 22 bytes

Quoting from https://github.com/bamboo/boo/raw/master/docs/BooManifesto.pdf:

The guys who came up with “public static void main” were probably kidding, the problem is that most people didn't get it was a joke. The infamous HelloWorld in all its boo glory:

print("Hello, World!")

“public static void main”, that was a good one!

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

Brachylog, 3 bytes

@Hw

@H is the string "Hello, World!", and w is the write predicate.

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

Jolf, 7 bytes

Try it here!

ξrμ\t\x0FΉ\x1B

ξ read three characters and interprets them as a base 256 number index in a gigantic word list. 'Nuff said.

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

Detour, 19 bytes

`u
@"Hello, World!"

Try it online!

This language was not designed with strings in mind.
"How do you fit a string literal into a 2D language represented on a grid of characters?"
You don't! Just put a `, and then define what the `'s stand for on the bottom with @ signs (sigh)! This will push all its code points to the ` cell, and the u cell will print it as a string

I'll try to come up with a shorter way to fit in strings later. At least it's not Java.

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

Gogh, 14 bytes

"Hello, World!

This one is pretty self-explanatory. Gogh has self-closing strings, so if there isn't a closing double-quote, it tacks one on the end and you have yourself a string.

You can run it from the command line like this:

$ ./gogh o '"Hello, World!'
\$\endgroup\$
2
\$\begingroup\$

NTFJ, 118 bytes

NTFJ is an esoteric programming language intended to be a Turing tarpit. It is stack-based, and pushes bits to the stack, which can be later coalesced to an 8-bit number. I believe that this is the optimal, using a loop. (Maybe something can be done by hard-coding @ into the string, which would allow for us to double the l. I haven't checked, but I believe this would come out as more bytes.)

Anyhow, this is the full code:

~~#~~~~#~##~~#~~~##~##~~~###~~#~~##~####~#~#~###~~#~~~~~~~#~##~~~##~####~##~##~~~##~##~~~##~~#~#~#~~#~~~@(*~##~#~~~@^)

Or, more readable:

~~#~~~~#~##~~#~~~##~##~~~###~~#~~##~####~#~#~###~~#~~~~~~~#~##~~~##~####~##~##~~~##~##~~~##~~
#~#~#~~#~~~@(*~##~#~~~@^)

All the ~s push 0 and the #s push 1. The interesting part is the output loop:

@(*~##~#~~~@^)
@              Coalesce to bit (top 8 items); is 0 on an empty stack
 (           ) Skip the inside if the top of the stack is not truthy.
  *            Output as character.
   ~##~#~~~@   Push 104 to the stack
            ^  Jump to index 104, which is right here --.
^._____________________________________________________/

The interpreter is here, but with no permalinks as of yet.

Boring Loop-less version, 130 bytes:

~#~~#~~~@*~##~~#~#@*~##~##~~@*~##~##~~@*~##~####@*~~#~##~~@*~~#~~~~~@*~#~#~###@*~##~####@*~###~~#~@*~##~##~~@*~##~~#~~@*~~#~~~~#@*

Doubling (:) the l character, 122 bytes:

~#~~#~~~@*~##~~#~#@*~##~##~~@:**~##~####@*~~#~##~~@*~~#~~~~~@*~#~#~###@*~##~####@*~###~~#~@*~##~##~~@*~##~~#~~@*~~#~~~~#@*
\$\endgroup\$
2
\$\begingroup\$

Scratch, 2 blocks

enter image description here

Self explanatory really.

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

Verilog, 60 bytes

module m;initial
begin
$write("Hello, World!");end
endmodule

Try it online here.

\$\endgroup\$
1
  • \$\begingroup\$ The initial block doesn't need begin & end. \$\endgroup\$
    – user94681
    Commented Jun 22, 2020 at 22:46
2
\$\begingroup\$

JavaScript (Node.js), 28 bytes

console.log("Hello, World!")
\$\endgroup\$
2
  • \$\begingroup\$ We already have a JavaScript answer at 22 bytes. \$\endgroup\$
    – Zach Gates
    Commented Apr 2, 2016 at 20:07
  • 1
    \$\begingroup\$ @ZachGates But that answer runs in browser environment. My answer runs in Node.js. \$\endgroup\$ Commented Apr 2, 2016 at 20:08
2
\$\begingroup\$

Javascript (Nashorn), 22 bytes

Nashorn is the JS engine that comes built in to Java.

print('Hello, World!')
\$\endgroup\$
2
\$\begingroup\$

.kill();, 39 bytes

Try it here! Github.

SFTp^B2lA=ZkW`j\9@+*+@9\j`WkZ=Al2B^pTGT

Alright, so I made another monster! This is how this works. First, the code is iterated through, and a resulting string is made. First, let's look at the first character and some related information:

char: S
opposite char: T
average char floored: (@S + @T) / 2 = (83 + 84) / 2 = 83.5 => 83 = S
index: 0
result: S

Each character in the new string is calculated by averaging the values of the current char and the char that lies the same distance from the end of the string; this value is incremented by the index (starting at zero) then floored. The resulting character is appended to the result.

Once this result is made, we look for a valid base64 string in it. This is what that result looks like:

SGVsbG8sIFdvcmxkIQ==?UOs#yq'vZ_,Rc!4xky

This will result in the string SGVsbG8sIFdvcmxkIQ== being found as the base 64 string for "Hello, World!", and is thus outputted.

(When no such string is found, then a more complicated algorithm ensues that transpiles this to JavaScript, so this is most definitely turing-complete and thus a valid language.)

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

Pickle, 34 bytes

cbuiltins\nprint\n\x8c\rHello, World!\x85R.

Replace the escape sequences by their appropriate character code.

Surprise. Python's default serialization implementation actually uses an interpreter over a stack-based language. Just call pickle.load on it to run it.

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

UGL, 80 bytes

cuu$u$$$$$$*$d*O$*u$*u$O$@++u$O$O^^+$O@@$$uu**dO%$$*$**$O@$*$u*dddO%$OuuuO%OdOuO

Try it online!

With comments:

#H  e   l   l   o   ,     W  o   r   l   d   !
#72 101 108 108 111 44 32 87 111 114 108 100 33
cuu$u$$$$$$*$d*O  #print H  72        (stack:2 3 3 3 3 3 3)
$*u$*u$O$@        #print e  101       (stack:101 2 3 3 3 3 101)
++u$O$O           #print ll 108 108   (stack:101 2 3 3 108)
^^+$O@@           #print o  111       (stack:108 111 101 2 3 3)
$$uu**dO          #print ,  44        (stack:108 111 101 2 3)
%$$*$**$O@        #print    32        (stack:32 108 111 101 3)
$*$u*dddO         #print W  87        (stack:32 108 111 101)
%$O               #print o  111       (stack:32 108 101 111)
uuuO              #print r  114       (stack:32 108 101)
%O                #print l  108       (stack:32 101)
dO                #print d  100       (stack:32)
uO                #print !  33        (stack:)
\$\endgroup\$
1
  • \$\begingroup\$ Which part is the actual 80-byte source code? The non-space prefixes of the lines? Might be best to include that separately for clarity. \$\endgroup\$ Commented Apr 26, 2016 at 11:39
2
\$\begingroup\$

Tellurium, 17 bytes

µHello, World!~^

Well, this is pretty easy to explain.

  • µ starts reading the string
  • ~ stops reading the string, and stores it in the selected cell.
  • ^ outputs the selected cell's value, which is currently "Hello, world!"

Alternate version (5 bytes)

This one uses the preinitialized variable !o, which expands to "Hello, World!".

µ!o~^
\$\endgroup\$
7
  • \$\begingroup\$ OP says you can use languages made after this challenge. \$\endgroup\$ Commented Jun 2, 2016 at 19:37
  • \$\begingroup\$ @EʀɪᴋᴛʜᴇGᴏʟғᴇʀ Yeah, I know, but using a builtin Hello World seems kind of like cheating. \$\endgroup\$
    – m654
    Commented Jun 3, 2016 at 11:11
  • 2
    \$\begingroup\$ 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! \$\endgroup\$ Commented Jun 3, 2016 at 11:14
  • 2
    \$\begingroup\$ Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge. 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. \$\endgroup\$ Commented Jun 3, 2016 at 11:15
  • \$\begingroup\$ @EʀɪᴋᴛʜᴇGᴏʟғᴇʀ Oh, I didn't notice that :P \$\endgroup\$
    – m654
    Commented Jun 3, 2016 at 11:15
2
\$\begingroup\$

64-bit Windows NT executable, 261591 bytes

Because why not?

Anyway, here's a 89,890-byte ZIP archive containing this executable: http://pastebin.com/raw/pJ6CeNuG (encoded in Base64)

------EDIT------

we don't allow link-only answers for off-site code

Okay. The C code I compiled the executable from is the classic Hello World program:

#include "stdio.h" // Use <cstdio> on C++
int main(){
    printf("Hello, World!");
}

The compiler is GCC without optimizations. Maybe other compilers (such as Intel C(++) Compiler or Clang) can generate smaller executables.

\$\endgroup\$
2
  • \$\begingroup\$ @downvoter Did you get a smaller/larger executable? \$\endgroup\$ Commented Jan 10, 2017 at 22:30
  • 2
    \$\begingroup\$ @Matheus Avellar got a much shorter executable (1175) from calling WriteConsoleA directly in asm (in a 32-bit PE executable). Did you even strip the compiler output of debug info? 261k is ridiculously huge, it's like an ungolfed baseline that you might mention in a real answer. \$\endgroup\$ Commented Apr 13, 2018 at 2:51
2
\$\begingroup\$

Oration, 28 bytes

listen
capture Hello, World!

Fun to write.

\$\endgroup\$
8
  • \$\begingroup\$ You can include the 32-byte version: Literally, print("Hello, World!"). \$\endgroup\$ Commented Feb 26, 2016 at 19:37
  • \$\begingroup\$ Ooh nice, thanks @CᴏɴᴏʀO'Bʀɪᴇɴ . \$\endgroup\$
    – Riker
    Commented Feb 26, 2016 at 21:37
  • \$\begingroup\$ Can I figuratively print something? :P \$\endgroup\$
    – Downgoat
    Commented Apr 12, 2016 at 4:22
  • \$\begingroup\$ @Downgoat yes, but the compiler ignores such frivolity. \$\endgroup\$
    – Riker
    Commented Apr 12, 2016 at 15:27
  • \$\begingroup\$ Can't you remove \nthat's it? \$\endgroup\$ Commented Jun 17, 2016 at 10:48
1
14 15
16
17 18
34

Your Answer

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

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