517
\$\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
  • 4
    \$\begingroup\$ @isaacg No it doesn't. I think there would be some interesting languages where it's not obvious whether primality testing is possible. \$\endgroup\$ Aug 28, 2015 at 13:56
  • 7
    \$\begingroup\$ If the same program, such as "Hello, World!", is the shortest in many different and unrelated languages, should it be posted separately? \$\endgroup\$ 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

976 Answers 976

1
16 17
18
19 20
33
2
\$\begingroup\$

rk, 22 + 2 (-e) = 24 bytes

print: "Hello, World!"

Requires the -e flag (remove necessity for rk:start). Try it online!

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

Stax, 8 bytes

èï┬▀↨╩4G

Run and debug online!

Explanation

èï┬▀↨╩4G is the packed form of the ASCII Stax code `jaH1"jS3!, which is in turn a compressed string literal of Hello, World! with the ending backtick omitted.

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

Min, 20 bytes

"Hello, World!" puts
\$\endgroup\$
2
\$\begingroup\$

PHP (on a standard Apache Server, result needing to target STDOUT), 30 27 Bytes

<?php die("Hello, World!");

Note: this is not to detract form earlier PHP example relied on an option assuming PHP wasn't being used as a webserver and abusing the HTML-effect outside of ?php tags to have an answer that was just "Hello, World!"

That said, that solution made some non-standard server assumptions which aren't common with PHP. So I'm presenting an alternative that assumes a normal server layout, but still needs to go to STDOUT. This is not to detract from the previous posters example, but to present one in a different setting with different constraints.

Note: originally thought using

<?php fwrite(STDOUT,"Hello, World!"); ?> 

would be the only way, but then realized the die (normally used killing the script with an error) outputted to STDOUT and didn't use extra variables.

Updated: Cut off a few bytes recalling that "die" wont' bother with anything after itself, so didn't need the closing ?>.

Note: Worth noting, that if shorttags were on with a PHP5 server, could drop down 3 more bytes to 24 bytes with

<? die("Hello World!"); 

However, I was specifically going a standard server, and shortags are now off by default making a server with them on no longer standard.

Example (courtesy of Scrooble): Try It Online!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Welcome to the site, and nice answer and explanation! It is common practice here to include a Try it online! link in answers so others can run and inspect your code with ease. \$\endgroup\$ Mar 13, 2018 at 0:32
2
\$\begingroup\$

Euphoria, 23 bytes

puts(1,"Hello, World!")

The (1, parameter tells the puts function to send the output to STDOUT, and there is no carriage return or EOL character for this one line program. This program will work as-is on both RDS Euphoria (v3.1.1 - last commercial version) and OpenEuphoria (v4.1 - current opensource version). The code omits the "optional trailing newline" (per the challenge rules) or else it would be two characters longer (adding \n after the !).


I am surprised that no one had added Euphoria to this challenge before now but I am glad that I could as I really like this powerful little language. Since no one added it to this list after more than 2 years I am thinking that maybe CodeGolfers never heard of Euphoria? I am not sure if it is okay to do this here but what follows is a very short description of the language for context. If this is not okay I apologize in advance. Also, where would such information be appropriate? Is there a "directory" of languages post somewhere in the site?

Euphoria was released in 1995 (back in the days of DOS and Windows 3.1) with only two data types: the atom (each contains a single number) and the sequence (essentially a dynamically-sized array of zero or more atoms). Two other types (the integer and the object) were added in recent years to help with efficiency of execution. One of the most interesting things that attracted me to this language long ago besides its remarkably uncomplicated structure is that it runs incredibly fast for an interpreted language. Also it has engines that run on Windows, Linux, and Mac OSX so user code is cross-platform.


PS: It seems as of the time of this posting that the original RDS website linked above is down due to hosting problems after 20 years with the same host. It is unclear when (or if) it will come back up. However the rather extensive library of user created programs for the language is archived here if anyone is wanting good sample code to explore the language.

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

Shakespeare Programming Language, 926 835 bytes

Thanks to @JoKing for -91!

CW'd. At present, the only SPL answer is completely ungolfed and has been so despite comments from last June, so I thought I'd post the RosetTIO answer (with modifications). I couldn't figure out the original author (perhaps this GH user? Who's that on SE?); if this is your work, I'll happily delete (or ask a mod to transfer post ownership and un-CW or something).

a.Ajax,.Puck,.Act I:.Scene I:.[Enter Ajax and Puck]Ajax:You big big big cat!Puck:You is the sum of I the square of I!Speak mind!You is the sum of you twice twice I!Ajax:You is the sum of a big cat a cat!Puck:You is the difference between you I!Speak mind!You is the sum of the sum of you I a big big cat!Speak mind!Speak mind!You is the sum of you I!Speak mind!Ajax:You big big big big big cat!You is the sum of the sum of you a big big big cat a big big cat!Speak mind!You big big big big big cat!Speak mind!You is the sum of the difference between I you a big big big cat!Speak mind!You is the sum of a big cat a cat!Puck:Speak mind!You is the sum of you I!Speak mind!You is the difference between you twice I!Speak mind!You is the sum of you a big big big pig!Speak mind!You is the sum of a cat a big big big big big cat!Speak mind!

Try it online! 46 warnings, but it does what it needs to do and sounds like Shakespeare[citation needed]. Yay.

I wrote none of this; I merely removed from the RosetTIO program some unnecessary stuff. I outgolfed nothing (just shortened), so this is not eligible for that one bounty.

Changes

  • [Exeunt] at the end removed
  • Linebreaks removed
  • thy in Speak thy mind! removed
  • as big as in You is as big as removed
  • and removed
  • myself and thyself replaced with I and you, respectively
\$\endgroup\$
2
  • \$\begingroup\$ as big as = is \$\endgroup\$
    – Jo King
    Apr 9, 2018 at 5:30
  • \$\begingroup\$ somebody1234 is me, but I'm pretty sure I basically stole it from somewhere else lol \$\endgroup\$
    – ASCII-only
    Apr 11, 2018 at 2:58
2
\$\begingroup\$

LNUSP, 360 353 bytes

-6 bytes thanks to ASCII-only

001 . !.!
002 !    !
001 *  !!
033 +
001 *
100 +
001 *
108 +
001 *
114 +
001 *
111 +
001 *
087 +
001 *
032 +
001 *
044 +
001 *
111 +
001 *
108 +
001 *
108 +
001 *
101 +
001 *
057 +
015 +                    ?...?@             !
001 *                   ?@ .  ?
001 !                   . +.  *
001  .                  ?  !  ?
001   !..................?.@.?

Ungolfed version:

001 . !.!                  .OUTPUT          .EXIT
001  .   !                 .                .
001 ! .  !                 .                .
001 .  !!                  .                .
001 *                      .                .
033 + !                    .                .
001 *                      .                .  
100 + d                    .                .
001 *                      .                .
108 + l                    .                .
001 *                      .                .
114 + r                    .                .
001 *                      .                .
111 + o                    .                .
001 *                      .                .
087 + W                    .                .
001 *                      .                .
032 +                      .                .
001 *                      .                .
044 + ,                    .                .
001 *                      .                .
111 + o                    .                .
001 *                      .                .
108 + l                    .                .
001 *                      .                .
108 + l                    .                .
001 *                      .                .
101 + e                    .                .
001 *                      .                .
072 + H                    .                .
001 *                      .                !
001 .                      .               .
001 .                      .              .
001 .                      .             .
001 .                      .            .
001 !                      .           .
001  .                     .          .
001   .                    .         .
001    .                   .        .
001     .                @ .       .
001      .                +.      .
001       .                !     .
001        .               .    .
001         .           ?.....?@
001          .         ?   .   ?
001           .        .   .   *
001            .       ?   .   ?
001             !.......?..@..?

Note that TIO LNUSP does not require newline at the end of file.
Some explanations are here. Can be golfed 4 bytes more, I didn't do it for aesthetic purpose.

Try it online

\$\endgroup\$
4
  • \$\begingroup\$ You can move the topmost * one line up \$\endgroup\$
    – ASCII-only
    Apr 14, 2018 at 2:26
  • \$\begingroup\$ Also, what is the 4-byte golf? I'm assuming it's removing one character from the right side of the print loop? \$\endgroup\$
    – ASCII-only
    Apr 14, 2018 at 2:42
  • \$\begingroup\$ re: topmost *: never mind. it appears you can remove it completely \$\endgroup\$
    – ASCII-only
    Apr 14, 2018 at 2:49
  • \$\begingroup\$ @ASCII-only yes (about 4-byte golf) \$\endgroup\$
    – stasoid
    Apr 14, 2018 at 4:28
2
\$\begingroup\$

Zig, 81 bytes

pub fn main()!void{try(try@import("std").io.getStdOut()).write("Hello, World!");}

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ This looks like an interesting language. The author appears to be aware of TIO! \$\endgroup\$ May 9, 2018 at 4:09
2
\$\begingroup\$

Meq, 145 111 bytes

.==++>:+>+>[:++++++++>]:=+>====++++>===++>.===+++++++>:=+>:=++++>:++++++++>:>===+++rp>p>>p>p>p>p>p>p>p>p>p>p>p!

Thanks Steadybox for saving 34 bytes

\$\endgroup\$
3
  • \$\begingroup\$ Welcome to PPCG! As far as I can tell, this is just the HW from the esolangs page (which seems to print Hello World) with two characters dropped. Does this actually print the correct punctuation of Hello, World!? \$\endgroup\$ Mar 16, 2018 at 9:41
  • \$\begingroup\$ @MartinEnder It does not, it prints Helo World. (And the original prints Hello World.) \$\endgroup\$ Mar 16, 2018 at 9:56
  • 1
    \$\begingroup\$ .==++>:+>+>[:++++++++>]:=+>====++++>===++>.===+++++++>:=+>:=++++>:++++++++>:>===+++rp>p>>p>p>p>p>p>p>p>p>p>p>p! should work. \$\endgroup\$
    – Steadybox
    Mar 16, 2018 at 10:37
2
\$\begingroup\$

Ahead, 17 bytes

"!dlroW ,olleH"W@

A (very-unfinished at the time of this writing) fungelike. This works on the current master version.

Ahead is my first esolang (well... that actually has progress). It borrows a lot of concepts from Befunge and ><> but hopefully it provides enough unique features to be interesting. I particularly want to provide features that can improve code density and golfing, one of which is included in this answer.

W is called "Writewhile". This pops cells from the stack and prints them as chars, until it encounters a 0. The 0 is popped and discarded (not printed). Since stringmode pushes a 0 to the stack when it starts, this makes printing strings rather easy.

"!dlroW ,olleH"    push chars to stack
               W   pop and print until 0
                @  kill head

Try it online!

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

Haxe, 56 bytes

class H{static function main(){trace("Hello, World!");}}

Test it online!

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

2DFuck, 157 150 bytes

.!.!..!.!....!..!..!.!.!.x[!.!..!.!..!..rv].!..!.!....!..!.!.!..!....!.!......!.!.!.!.!...!.!..!.!....!.!...!..!.!..!..!.!..!...!..!..!.!....!.!....!.

Try it online!

Print He, print l twice, print o, World!

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

ObCode, 68 bytes

Hexdump:

0000000: 9a62 c6c6 ca78 b665 a999 4ea9 5995 aa66  .b...x.e..N.Y..f
0000010: 53a9 6363 6665 3958 d996 a539 6363 6565  S.ccfe9X...9ccee
0000020: 6363 6656 5396 3636 3656 65a9 9594 ea8d  ccfVS.666Ve.....
0000030: 9599 6aa5 6339 6395 9599 594e 5656 5665  ..j.c9c...YNVVVe
0000040: aa99 94e5                                ....

Explanation

Unpacking the program gives the following object:

((())()(())((()())((())())((())())(()()(())))((()())())(())(()())()()(())(())(()()(()))()()()(()()())(())(()()())()()()(())(())(()()(()))()()(()())((())())((())())(())(())(()()(()))(()()())((())())(())(()())()()(()()(()))(()())((())())((())())(()()())(()()())((())())((())())(())(()()())(()()(()))(()())((())())((())())((())())(()()())(())(()())()()(())(()()())(()()(()))()()()((())())(()()())(())(()())()()()()(()()())((())(()))(()())((()))(()()())(()()())(())(()()())(()()(()))(()()())(()()())(()()())(())(()())()()()()(())(())(()()(()))(()()()))

Indented and commented, this gives:

( Start of main object
    (()) Define () (()) doing: (
        (()()) Save top stack value to register
        ((())()) ((())()) Push twice
        (()()(())) Concatenate
        This code will double an object
    ) ((()())())
    (()) (()()) Push 2
    () () Double it twice, producing 8
    (()) (()) Push 1
    (()()(())) Add: 8 + 1 = 9
    () () () Double thrice, producing 72
    (()()()) Output 72 = 'H'; Stack: empty
    (()) (()()()) Push 3
    () () () Double thrice, producing 24
    (()) (()) (()()(())) Add 1, producing 25
    () () Double twice, producing 100
    (()()) ((())()) ((())()) Duplicate and save to register
    (()) (()) (()()(())) Add 1, producing 101
    (()()()) Output 101 = 'e'; Stack: 100
    ((())()) Load 100 from register
    (()) (()()) Push 2
    () () Double twice, producing 8
    (()()(())) Add 100 + 8 = 108
    (()()) ((())()) ((())()) Duplicate and save to register
    (()()()) (()()()) Output both 108 = 'l'; Stack: 100
    ((())()) ((())()) Load 108 twice
    (()) (()()()) Push 3
    (()()(())) Add 108 + 3 = 111
    (()()) ((())()) ((())()) ((())()) Triplicate
    (()()()) Output 111 = 'o'; Stack: 100, 108, 111, 111
    (()) (()()) Push 2
    () () Double twice, producing 8
    (()) (()()()) Push 3
    (()()(())) Add 8 + 3 = 11
    () () () Double thrice, producing 88
    ((())()) Load 44, saved by the last doubling
    (()()()) Output 44 = ','; Stack: 100, 108, 111, 111, 88
    (()) (()()) Push 2
    () () () () Double four times, producing 32
    (()()()) Output 32 = ' '; Stack: 100, 108, 111, 111, 88
    ((())(())) Use 88 as new stack
    (()()) Load 1
    ((())) Exit the stack which is now 87
    (()()()) Output 87 = 'H'; Stack: 100, 108, 111, 111
    (()()()) Output 111 = 'o'; Stack: 100, 108, 111
    (()) (()()()) Push 3
    (()()(())) Add 111 + 3 = 114
    (()()()) Output 114 = 'r'; Stack: 100, 108
    (()()()) Output 108 = 'l'; Stack: 100
    (()()()) Output 100 = 'd'; Stack: empty
    (()) (()()) Push 2
    () () () () Double four times, producing 32
    (()) (()) Push 1
    (()()(())) Add 32 + 1 = 33
    (()()()) Output 33 = '!'
) End of main object
\$\endgroup\$
1
  • \$\begingroup\$ I don't understand why anybody cares about this language .__. \$\endgroup\$ Feb 2, 2019 at 18:32
2
\$\begingroup\$

Xanathar, 24 bytes

printf["Hello, World!"];

Xanathar is a work in progress language, so it is rather hard to use.

Compilation:

$ xanathar helloworld.xan
$ ./helloworld.xan.o
\$\endgroup\$
2
  • \$\begingroup\$ Link to interpreter no longer works \$\endgroup\$
    – ASCII-only
    Dec 26, 2018 at 0:01
  • \$\begingroup\$ @ascii-only fixed \$\endgroup\$ Dec 26, 2018 at 0:38
2
\$\begingroup\$

Clam, 15 bytes

p+[[ua+ua,]"!"]

Try it online!

Oh boy, he did it again, he started another language.

Explanation

All functions and operators in Clam are prefix

p+[[ua+ua,]"!"]
p                Print
 +               Addition
  [...........]  Argument list
   [......]        Standalone list
    u                Uppercase the first letter of..
     a               ..the string at dictionary index..
      +              ..42 (+) - 32 = 10, dictionary[10] = 'hello'
       ua,           Do the same as above for index 11, 'world'
                   End of list, standalone list concatenates its
                   contents as strings with ', ' as delimiter
           "!"     String literal
                 End of argument list, Addition also acts as string concat

Transpiled JS code:

console.log('Hello, World' + "!");
\$\endgroup\$
2
\$\begingroup\$

ARMv7 machine language on Linux, 40 36 32 bytes

 0: fa000002         blx 12          ;put string addr in lr; thumb mode
 4: 48 65 6c 6c 6f   "Hello, World!\0"
    2c 20 57 6f 72
    6c 64 21 00
12: 2001             movs r0, #1     ;stdout is fd=1
14: 220d             movs r2, #13    ;length of string
16: 4671             mov r1, lr      ;put string addr in r1
18: 2704             movs r7, #4     ;select write() syscall
1a: df00             svc 0           ;syscall
1c: 2701             movs r7, #1     ;select exit() syscall
1e: df00             svc 0           ;syscall

To try this out on a Raspberry Pi or Android device with GNURoot, compile and run the following

const char main[]="\2\0\0\xfaHello, World!\0\1 \r\"qF\4'\0\xdf\1'\0\xdf";
\$\endgroup\$
2
\$\begingroup\$

Incalculate (2.0), 21 bytes

"!dlroW ,olleH"[pov?]

Probably won't get shorter than this.
Incalculate is an esoteric language I have written for fun, don't expect anything fancy. It uses 3 stacks for storage.

\$\endgroup\$
2
\$\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\$ Oct 9, 2019 at 9:56
2
\$\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
2
\$\begingroup\$

Visual Basic Script, 21 bytes

MsgBox"Hello, World!"

You can try it by making a .txt file with that text in it, changing the extension to .vbs and running it.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Welcome to the site! As this is a very busy question, you should be aware that your answer may not be unique. However, it is just as valid either way. Would it be possible to edit in a link to an online testing site, such as Try it online! so that others can verify your answer? \$\endgroup\$ Aug 29, 2019 at 14:50
2
\$\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
2
\$\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\$
2
\$\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\$
2
\$\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\$
2
\$\begingroup\$

Roj, 18 bytes

I love this simple BASIC dialect ...

out"Hello, World!"

Explanation

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

C64 BASIC, 16 characters, 20 bytes

If HELLO, WORLD! is fine.

0?"HELLO, WORLD"
\$\endgroup\$
1
  • \$\begingroup\$ You don't mean the closing quotation mark when you PRINT In Commodore C64 BASIC, so you may save one character and one tokenised bytes by removing it. \$\endgroup\$ Jun 1, 2023 at 10:35
2
\$\begingroup\$

Jsonnet (with -S), 15 characters

"Hello, World!"

(Where -S stands for --string, meaning “Expect a string, manifest as plain text”.)

Sample run:

bash-5.0$ jsonnet -Se '"Hello, World!"'
Hello, World!
\$\endgroup\$
2
\$\begingroup\$

MathGolf, 14 bytes

'H╕○ô╣·'W╕7ÿ'!

Try it online.

Or alternatively just the plain and simply:

"Hello, World!

Try it online.

Explanation:

'H              '# Push "H"
  ╕○ô            # Push compressed "ello"
     ╣·          # Push compressed ", "
       'W       '# Push "W"
         ╕7ÿ     # Push compressed "orld"
            '!  '# Push "!"
                 # (implicitly output the entire stack joined together to STDOUT)

"Hello, World!  "# Push "Hello, World!"
                 # (implicitly output the entire stack joined together to STDOUT)
\$\endgroup\$
2
\$\begingroup\$

Rutger, 23 bytes

Print["Hello, World!"];

Try it online!

An old language of mine, and fairly basic, but included for comprehension.

\$\endgroup\$
3
  • \$\begingroup\$ Wiki writing time? \$\endgroup\$
    – Razetime
    Sep 22, 2020 at 15:18
  • \$\begingroup\$ @Razetime If I can find time among all the other language wikis I should be writing :P \$\endgroup\$ Sep 22, 2020 at 15:19
  • \$\begingroup\$ I'll figure it out once I'm done with the Add++ wiki, maybe. \$\endgroup\$
    – Razetime
    Sep 22, 2020 at 15:29
2
\$\begingroup\$

Befalse, 43 30 bytes

"!dlroW ,o"\
/?$\!"Hell"/
\. /

If this gets down to 1 line, it would be much shorter without all the spaces on the second line. I’ll golf this further.

Thanks to Jo King♦ for golfing this further. I think it can be golfed even more now.

\$\endgroup\$
1
  • \$\begingroup\$ I don't know much about Befalse, but you can do fold it back along the second line for 30 bytes or use the call and return commands for 31 bytes \$\endgroup\$
    – Jo King
    Nov 10, 2020 at 3:31
1
16 17
18
19 20
33

Your Answer

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

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