505
\$\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\$
21
  • 3
    \$\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\$ Aug 28, 2015 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\$ 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\$ 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\$ 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\$
    – DELETE_ME
    May 20, 2018 at 10:20

932 Answers 932

1
11 12
13
14 15
32
3
\$\begingroup\$

Turing Machine But Way Worse, 853 bytes

0 0 0 1 1 0 0
0 1 1 1 2 0 0
0 2 0 1 3 0 0
0 3 0 1 4 0 0
0 4 1 1 5 1 0
0 5 1 1 6 0 0
0 6 0 1 7 0 0
0 7 1 0 8 0 0
0 8 0 0 9 0 0
1 9 1 0 a 0 0
1 a 0 0 b 0 0
0 b 0 0 c 0 0
0 c 1 1 d 1 0
0 d 0 1 e 0 0
0 e 1 1 f 0 0
1 f 1 1 g 0 0
0 g 0 1 g 0 0
1 g 0 0 h 1 0
0 h 0 1 i 1 0
0 i 1 0 i 0 0
1 i 1 1 j 1 0
1 j 1 1 k 0 0
1 k 1 1 l 0 0
0 l 0 1 m 0 0
0 m 0 1 n 0 0
0 n 1 1 o 0 0
0 o 0 1 p 0 0
0 p 1 1 q 0 0
0 q 1 0 r 1 0
1 r 0 1 s 0 0
1 s 0 1 t 1 0
0 t 0 1 u 0 0
0 u 1 0 v 0 0
0 v 0 0 v 0 0
1 v 1 0 w 0 0
0 w 0 0 w 0 0
1 w 1 0 x 0 0
1 x 1 0 x 0 0
0 x 1 1 y 0 0
1 y 0 0 z 0 0
1 z 1 0 A 0 0
1 A 0 1 B 1 0
1 B 0 1 C 0 0
0 C 1 0 D 0 0
0 D 0 0 E 0 0
0 E 1 1 F 1 0
0 F 1 1 G 0 0
1 G 0 1 G 0 0
0 G 0 0 H 0 0
0 H 0 0 I 0 0
0 I 1 0 J 1 0
0 J 1 0 J 0 0
1 J 0 1 K 0 0
1 K 1 1 K 0 0
0 K 0 0 L 0 0
1 L 0 0 M 1 0
1 M 1 0 N 0 0
1 N 0 1 O 1 0
1 O 0 1 P 0 0
0 P 0 1 P 0 0
1 P 1 1 P 1 1

Try it online!

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

Nandy, 159B

Simply sets the stack to bits 0 and 1 and then puts them in the output stack.

o::#o>oo>o>oooo>oo>oo>o>o>o>o>oo>o>oo>ooo>oo>o>oo>ooo>oo>o>oooo>oo>o>o>oo>oooo>o>oooooo>o>o>o>o>ooo>o>oo>o>oooo>o>ooo>oo>o>oo>oo>o>oo>ooo>oo>oo>o>oooo>o>oooo>o
\$\endgroup\$
3
  • \$\begingroup\$ Wow, I'm surprised anyone noticed this language. This can probably be golfed quite a lot if you use a loop to output at the end \$\endgroup\$
    – EdgyNerd
    Aug 31, 2019 at 12:51
  • \$\begingroup\$ But how? Can you present you program? (I actually found your language by looking at your TIO request.) \$\endgroup\$
    – user85052
    Aug 31, 2019 at 13:15
  • \$\begingroup\$ I don't think using a loop at the end would be any shorter since it would be the same amount of bytes to output as it is to dupe a bit \$\endgroup\$
    – Jo King
    Sep 8, 2019 at 8:11
3
\$\begingroup\$

1+, 87 83 bytes

11+""+"""+"/*^/"\+""+";\\+"*"1+;/+""";;(|1+1+1+)";/^""1()"+()+"1+";+^;;\";();/;;1+;

Try it online!

This should be very golfable, but it is hard to golf 1+ directly.

