515
\$\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

969 Answers 969

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

Bitwise Cyclic Tag But Way Worse, 324 bytes

1111111111111111111111111111111111111111111111111111111110110101101010101110101101101110111010101110111010101110111110101101110101010110101010101011011011110111011111011110101101011101110101011101011010101011010101011n0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Try it online!

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

legit, 1 commit, 67 bytes (commit messages), 179 + 3 = 182 bytes (repository)

Commit tree:

* 63c5d78 "!dlroW ,olleH" put put put put put put put put put put put put put

The program is quite boring -- commits are expensive, and the messages are compressed, so there's little incentive to use proper control flow.

The program in its proper representation consists of 4 files:

.git/HEAD (21 bytes, an empty file here is still accepted by the interpreter, but git does not recognize the repository):

ref:refs/heads/master

.git/refs/heads/master (40 bytes):

63c5d7873f5b0ede65885bfdfd5c935827d6752a

.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 (15 bytes, xxd):

00000000: 78da 2b29 4a4d 5530 6000 000a 2c02 01    x.+)JMU0`...,..

.git/objects/63/c5d7873f5b0ede65885bfdfd5c935827d6752a (103 bytes, xxd):

00000000: 78da 04c1 4501 c030 0c00 c0bd a722 0e4a  x...E..0.....".J
00000010: 4137 6366 f0df bbf6 dcf7 f983 80a1 f89e  A7cf............
00000020: be07 6c34 52d7 32c6 b6e1 beb1 dab3 ef09  ..l4R.2.........
00000030: 9b41 3bb6 a83a 347d 8fe6 b1ac ff6f 3a1f  .A;..:4}.....o:.
00000040: f090 6763 c705 31a4 2415 cae5 5252 4cc9  ..gc..1.$...RRL.
00000050: 29ca 0f57 d0c9 cfc9 49f5 5052 2828 2d21  )..W....I.PR((-!
00000060: 1503 00bd ca30 75                        .....0u
\$\endgroup\$
7
  • \$\begingroup\$ hmm seems like you should measure repository size using a tar instead? \$\endgroup\$
    – ASCII-only
    May 4, 2019 at 1:01
  • \$\begingroup\$ @ASCII-only Is there precedent for this? Also, tar on my machine always creates at least 10240-byte files minimum, which removes almost all possibilities for golfing. Moreover, the filenames literally can't store any extra information - they are hashes of the content (after decompressing with zlib). \$\endgroup\$
    – Maya
    May 4, 2019 at 7:59
  • \$\begingroup\$ hmm. well the structure needs to be counted somehow. maybe some kind of tar archive instead? \$\endgroup\$
    – ASCII-only
    May 4, 2019 at 10:04
  • \$\begingroup\$ @ASCII-only I've found the relevant meta post for multi-file programs and linked it in the header of my answer. Can you take a look? \$\endgroup\$
    – Maya
    May 4, 2019 at 10:07
  • \$\begingroup\$ Looks fine now, but still feel like that's a bit hacky (e.g. it's impossible to make it work with 1-byte filenames) :/ IMO the best way to do this would be to count the bytes of a shell script to create the appropriate structure \$\endgroup\$
    – ASCII-only
    May 4, 2019 at 10:10
3
\$\begingroup\$

VBA, 15

?"Hello, World!

Try it, for instance, in the "Immediate" panel of the development window in MS Excel.

\$\endgroup\$
5
  • \$\begingroup\$ I see. I'll try Brandy \$\endgroup\$
    – Beta Decay
    Aug 28, 2015 at 15:01
  • \$\begingroup\$ Nope, returns with "Type mismatch: number wanted" \$\endgroup\$
    – Beta Decay
    Aug 28, 2015 at 15:01
  • \$\begingroup\$ @BetaDecay I can post a screenshot if you like \$\endgroup\$ Aug 30, 2015 at 23:05
  • 1
    \$\begingroup\$ @edc65 This still works (least in my VBA7 version) if you remove the trailing quote saving you 1 byte: ?"Hello, World! \$\endgroup\$ May 7, 2019 at 21:21
  • 1
    \$\begingroup\$ @i_saw_drones amazing! VBA is really forgiving (or really a mess). Thanks for the hint \$\endgroup\$
    – edc65
    May 8, 2019 at 14:15
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\$

Pxem, 0+17=17 bytes

Using the filename as data without counting the length is cheating. Therefore it is 17 bytes. (It even uses the filename extension as part of the program!)

Save the program as

Hello, World!.pxe

and the file contents should be empty.

\$\endgroup\$
1
  • \$\begingroup\$ You know, just testing Feeds... \$\endgroup\$
    – user85052
    Jan 10, 2020 at 4:07
3
\$\begingroup\$

Verbosity v2, 152 bytes

IncludeTypePackage<OutputSystem>
IncludeTypePackage<StringArray>
outpu=OutputSystem:NewOutput<DEFAULT>
OutputSystem:DisplayAsText<outpu;"Hello, World!">

Try it online!

Introducing Verbosity v2! This is a short as it gets, as variable names must be 5 characters or more. The ungolfed version isn't much different:

IncludeTypePackage<OutputSystem>
IncludeTypePackage<StringArray>

output = OutputSystem:NewOutput<DEFAULT>

OutputSystem:DisplayAsText<output; "Hello, World!">

Try it online!

And it's pretty obvious how it works.

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

Ada, 68 bytes (-15)

Noticed there wasn't a plain Ada answer yet, only one with GNAT, so I made one:

with Text_IO;procedure H is
begin
Text_IO.Put("Hello, World!");end;

Thanks to 3D1T0R and breadbox for improving this!

Try it online!

\$\endgroup\$
5
  • \$\begingroup\$ I'm not all that familiar with Ada, but took a swing at 'golf'ing this down a bit. Please evaluate: ideone.com/JjmhIt 75 bytes. \$\endgroup\$
    – 3D1T0R
    May 29, 2018 at 19:31
  • 1
    \$\begingroup\$ Also note that the Ada. can be dropped (both places) to save 8 bytes. \$\endgroup\$
    – breadbox
    May 29, 2018 at 21:20
  • 1
    \$\begingroup\$ Wow, somebody replied to this over a year later! You can combine 3D1T0R's golf with breadbox's tip to golf it down quite a bit. \$\endgroup\$
    – python-b5
    May 30, 2018 at 20:25
  • \$\begingroup\$ @breadbox: I could have sworn I tried that, but apparently not. I kind of doubt this can be golfed much more. \$\endgroup\$
    – 3D1T0R
    May 31, 2018 at 21:22
  • \$\begingroup\$ TIO link pls \$\endgroup\$
    – ASCII-only
    Dec 26, 2018 at 1:02
3
\$\begingroup\$

Keg, 15 8 bytes

«H%c¡|,!

Try it online!

Wow. It's been a while since I posted this. And boy oh boy how Keg has changed.

Explained

« #Start a special compressed string
H% #String compression code (SCC) for "Hello"
c¡ #SCC for "World"
|,! #Join "Hello" and "World" with a `,` and `!` to create "Hello, World!"
« #Close the special compressed string and implicitly print

Old Program

Hello\, World\!

Keg is a newly created stack-based, golfing language, which focuses on only having symbols as functions and keywords. As such, alphanumeric characters are pushed to the stack as letters (even spaces are pushed, meaning that they aren't NOPs).

Symbols that would normally be commands can be escaped using \'s.

\$\endgroup\$
1
  • \$\begingroup\$ Wow what a nerd using an outdated golfing language \$\endgroup\$
    – lyxal
    Oct 26, 2021 at 10:36
3
\$\begingroup\$

Poetic, 324 bytes

the i/o case of HELLO
a good i/o drill is:say a HELLO
i said HELLO,saying it in Poetic
i code in Poetic,a good way to write a poem
a special piece for you
a special piece in machine writing for you
i already think i do pretty well writing for the machine poem
Poetic program syntax is nice
a perfect sorta poem and a program

Try it online!

This is nothing original, it's a straight port of the brilliant brainfuck answer from @KSab...but it turns out that it's the shortest representation of Hello, World! that I can find in Poetic. If anyone can golf this, please let me know; I'm definitely interested if someone can beat this solution!

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

Intcode, 201 bytes

72,4,0,-1,1101,1,100,3,4,3,1101,100,8,3,4,3,4,3,1101,100,11,3,4,3,1101,40,4,3,4,3,1101,30,2,3,4,3,1101,80,7,3,4,3,1101,100,11,3,4,3,1101,100,14,3,4,3,1101,100,8,3,4,3,1101,98,2,3,4,3,1101,30,3,3,4,3,99

And this kids is why we don't golf using languages made up for programming competitions.

\$\endgroup\$
4
  • \$\begingroup\$ mmm undefined behavior \$\endgroup\$ Dec 5, 2019 at 6:31
  • \$\begingroup\$ Invalid opcodes are just NOPs in my interpreter \$\endgroup\$
    – lyxal
    Dec 5, 2019 at 6:33
  • \$\begingroup\$ @UnrelatedString I mean, they haven't said what to do with undefined ops \$\endgroup\$
    – lyxal
    Dec 5, 2019 at 6:34
  • \$\begingroup\$ Outgolfed \$\endgroup\$ Dec 27, 2019 at 2:19
3
\$\begingroup\$

International Phonetic Esoteric Language, 16 bytes

"Hello, World!"o
"Hello, World!"  (push "Hello, World!")
               o (pop and print)
\$\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\$ 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\$ Aug 29, 2020 at 2:01
3
\$\begingroup\$

MAWP, 86 62 bytes

89W!;74WM1M!;7M!!;;3M;66W8M;84W;99W6M!;64WM!;3M!;6A!;8A;66W3A;

Try it!

\$\endgroup\$
1
  • \$\begingroup\$ 64 bytes \$\endgroup\$
    – lyxal
    Aug 14, 2020 at 21:32
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  [email protected]@[email protected]@..
00000030: 2f4d 5472 6b00 0000 db00 905c 4001 905d  /MTrk......\@..]
00000040: 4001 9059 4000 905c 4001 9058 4000 904e  @..Y@..\@[email protected]
00000050: 4001 904f 4001 904b 4000 9049 4001 904a  @[email protected]@[email protected]
00000060: 4001 9046 4000 904a 4001 904b 4001 9047  @[email protected]@[email protected]
00000070: 4000 9048 4001 9049 4001 904a 4001 9046  @[email protected]@[email protected]
00000080: 4000 904d 4001 904e 4001 904a 4000 904c  @[email protected]@[email protected]
00000090: 4001 9048 4000 9048 4001 9044 4000 9048  @[email protected]@[email protected]
000000a0: 4001 9044 4000 9045 4001 9046 4001 9042  @[email protected]@[email protected]
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  @[email protected]@[email protected]
000000f0: 4001 9039 4001 903a 4001 903f 4001 9044  @..9@..:@[email protected]
00000100: 4001 9049 4001 904e 4001 9056 4001 904f  @[email protected]@[email protected]
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  [email protected]@[email protected]@..
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  [email protected]@[email protected]@..
00000060: 4a40 0190 4640 0090 4a40 0190 4b40 0190  [email protected]@[email protected]@..
00000070: 4740 0090 4840 0190 4940 0190 4a40 0190  [email protected]@[email protected]@..
00000080: 4640 0090 4d40 0190 4e40 0190 4a40 0090  [email protected]@[email protected]@..
00000090: 4c40 0190 4840 0090 4840 0190 4440 0090  [email protected]@[email protected]@..
000000a0: 4840 0190 4440 0090 4540 0190 4640 0190  [email protected]@[email protected]@..
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  *@[email protected]@..7@..
000000f0: 3840 0190 3940 0190 3a40 0190 3f40 0190  [email protected]@..:@..?@..
00000100: 4440 0190 4940 0190 4e40 0190 5640 0190  [email protected]@[email protected]@..
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\$

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
1
11 12
13
14 15
33

Your Answer

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

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