428
\$\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 = /<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 = [];
  
  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,
      });
    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;
    
    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('<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)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

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

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

#language-list {
  padding: 10px;
  width: 500px;
  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/all.css?v=ffb5d0584c5f">
<div id="language-list">
  <h2>Shortest Solution 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>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>

\$\endgroup\$
  • 2
    \$\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\$ – Martin Ender Aug 28 '15 at 13:56
  • 6
    \$\begingroup\$ If the same program, such as "Hello, World!", is the shortest in many different and unrelated languages, should it be posted separately? \$\endgroup\$ – aditsu Aug 28 '15 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\$ – Martin Ender Aug 28 '15 at 19:34
  • 7
    \$\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\$ – Martin Ender Aug 29 '15 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 May 20 '18 at 10:20

771 Answers 771

4
\$\begingroup\$

Japt, 15 14 11 bytes

(using the ISO/IEC 8859 character encoding)

Japt is a shortened version of JavaScript. Interpreter

`HÁM, Wld!

There's an unprintable char in there, so here's a hexdump:

60 48 C1 4D 2C 20 57 8E 6C 64 21
`  H  Á  M  ,     W  .  l  d  !

Recently, @Vɪʜᴀɴ has helped me add in the shoco library for compressing strings. Using backticks around a string tells the interpreter to automatically decompress the string, and when a backtick is needed at the end of a program, you can leave it off. Thus, Japt now beats or ties all languages that don't have some sort of built-in to obtain "Hello, World!". (Including Pyth :D)

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

Broccoli, 23 bytes:

(print "Hello, World!")

Broccoli is a random language I ran across whilst recording the PPCG podcast. I promised that I would post an answer in it, so here it is. The better way of writing this (in 28 bytes) would be:

(print "Hello, World!" endl)

But since the newline is optional, this works.

\$\endgroup\$
  • \$\begingroup\$ Just finished the PPCG podcast this morning! Is there documentation available for Broccoli? \$\endgroup\$ – Esolanging Fruit Feb 11 '18 at 6:47
  • \$\begingroup\$ @EsolangingFruit I'm glad to hear it! :) There is a little bit of documentation in the folder, but it's pretty minimal. Mostly examples. But there is also a project to re-write it. You can ask for ask for help from the people there or in chat or on github. \$\endgroup\$ – DJMcMayhem Feb 11 '18 at 7:12
4
\$\begingroup\$

095, 16 bytes

'Hello, World!'s

First answer in my attempt at making a programming language! Pushes Hello, World! to the stack and then prints.

\$\endgroup\$
  • 2
    \$\begingroup\$ Welcome to PPCG! \$\endgroup\$ – Erik the Outgolfer Jan 25 '18 at 20:43
4
\$\begingroup\$

Atari Logo, 21 bytes

Code:

PRINT [HELLO, WORLD!]

Result:

enter image description here

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

Brainfuck, 128 bytes

Generated using this generator, which is sub-optimal.

-[------->+<]>-.-[->+++++<]>++.+++++++..+++.[->+++++<]>+.------------.---[->+++<]>.-[--->+<]>---.+++.------.--------.-[--->+<]>.
\$\endgroup\$
4
\$\begingroup\$

ELVM-IR, 116 68 66 65 bytes

.data
.string"Hello, World!"load B,A
putc B
add A,1jne 0,A,13exit

Thanks to @ASCII-only for golfing off 48 50 51 bytes!

Try it online!

Background

Running the above program with eli <file> interprets it, but elc -<target> <file> is where the real magic happens: it translates ELVM-IR source code to any of the supported backends!

Try it online!

The ELVM toolchain also supports compiling (a subset of) C and its standard library to ELVM-IR.

Try it online!

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

Nikud, 672 bytes

ֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֱֲֳֳֳֳֳֳֳֳֳֳֳֳֳֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶֶַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַַָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָָ

Try it online

Even though it has tons of bytes, it's top 3 in width, as all the characters are diacritical marks.

There isn't much useful to explain. The character codes are put in reverse order into the stack using mostly אֱ (push 1), אֶ (dup) and אַ (add). Then אֵ (print as char) is called 13 times.

Another thing that adds to the byte count is that each character is represented by 2 bytes in UTF-8. So it's actually 336 characters.

\$\endgroup\$
  • \$\begingroup\$ I think this can be golfed more using multiplication. \$\endgroup\$ – Windmill Cookies Jun 14 '18 at 5:17
4
\$\begingroup\$

Flobnar, 53 42 41 bytes

-12 thanks to @JoKing

!dlroW ,olleH
0
:| <\@6
g>,
0_\^> +
:
- <

Try it online! (requires the -r and -i flags)

Flobnar is an interesting 2D language vaguey similar to Jellyfish. It shares a creator and many of its instructions with Befunge.

Befunge is an "instruction-based" language, in that the functionality of most commands is encapsulated by an effect. Flobnar, on the other hand, is an "expression-based" language, in that the functionality of most commands is encapsulated by a return value. For example, the 4 term always returns 4, the > term is a tail call to the cell to the east, and the + term returns the sum of the terms to its north and south.

The relevant terms used by this program are:

  • @ indicates the starting point of the program. @ evaluates the term to its west, and the result of this is the return value of the program (this is printed by default; the -r interpreter flag is needed to disable this behavior).
  • lets evaluation "pass through" (it is a tail call to the cell opposite to the direction from which it was evaluated).
  • ^>v< are tail calls to the cells in the direction they point.
  • Digits return themselves.
  • # is like , except that is jumps to the cell two steps away, like Befunge's # command.
  • \ evaluates the cell to the south to get an argument, then lets evaluation pass through to the other side with the new argument. After evaluation is finished, the original argument is restored.
  • : returns the current argument.
  • + returns the sum of the cells to the north and south.
  • - returns the difference of the cell to the north and the cell to the south.
  • ! evaluates the cell on the other side, and returns 1 if it is 0 and 0 otherwise.
  • g evaluates the cell to the north to get an x-coordinate, the cell to the south to get a y-coordinate, and returns the Unicode codepoint of the cell at those coordinates.
  • | evaluates the cell on the other side. If the result is 0, it returns the cell to the south; otherwise, it returns the cell to the north.
  • _ evaluates the cell on the other side. If the result is 0, it returns the cell to the west; otherwise, it returns the cell to the east.
  • , evaluates the cell on the other side to get a codepoint and outputs the Unicode character with that codepoint. It always returns 0. This is one of the few non-referentially-transparent operations in the language.
  • This program evaluates the invalid term l. This would be an error, but -i will cause invalid characters to be ignored (treated as ).

This program defines a recursive function that takes a single argument x and always returns 0. It looks something like this in Python:

def f(x):
    if x:
        print(playfield[x, 0])
        return f(x - 1)
    else:
        print(playfield[x, 0])
        return 0
\$\endgroup\$
  • \$\begingroup\$ A fascinating language. It took me a bit to figure out how to do basic looping, so I tried a get/put approach and only got it down to 58 bytes. Well done! \$\endgroup\$ – Jo King Aug 7 '18 at 5:08
  • 1
    \$\begingroup\$ 46 bytes \$\endgroup\$ – Jo King Aug 7 '18 at 5:24
  • \$\begingroup\$ @JoKing Nice! Very clever usage of the !. I hadn't thought of the use of _ as another way to discard the result of ,. \$\endgroup\$ – Esolanging Fruit Aug 7 '18 at 7:07
  • 1
    \$\begingroup\$ @JoKing I managed to get down to 45 bytes through some fairly drastic rearrangement of the code. The bytes needed to compute the 12 bother me, though -- maybe you can see something I didn't? \$\endgroup\$ – Esolanging Fruit Aug 7 '18 at 7:12
  • 1
    \$\begingroup\$ All I could get was a different 45er \$\endgroup\$ – Jo King Aug 7 '18 at 7:33
4
\$\begingroup\$

axo, 22 bytes

"!dlroW ,olleH"[>[(#<\

Try it online!

Pushes "Hello, World!" to the stack "!dlroW ,olleH"

Duplicates top of stack afterward, which results in "HHello, World!" [

Moves to the right >.

Duplicates it again, which results in "HHHello, World!" [

Outputs "H" while popping from the stack, so the stack is "HHello, World!" (

Pops the top of the stack, results in "Hello, World!" #

Moves left <

Pops the top of the stack, results in "ello, World!" #

Outputs "e" while popping from the stack, which results in STDOUT being "He" and the stack being "llo, World!" (

Duplicates the top of the stack, resulting in the stack being "lllo, World!" [

Moves right. >

And I'm sure you can figure out the rest. If you can't, I'll update a more indepth-explanation soon.

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

strict, 18 bytes

out: Hello, World!

Believe it or not, the space is required (hence the language name). In case the website dies, here's the interpreter download link.

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

Triangular, 55 bytes

6\6+@*8\C::6--::@\@#2"+3^82*@3/#-<*#+/@"#+F<3/3@@#-7:*<

This one took a while. Also will be very difficult to golf, since there is zero no-ops in it, meaning you'll have to save 10 bytes to get it to a size 9 triangle in order to save any bytes

This expands out into this size 10 triangle:

         6
        \ 6
       + @ *
      8 \ C :
     : 6 - - :
    : @ \ @ # 2
   " + 3 ^ 8 2 *
  @ 3 / # - < * #
 + / @ " # + F < 3
/ 3 @ @ # - 7 : * <

How it works

Note: this ignores all control flow characters and just looks at what gets run in order

66* Push 36
:: Duplicate it twice
2*# Output H, popping it
3*  Multiplies by 3, yielding 108
:   Duplicates
-7# Outputs e, popping it
@@  Outputs l twice, without popping it
3+@ Outputs o, without popping it
" Swaps, putting 36 at the top of the stack
:: Duplicates it twice
8+@  Outputs comma, without popping
C-#  Outputs space, popping the top of the stack
2*F+# Outputs W, popping it
"     Swaps back around, putting 111 at the top of the stack
@     Outputs o, without popping
3+@   Outputs r, without popping
6-@   Outputs l, without popping
8-#   Outputs d, whilst popping
3-@   Subtracts 3 from 36, giving !, and outputs it
6     Pushes 6, which does nothing

Try it Online!

\$\endgroup\$
  • \$\begingroup\$ Rearranging the structure, I can get you 3 no-ops, though really it's only one byte TIO. Only 7 more to go! \$\endgroup\$ – Jo King Aug 25 '19 at 21:40
  • \$\begingroup\$ 2 more. Halfway there. \$\endgroup\$ – Jo King Aug 25 '19 at 21:50
  • \$\begingroup\$ Ok, I've got all the characters onto the stack in a size 9 triangle, but I dont have any space to put a loop to print all of them. Maybe could be golfed slightly more to fit it in TIO \$\endgroup\$ – EdgyNerd Aug 26 '19 at 6:10
4
\$\begingroup\$

EBCDIC Punched Card, 13 bytes

enter image description here

Disk Operating System/360, also DOS/360, or simply DOS, is a discontinued operating system for IBM mainframes. It was announced by IBM on the last day of 1964, and it was first delivered in June 1966.In its time, DOS/360 was the most widely used operating system in the world.

A typical configuration might consist of a S/360 model 30 with 32KB memory and the decimal instruction set, an IBM 2540 card reader/card punch, an IBM 1403 printer, two or three IBM 2311 disks, two IBM 2415 magnetic tape drives, and the 1052-7 console.

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

Cascade, 23 bytes

}ro
"""
l,H
d e
!Wl
"ol

Try it online!

This is about as compressed as it is possible to get. The } instruction is the put instruction, but it doesn't really matter what it does since we're just using it to execute the three of the instructions below it, all of which are ".

First we execute the left, which wraps around to be the rightmost column, printing Hello. Then right (which is the center column), printing , Wor. Finally directly below in the left column, we print ld!, terminating the string literal early rather than wrapping, to avoid printing the } as well.

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

Plumber, 1606 445 bytes

[]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[]=]=]=]=]=]=]
]
[[]=]=]=]=]=]=]=]=]=]=]=]=]
]
]
]
]
]
]
]
]
]
]
]
[[]=]=]=]=]=]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[]=]=]=]=]=]=]=]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[]=]=]=]=]=]=]=]=]=]=]=]
]
[[]=]
]
]
]
]
]
]
]
]
[[]=]=[[[[]=]=]=]=]=]=[]
]
]
]
[[]=]=]=]=[[]=]=]=[]
]
]
]
][]=]=]=]=]=]=]=]=]=[]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]
][[=

With some modifications of an idea by @dzaima, I've golfed 1161 bytes off of this. This one uses a single falling packet, incrementing each time it falls, and forks it off each time it reaches the right value to be outputted.

Old version

[]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
[[[[[[[[[[[[[[[[[[[[[[[[[[
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ] ]   ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
] ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
  ] ] ] ]     ]
              [[[[[[[[[]]
  ] ] ] ]     [ ]
    ] ] ]     [ ]
    ] ] ]     [ ]
    ] ] ]     [ ]
    ] ] ]     [ ]
    ] ] ]     [ ]
    ] ] ]     [ ]
    ] ] ]     [ ]
                [[[[[[
        ]     [ ] ]
        ]     [ ] ]
        ]     [ ] ]
              [   ]
              [   ]
              [   ]
              [
              [
              ]
              ]
              ]
]]]]]]]]]]]]]]]]]]]]]]]]]]
][[=

It's a little long. I could probably steal some tricks from a BF solution, maybe.

In Plumber, the program is divided into units, each of which are 2 characters wide. Each line is padded to the length of the longest line with spaces, which can be used to shorten programs. Each ] unit is an increment operator on a falling packet of information, which is dropped by the [] at the top. Chains of [[ can be used to duplicate packets and drop them one by one in different columns.

\$\endgroup\$
  • 2
    \$\begingroup\$ @downvoter Please explain? I worked pretty hard to golf this down from over 2500 bytes. It's a new language, but according to the challenge spec, Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge. \$\endgroup\$ – Redwolf Programs Dec 9 '19 at 23:50
  • 2
    \$\begingroup\$ Wish I could vote this up a second time; sweet golf! \$\endgroup\$ – Reinstate Monica Dec 11 '19 at 11:36
3
\$\begingroup\$

LOLCODE, 22 bytes

VISIBLE"Hello, World!"

Works in interpreters that don't require the presence of HAI and KTHXBYE.

\$\endgroup\$
  • 1
    \$\begingroup\$ Agh! Posted a minute before me :P \$\endgroup\$ – Kade Aug 28 '15 at 13:57
  • \$\begingroup\$ @Shebang Gotta go fast! \$\endgroup\$ – Fatalize Aug 28 '15 at 13:57
  • \$\begingroup\$ damn I'm a few days to late :( \$\endgroup\$ – Alex Carlsen Sep 1 '15 at 11:54
  • 2
    \$\begingroup\$ And I pronounce this code, Ungolfable! \$\endgroup\$ – Erik the Outgolfer Jun 4 '16 at 13:01
3
\$\begingroup\$

Wheat, 32 Bytes

Wheat is an esolang that is based on outputting and inputting. Only what has been output on a previous cycle can be input on the current one. The buffers last only one cycle; if the data of previous cycle is not read on current cycle, on the next cycle it can not be accessed, it will all be erased, replaced by the output of the current cycle (if any, otherwise the empty string is used).

output "Hello, World!"
terminate
\$\endgroup\$
  • 1
    \$\begingroup\$ The description of Wheat that you gave is taken directly from the Wheat esolang page. Care to cite? \$\endgroup\$ – Esolanging Fruit Jan 21 '18 at 6:41
3
\$\begingroup\$

Gibberish, 17 Bytes

Surprisingly, the shortest answer I could make is not gibberish at all.

[Hello, World!]eo
\$\endgroup\$
3
\$\begingroup\$

golflua, 16 bytes

w"Hello, World!"
\$\endgroup\$
3
\$\begingroup\$

Rust, 34 bytes

fn main(){print!("Hello, World!")}
\$\endgroup\$
3
\$\begingroup\$

CJam, 15 bytes

"Hello, World!"

Try it online

\$\endgroup\$
3
\$\begingroup\$

XSM, 28 bytes

<print>Hello, World!</print>
\$\endgroup\$
  • \$\begingroup\$ This is an actual XML programming language? Wow. That's... different! \$\endgroup\$ – georgeunix Aug 28 '15 at 17:09
  • 1
    \$\begingroup\$ Damn it, I was hoping I could write my own... Now someone's already gone and made it :P \$\endgroup\$ – Beta Decay Aug 29 '15 at 7:12
  • \$\begingroup\$ @BetaDecay There is also xplusplus.sourceforge.net and o-xml.org \$\endgroup\$ – Jerry Jeremiah Aug 30 '15 at 23:15
3
\$\begingroup\$

GolfScript, 15 bytes

"Hello, World!"
\$\endgroup\$
3
\$\begingroup\$

///, 13

Hello, World!

can't get much simpler than this

\$\endgroup\$
3
\$\begingroup\$

Underload, 16 bytes

(Hello, World!)S

Underload is the Brainfuck of stack-based languages. (x) pushes the string x to the stack, and S prints the value on top of the stack.

\$\endgroup\$
3
\$\begingroup\$

Rail, 27 bytes

$'main'
 -[Hello, World!]o#

Rail is a 2D language where the instruction pointer is a train that runs on, well, rails. Execution begins from the main function, starting from the $ and initially moving southeast.

The first command encountered is -, which makes the train turn so that it's moving eastward. Then we push a string, output with o and terminate with #.

\$\endgroup\$
3
\$\begingroup\$

bc, 16 bytes

"Hello, World!"

(bc requires a trailing newline - hence 16 instead of 15)

\$\endgroup\$
3
\$\begingroup\$

Sinclair BASIC, 16 bytes

PRINT "Hello, World!"

Note: PRINT on the Sinclair Spectrum is written with a single keystroke (p) and takes a single byte. The code above works on the "command line".

You can try it online at http://torinak.com/qaop. Keystrokes for that emulator: p shift-' shift-h e l l o , space shift-w o r l d ctrl-1 shift-'. Don't press shift-1 as that seems to delete the whole line.

Depending on your definition of a "full program", this may or may not be acceptable. Especially for bigger programs, you would need to use line numbers, type the whole program and then use the RUN command (keystroke r). In that case, prepend a 1 to the above code (for 1 extra byte).

\$\endgroup\$
3
\$\begingroup\$

Idris, 36 bytes

main:IO();main=putStr"Hello, World!"

Idris is sort of like Haskell, but top-level definitions need a type signature.

\$\endgroup\$
  • \$\begingroup\$ Also, it has dependent types and is a way better language xD \$\endgroup\$ – Mega Man Nov 6 '18 at 17:34
3
\$\begingroup\$

CoffeeScript, 21 bytes

alert "Hello, World!"

or console.log "Hello, World!", if that's closer to STDOUT for your tastes.

\$\endgroup\$
3
\$\begingroup\$

pb, 80 bytes

b[72]>b[101]>b[108]>b[108]>b[111]>b[44]>>b[87]>b[111]>b[114]>b[108]>b[100]>b[33]

Super naive. I tried to golf it down by keeping 108 (the character code for "l") in T, either by doing t[108] at the beginning of the program or t[B] after the first time it was printed, but each attempt ended up exactly the same length.

Note that pb doesn't require you to write b[32]. Any blank spaces on the canvas (with at least one non-blank space to the right of it) are automatically printed to the terminal as a space.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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