\$\endgroup\$
1
  • \$\begingroup\$ Nice! I'm doing nothing now. \$\endgroup\$
    – null
    Oct 9, 2019 at 9:56
3
\$\begingroup\$

CRPL and its sister language PRPL, 21 bytes

Bit of an obscure language, but the official tutorial doesn't contain a Hello World program so this at least is worth something.

"Hello, World!" Trace

"Hello, World!" pushes the string Hello, World! to the stack, and Trace pops an item from the stack and add it to the trace log, the closest thing the language has to SDTOUT or a console.

Alas, for this language is too obscure for Dennis's gadget; however, I have written the following interpreter in JS with all the complexity needed for this demo. I may one day make it support more.

var code = '"Hello, world!" Trace';
var stack = [];
var vars = Object.create(null);

var literals = [];
code = code.replace(/"(.*?)"/g, (m, $1) => 'lit' + [literals.length, literals.push($1)][0]).split(/\s/);

for (var token of code) {
    if (token.match(/^lit(\d+)$/)) {
        stack.push(literals[token.slice(3)]);
    } else if (token.match(/^-?\d+.?\d*/)) {
        stack.push(+token);
    } else if (token.startsWith('<-')) {
        stack.push(vars[token.slice(2)]);
    } else if (token.startsWith('->')) {
        vars['v' + token.slice(2)] = stack.pop();
    } else {
        switch(token) {
            case 'Trace5':
                console.log(stack.pop());
            case 'Trace4':
                console.log(stack.pop());
            case 'Trace3':
                console.log(stack.pop());
            case 'Trace2':
                console.log(stack.pop());
            case 'Trace':
                console.log(stack.pop());
                break;
            default:
                throw new Error(token + 'is not implemented.');
        }
    }
}

\$\endgroup\$
2
  • \$\begingroup\$ No language is too obscure, you just have to ask for it on talk.tryitonline.net lol \$\endgroup\$
    – ASCII-only
    Apr 11, 2018 at 6:34
  • \$\begingroup\$ Yeah probably. You could've just edited it yourself. \$\endgroup\$
    – Nissa
    Dec 6, 2019 at 22:54
3
\$\begingroup\$

Ral, 103 bytes

What better way to introduce a new language than by posting the 768th "Hello, World!"?

Hand-made code, can probably be improved a lot.

11+:+:+:0=1+:+:+::+:.+0*/-::1+.0*+:::..1+1+1+::.0*:+:+:11+1+:+:++..10*1+1+1+:+:+:+-..1+1+1+...0*:+:+1+.

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ Cool language! I like the mix of stack and random access. \$\endgroup\$ Apr 12, 2020 at 23:25
3
\$\begingroup\$

Spice, 20 bytes

@OUT "Hello, World!"

Explanation

Should be pretty straight forward what's happening, but we use some undefined behaviour to shave off 2 bytes (interpreter version 1.1.0.0, which is current at time of submission). The program should read:

;@
OUT "Hello, World!";

as per the spec, but we drop the ; as we only have one instruction and don't need to define an instruction separator, and so also have no trailing ; at the end.

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

Symbolic Raku, 34 bytes

$_='(%,,/ @)/),$!'~^'`@@@@`~@[@@'

Try it online!

My newest language, though it's not too original. This is inspired by FlipTack's Symbolic Python, which bans the use of alphanumeric characters, but otherwise executes as Python code. In this case, I've used the language Raku (previously known as Perl 6), which takes input through the $_ and similarly outputs it's contents at the end of execution. Symbolic Raku does not have an extra eval operator like Symbolic Python, but it is still Turing complete through the other operators and symbols that Raku provides.

In this case, we use the string xor operator (~^), which takes two strings to produce the string Hello, World!, which is obviously banned from hardcoding because it contains letters. A shortcut for producing these strings is included in the reference implementation through the -g=string flag. Currently, this is not yet on TIO, so the link goes to the Raku language instead.

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

W d, 12 10 bytes (SBCS)

.s*♪╧T≈╪√ù

Explanation

This program is a compressed program. After decompression this becomes:

J=QwTI[5mRb`

After string-decompression:

Hello, World!"

After quote auto-completion:

"Hello, World!"

After which it is implicitly output.

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

Roj, 18 bytes

I love this simple BASIC dialect ...

out"Hello, World!"

Explanation

out                $ Output $
   "Hello, World!" $ the string "Hello, World" $
\$\endgroup\$
3
\$\begingroup\$

riscv32 and riscv64 (little endian) machine language for Linux, 38 bytes

0x00:       4505                    li      a0,1  ; Set fd=1
0x02:       012005ef                jal     a1,14 ; jmp and put ret addr in a1
0x06:       6c6c6548                              ; "Hello, World!\0"
0x0a:       57202c6f
0x0e:       646c726f
0x12:       0021
0x14:       4635                    li      a2,13 ; length of string
0x16:       04000893                li      a7,64 ; select write() syscall
0x1a:       00000073                ecall         ; call write()
0x1e:       05d00893                li      a7,93 ; select exit() syscall
0x22:       00000073                ecall         ' call exit()

To try this on riscv hardware or an online simulator, compile and run the following c program

const char main[]="\x05\x45\xef\x05\x20\x01Hello, World!\0\x35\x46\x93\x08\x00\x04\x73\0\0\0\x93\x08\xd0\x05\x73\0\0";
\$\endgroup\$
3
\$\begingroup\$

MAWP 2.0, 16 bytes

"Hello, World!":
\$\endgroup\$
3
  • \$\begingroup\$ MWP? New language? \$\endgroup\$
    – null
    Aug 28, 2020 at 11:58
  • \$\begingroup\$ @HighlyRadioactive most likely changing to MAWP 2.0, as it only adds support for strings, floats and negative numbers with some quality of life changes added on top \$\endgroup\$
    – Dion
    Aug 28, 2020 at 17:23
  • \$\begingroup\$ Competition ends (MAWP is now a golfing language) \$\endgroup\$
    – null
    Aug 29, 2020 at 2:01
3
\$\begingroup\$

Desmos, 41 bytes

[40,69,76,76,79,12,0,55,79,82,76,68,1]+32

View it online

Desmos doesn't support strings, so we return an array of integers representing the codepoints instead. There's no good way to view an entire array at once in Desmos, so instead you can check it by taking the output by wrapping it in parenthesis or storing it in a variable, then accessing (1-indexed) array items like a[1] or ([40,...,1]+32)[1]. Or just add 32 to the numbers in the array to check that they're right.

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

Bound, 48 bytes

72:c29:+c7+cc3+44:32:87:c24:+c3+c6-c8-33:13:({ds

Explanation:
Technically, Bound prints out "Hello, World!" with a blank program. But that's boring.
So instead, the program above basically creates the relevant ASCII numbers, then loops through them, converting them into chars and writing them. Someone better at math than me could probably golf this better, but I did my best.

Try it online!

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

Taktentus, 22 bytes

@WY _= "Hello, World!"

I believe this is the shortest it can get. I would like to be proven wrong.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ The code in your link has a # after the @WY which isn't in your code? Also, this is 22 bytes, not 21 \$\endgroup\$ Nov 9, 2020 at 16:19
  • \$\begingroup\$ That is the default code. Replace it with the code in my link. \$\endgroup\$
    – user92753
    Nov 9, 2020 at 16:36
  • \$\begingroup\$ You’re right. I counted wrong, fixed. \$\endgroup\$
    – user92753
    Nov 9, 2020 at 16:45
3
\$\begingroup\$

Fugue, 276 bytes

00000000: 4d54 6864 0000 0006 0001 0002 0001 4d54  MThd..........MT
00000010: 726b 0000 001b 0090 4040 0190 3c40 0090  rk......@@..<@..
00000020: 4640 1b90 4440 0390 4240 0190 4740 00ff  F@..D@..B@..G@..
00000030: 2f4d 5472 6b00 0000 db00 905c 4001 905d  /MTrk......\@..]
00000040: 4001 9059 4000 905c 4001 9058 4000 904e  @..Y@..\@..X@..N
00000050: 4001 904f 4001 904b 4000 9049 4001 904a  @..O@..K@..I@..J
00000060: 4001 9046 4000 904a 4001 904b 4001 9047  @..F@..J@..K@..G
00000070: 4000 9048 4001 9049 4001 904a 4001 9046  @..H@..I@..J@..F
00000080: 4000 904d 4001 904e 4001 904a 4000 904c  @..M@..N@..J@..L
00000090: 4001 9048 4000 9048 4001 9044 4000 9048  @..H@..H@..D@..H
000000a0: 4001 9044 4000 9045 4001 9046 4001 9042  @..D@..E@..F@..B
000000b0: 4000 9040 4001 9041 4001 903d 4000 903b  @..@@..A@..=@..;
000000c0: 4001 903c 4001 9038 4000 902f 4001 9030  @..<@..8@../@..0
000000d0: 4001 902c 4000 9027 4001 9023 4000 902a  @..,@..'@..#@..*
000000e0: 4001 9031 4002 9032 4001 9037 4003 9038  @..1@..2@..7@..8
000000f0: 4001 9039 4001 903a 4001 903f 4001 9044  @..9@..:@..?@..D
00000100: 4001 9049 4001 904e 4001 9056 4001 904f  @..I@..N@..V@..O
00000110: 4000 ff2f                                @../

This answer uses the same process as Sp3000's Prelude answer. However, since Fugue can push any integer from -10 to 10, I use the upper voice to store the constant 10 (since copying a value takes one fewer instruction than pushing a new one) and then convert from base 11. The compiler is rather old and can be tricky to use; my usual process (on x86-64 Linux) is to use the commands:

gcc -Dstricmp=strcasecmp -Wno-format -o fugue_x86 fugue_x86.c

xxd -r hello.bin > hello.midi
./fugue_x86 hello.midi /coffc
gcc -D__cdecl= -Dfugue=_fugue -m32 -o hello hello.obj hello_wrp.c

Note that this program is not a valid MIDI file due to the missing length fields after the 2F meta-events. I didn't optimize it at all for musicality, but if you still want to listen to it, here is an equivalent MIDI file:

00000000: 4d54 6864 0000 0006 0001 0002 0001 4d54  MThd..........MT
00000010: 726b 0000 001c 0090 4040 0190 3c40 0090  rk......@@..<@..
00000020: 4640 1b90 4440 0390 4240 0190 4740 00ff  F@..D@..B@..G@..
00000030: 2f00 4d54 726b 0000 00dc 0090 5c40 0190  /.MTrk......\@..
00000040: 5d40 0190 5940 0090 5c40 0190 5840 0090  ]@..Y@..\@..X@..
00000050: 4e40 0190 4f40 0190 4b40 0090 4940 0190  N@..O@..K@..I@..
00000060: 4a40 0190 4640 0090 4a40 0190 4b40 0190  J@..F@..J@..K@..
00000070: 4740 0090 4840 0190 4940 0190 4a40 0190  G@..H@..I@..J@..
00000080: 4640 0090 4d40 0190 4e40 0190 4a40 0090  F@..M@..N@..J@..
00000090: 4c40 0190 4840 0090 4840 0190 4440 0090  L@..H@..H@..D@..
000000a0: 4840 0190 4440 0090 4540 0190 4640 0190  H@..D@..E@..F@..
000000b0: 4240 0090 4040 0190 4140 0190 3d40 0090  B@..@@..A@..=@..
000000c0: 3b40 0190 3c40 0190 3840 0090 2f40 0190  ;@..<@..8@../@..
000000d0: 3040 0190 2c40 0090 2740 0190 2340 0090  0@..,@..'@..#@..
000000e0: 2a40 0190 3140 0290 3240 0190 3740 0390  *@..1@..2@..7@..
000000f0: 3840 0190 3940 0190 3a40 0190 3f40 0190  8@..9@..:@..?@..
00000100: 4440 0190 4940 0190 4e40 0190 5640 0190  D@..I@..N@..V@..
00000110: 4f40 00ff 2f00                           O@../.
\$\endgroup\$
3
\$\begingroup\$

Arturo, 20 bytes

print"Hello, World!"
\$\endgroup\$
3
+100
\$\begingroup\$

Sandwich, 14 bytes

pHello, World!

Explanation: Sandwich is comprised of opcodes. The first letter of each line is the opcode, and the rest of the line is the arguments. This example has the opcode p, which means print. The rest of the line says Hello, World!, which are the arguments to the p opcode.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Welcome to Code Golf, and nice first answer! There is this category of bounties for new and interesting languages, I've let the bounty awarder know about the language \$\endgroup\$ Apr 15, 2021 at 14:28
  • \$\begingroup\$ Hi! As caird said, I've got a bounty for new and interesting languages. I'd be willing to give this answer a bounty of +100 reputation, or if you think you could demonstrate more of the language's features in another answer I could award it to that instead. \$\endgroup\$ Apr 15, 2021 at 14:34
  • \$\begingroup\$ @RedwolfPrograms This answer is fine, thanks! \$\endgroup\$
    – karx
    Apr 15, 2021 at 14:36
  • \$\begingroup\$ @Y45HK4R4ND1K4R Bounty started! \$\endgroup\$ Apr 15, 2021 at 14:39
3
\$\begingroup\$

Yggdrasil, 29 bytes

;H;e;l;l;o;,; ;W;o;r;l;d;!(")

Try it online!

Introducing Yggdrasil! This is a self-modify esolang based on binary trees. The program and it's memory model are both mapped to the same binary tree, then executed on that same tree. For example, this program is mapped to

                          ;
                         / \
                        ;   H
                       / \
                      ;   e
                     / \
                    ;   l
                   / \
                  ;   l
                 / \
                ;   o
               / \
              ;   ,
             / \
            ;   ␠
           / \
          ;   W
         / \
        ;   o
       / \
      ;   r
     / \
    ;   l
   / \
  ;   d
 / \
(   !

The ; command takes the next 2 tokens and forms a binary branch from them. All the other symbols in the tree are no-ops, they just set the value of that leaf to their Unicode code point. You'll note that ") are not nodes in the tree. Yggdrasil ignores any trailing symbols that don't fit into the tree.

Once we've established our memory tree, we then begin executing the code, character by character. ;H;e;l;l;o;,; ;W;o;r;l;d;! all have absolutely no effect, so the pointer remains at the program root (the first ;). We then find a "traversal", bounded by (...). This takes the code inside the brackets and runs it over each node in the tree that has arguments (i.e. is not a leaf). The code here is just " (output right node as character), so the program goes to each ; and outputs it's right node as a character.

\$\endgroup\$
1
  • \$\begingroup\$ oh, your code itself formats onto a binary tree? that's very cool :D \$\endgroup\$
    – hyper-neutrino
    Apr 17, 2021 at 17:55
3
\$\begingroup\$

Branch, 42 bytes

72.101.108Z..111O.44.32.87.o.114.z.100.33.

Try it on the online Branch interpreter!

Explanation

Each number sets the value of the current node to that. . outputs as a character. N-Z set a numerical register and n-z set the value to the value of that register. I won't give a character-by-character analysis; this basically just loads each value and outputs it, using registers to save some bytes. It's not a particularly interesting solution.

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

REXX, 18 bytes

say"Hello, World!"

Rexx is widely used as a scripting and macro language, and is often used for processing data and text and generating reports. Rexx is the primary scripting language in some operating systems, e.g. OS/2, MVS, VM, AmigaOS, and is also used as an internal macro language in some other software, such as KEDIT, THE and the ZOC terminal emulator.

\$\endgroup\$
2
  • \$\begingroup\$ Yeah, it's used on zOS \$\endgroup\$
    – mbomb007
    Feb 24, 2016 at 19:36
  • \$\begingroup\$ You can remove the space between the say command and the string, meaning say"Hello, World!" works. \$\endgroup\$
    – cnamejj
    Apr 20, 2021 at 22:29
3
\$\begingroup\$

Snap!, 34 bytes

enter image description here

when gf clicked
say[Hello, World!]

Easiest program I've written in my life

\$\endgroup\$
1
  • \$\begingroup\$ Does snap allow unmatched brackets - say[Hello, world!? \$\endgroup\$
    – emanresu A
    May 5, 2021 at 9:35
3
\$\begingroup\$

Incident, 636 bytes

(uses Windows-1252 encoding)

!"#$%&()*+,-0123456789:;<=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“|””>!”••!"•––"#–˜˜#%˜™™%&™››&)›žž)+ž¡¡+-¡¢¢-0¢¥¥03¥¦¦34¦§§45§ªª58ª­­8;­®®;<®¯¯<=¯²²=A²µµADµººDIº½½IL½¾¾LM¾¿¿MN¿ÂÂNQÂÄÄQSÄÅÅSTÅÆÆTUÆÇÇUVÇÈÈVWÈÉÉWXÉÊÊXYÊÌÌY[ÌÍÍ[]ÍÑÑ]aÑÓÓacÓÕÕceÕÚÚejÚÝÝjmÝÞÞmnÞàànpàáápqáååquåææuv/\\>\//æççvwçêêwzêííz~íîî~€îïïññ‚„ñòò„…òõõ…ˆõ÷÷ˆŠ÷øøŠ‹øùù‹ŒùúúŒŽúüüŽ’üýý’“ý——>$—šš$(šœœ(*œŸŸ*,Ÿ££,1£¤¤12¤¨¨26¨©©67©««79«¬¬9:¬°°:?°±±?@±³³@B³´´BC´¶¶CE¶··EF·¸¸FG¸¹¹GH¹»»HJ»¼¼JK¼ÀÀKOÀÁÁOPÁÃÃPRÃËËRZËÎÎZ^ÎÏÏ^_ÏÐÐ_`ÐÒÒ`bÒÔÔbdÔÖÖdfÖ××fg×ØØghØÙÙhiÙÛÛikÛÜÜklÜßßloßââorâããrsãäästäèètxèééxyéëëy{ëìì{}ìðð}ƒðóóƒ†óôô†‡ôöö‡‰öûû‰‘û“‘||

Try it online!

I used shortstring.pl from Incident distro to generate the program, and then replaced all two-byte tokens with single-byte ones and removed separators.

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

Minecraft 1.16, 36 bytes

Just something I thought of :D

/tellraw @a {"text":"Hello, World!"}

I can't find a try it online for these though

\$\endgroup\$
1
  • 1
    \$\begingroup\$ You should be able to just use "Hello, World!" \$\endgroup\$ Jun 14, 2021 at 2:29
3
\$\begingroup\$

yuno (abandoned), 2 bytes

」オ

No TIO link unfortunately, because I'm not good at setting this sort of stuff up and I don't want to accidentally make my server insecure (especially since I'm sharing it with a friend). You can clone the repository from the link in the header though. I promise I did not intentionally code malware. I can't guarantee nothing weird will happen though because I suck at coding, only that I don't have malicious intent.

This language is in its very early stages. It has very few things implemented right now, but it exists and by posting an answer and publicizing it maybe it'll force me to actually write it instead of giving up like half of my other language ideas so far, lol.

Explanation

Since is a string terminator, it's not mapped to anything in the normal string system, and therefore when represented as a single character, I special-cased it to Hello, World. ends a string normally, but like in Jelly, when used without an open quote, it acts as a character literal, but in this case, it maps its codepage to latin characters.

A non-built-in solution would be 「Hello、 Wリョld! (the can be ommitted), based on how character mapping works.

The built-in can be written as ]o as well. The non-built-in can be written as [H_e_l_l_o, Wryo_l_d!.

Note: the non-built-in, despite looking like 14 characters (bytes in an SBCS), is actually 13 (you could use 「Hello、 World! for 14). This is because リョ is a single token and, if you read the code in binary, is mapped to one byte. You can read more about this on the wiki, which also mentions where to find the exact codepage in the repository. There are some three-byte tokens like ッキョ. You can check how many bytes a program is using the c flag or format it into a CGCC submission using the C flag.

No, I don't have a good explanation for why I used katakana as my codepage. Yes, you can use hiragana as well. If you call me a weeb I will 11 you. That is all.

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

BrainCrash, 14 bytes.

Note that this is NOT Braincrash; this is also a Brainfuck-variant, with these expansions:

  • The first 13 cells are initially Hello, world!.
  • Automatically implicit output.
  • Four logical operators.

Here is the program:

>>>>>>^<<<<<<<

What it does

  • Move to space.
  • ^ is mem[ptr+1]=mem[ptr] xor mem[ptr+1]; ptr++;; to change w with W.
  • Go back.
  • Implicit [.>]

Try it online! The interpreter was originally written by "ぬこ", the designer of the language; I modified a bit for TIO.

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

brainbox, 118 bytes

 ++++<!.+aa.--------.------.+++.d.-d.------------.++++++++++++aa.+++..+++++++.---w.dd]-sa-a+w+d]-ds+a+++a+++w++d[++++d

Try it Online!

I've finished my new language, called brainbox! It's a 2D extension of brainfuck, with a 2D grid for the code and a 2D grid for the memory. This program is a modification of the "Hello World!" program in brainfuck found on esolangs.org. I used a few features to shorten it:

  • Instead of using ++++++++ to set the first cell to 8, I used ++++<, which is 3 bytes shorter and changes the IP direction to the left.

  • I made use of the 2D memory space in order to reduce the number of commands needed to move the memory pointer around.

  • I also used an unmatched ] to loop execution back to (0,0). This doesn't actually save any bytes here, but I wanted to show off that feature.

For more information on the language and some of the features and quirks, check out the GitHub repo.

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

GForth 17 Bytes

." Hello, World!"
\$\endgroup\$
2
  • 1
    \$\begingroup\$ @Razetime Consensus is irrelevant since it works in the specific implementation. \$\endgroup\$
    – Bubbler
    Jul 26, 2021 at 8:20
  • \$\begingroup\$ @Razetime I would not call that a consensus. If there is a disagreement it would be better to take this to the meta, than to discuss in comments. \$\endgroup\$
    – Wheat Wizard
    Jul 26, 2021 at 8:22
3
\$\begingroup\$

abcn, 92 bytes

aaaac018gxnaaaaac020agxaaaaaaagxgxaaagxnaaaac008gxbbc004bgxbbbbbbbbgxaaagxbbbbbbgxbbbbbbbbgx

Obviously not the shortest answer by a mile but for me its fine.

Now how does this work

aaaac018gxn  H --> 72
aaaaac020agx E --> 101
aaaaaaagx    L --> 108
gx           L --> 108 
aaagxn       O --> 111
aaaac008gx   SPACE ---> 32
bbc004bgx    W  --> 119
bbbbbbbbgx   O  --> 111
aaagx        R  --> 114
bbbbbbgx     L  --> 108
bbbbbbbbgx   D  --> 100

For reference a inc accumulator by 1, b decs by 1 and c is for multiplication g converts to ASCII and x prints

(I do have an interpreter, clicking the link leads to it but you are gonna have to test it yourself)

NOTE : language is WIP

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

Paradoc, 15 bytes

first paradoc solution lol

"Hello, World!"

Try it online!

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

Jealous, 14 bytes

ᐗHello, World!
\$\endgroup\$
1
11 12
13
14 15
32

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.