419
\$\begingroup\$

So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with , and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.

Furthermore, while all of Wikipedia (the Wikipedia entry has been deleted but there is a copy at archive.org ), esolangs and Rosetta Code have lists of "Hello, World!" programs, none of these are interested in having the shortest for each language (there is also this GitHub repository). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest "Hello, World!" programs (similar to how our basic quine challenge contains some of the shortest known quines in various languages). So let's do this!

The Rules

  • Each submission must be a full program.
  • The program must take no input, and print Hello, World! to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.
  • The program must not write anything to STDERR.
  • If anyone wants to abuse this by creating a language where the empty program prints Hello, World!, then congrats, they just paved the way for a very boring answer.

    Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

  • Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.
  • This is not about finding the language with the shortest "Hello, World!" program. This is about finding the shortest "Hello, World!" program in every language. Therefore, I will not mark any answer as "accepted".
  • If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf - these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.

For inspiration, check the Hello World Collection.

The Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the snippet:

## [><>](https://esolangs.org/wiki/Fish), 121 bytes

/* Configuration */

var QUESTION_ID = 55422; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.

/* App */

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

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

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

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

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

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

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

function process() {
  var valid = [];
  
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });
    
    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });
  
  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;
    
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

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

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

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

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

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

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

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
  <h2>Shortest Solution by Language</h2>
  <table class="language-list">
    <thead>
      <tr><td>Language</td><td>User</td><td>Score</td></tr>
    </thead>
    <tbody id="languages">

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

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

\$\endgroup\$
  • 2
    \$\begingroup\$ @isaacg No it doesn't. I think there would be some interesting languages where it's not obvious whether primality testing is possible. \$\endgroup\$ – Martin Ender Aug 28 '15 at 13:56
  • 6
    \$\begingroup\$ If the same program, such as "Hello, World!", is the shortest in many different and unrelated languages, should it be posted separately? \$\endgroup\$ – aditsu Aug 28 '15 at 15:33
  • 2
    \$\begingroup\$ @mbomb007 Well it's hidden by default because the three code blocks take up a lot of space. I could minify them so that they are a single line each, but I'd rather keep the code maintainable in case bugs come up. \$\endgroup\$ – Martin Ender Aug 28 '15 at 19:34
  • 7
    \$\begingroup\$ @ETHproductions "Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge." Publishing the language and an implementation before posting it would definitely be helpful though. \$\endgroup\$ – Martin Ender Aug 29 '15 at 23:01
  • 2
    \$\begingroup\$ @MartinEnder ... Almost. If two BF solutions have the same size, the one with smaller lexicographical order will take smaller number of bytes in Unary. Of course the smallest Unary solution translated to BF is guaranteed to be smallest. \$\endgroup\$ – user202729 May 20 '18 at 10:20

756 Answers 756

1
\$\begingroup\$

Dreaderef, 31 bytes

This file contains unprintables. Here is a reversible hexdump created with xxd:

00000000: 2206 4806 6506 6c06 6c06 6f06 2c06 2006  ".H.e.l.l.o.,. .
00000010: 5706 6f06 7206 6c06 6406 2106 5c6e 22    W.o.r.l.d.!.\n"

Try it online!

How does it work?

The reason this file is so unreadable is because it makes use of string literals to golf the code. The preprocessor expands string literals into their respective character values. The actual numbers this represents are:

6 72 6 101 6 108 6 108 6 111 6 44 6 32 6 87 6 111 6 114 6 108 6 100 6 33 6 10

6 is the command associated with chro (char output). So this code looks like this:

chro 72
chro 101
chro 108
chro 108
chro 111
chro 44
chro 32
chro 87
chro 111
chro 114
chro 108
chro 100
chro 33
chro 10
\$\endgroup\$
1
\$\begingroup\$

Rust, 34 bytes

fn main(){print!("Hello, World!")}

Short, Sweet, and simple.

I do not believe it's possible to make this program any smaller. If someone does, congratulations.

\$\endgroup\$
  • 1
    \$\begingroup\$ This has already been done, and with less bytes (actually, it's the exact same submission, but you miscounted here). \$\endgroup\$ – Esolanging Fruit Feb 2 '18 at 16:32
  • \$\begingroup\$ Nice to know. I'm new enough that I don't know if a search function exists for searching the answers (If one does, i can't find it) \$\endgroup\$ – moonheart08 Feb 2 '18 at 16:51
  • \$\begingroup\$ Some challenges, including this one, have a Javascript leaderboard snippet included in the question. (When there isn't, I don't know how to search well either.) \$\endgroup\$ – Ørjan Johansen Feb 2 '18 at 17:29
  • 2
    \$\begingroup\$ @ØrjanJohansen Searching for "Rust" answers on this question seems to work. \$\endgroup\$ – Esolanging Fruit Feb 2 '18 at 19:38
1
\$\begingroup\$

Ook!, 1426 bytes

Ook! is a joke esoteric programming language created by David Morgan-Mar. It is identical to Brainfuck, except that the instructions are changed into Orangutan words. It represents the first, although unfortunately not the last, in a long line of trivial Brainfuck command substitutions. As such, it is a member of the TrivialBrainfuckSubstitution family of programming languages.

Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
\$\endgroup\$
1
\$\begingroup\$

R16K1S60 Assembly, 56 Bytes

a:
mov bx, .b
.l:
mov ax, [bx]
send 4, ax
add bx, 1
cmp bx, .c
jne .l
.h:
hlt
jmp .h

.b: dw "Hello, World!"
.c: dw 14

Writes output to screen peripheral the R16K1S60 in ASCII. Runs on The Powder Toy save 2012356. (See link in header for info)

Note: How exactly should this be scored? I'm assuming just score the size of the ASM.

\$\endgroup\$
  • \$\begingroup\$ The link is a 404. I'd score the length of the resulting machine code, if that's a thing. \$\endgroup\$ – NieDzejkob Feb 8 '18 at 15:35
  • \$\begingroup\$ I'll try and get the length. I'll also fix the link. \$\endgroup\$ – moonheart08 Feb 8 '18 at 15:36
  • \$\begingroup\$ Code is 56 bytes compiled. I'll fix the byte count. However, i'm afraid a hexdump is beyond my reach at the moment, i don't know how the R16K1S60 encodes instructions on FILT, only that it uses 16 of the 48 available bits for it's word. \$\endgroup\$ – moonheart08 Feb 8 '18 at 15:40
1
\$\begingroup\$

Momema, 63 bytes

0-9*072*0101*0108*0108*0111*044*032*087*0111*0114*0108*0100*033

Try it online!

This is a golfed version of the Hello World program given by TIO. The only difference is that we store the value -9 (the cell which is memory-mapped for character-based I/O) in cell 0, and then use *0 (the value of cell 0) instead of -9 everywhere. This wouldn't save bytes except that Momema will parse a leading 0 on a string literal as a separate number, so you can write e.g. *0108 instead of -9 108. This saves a byte for every write.

As hinted above, the program consists of a series of writes of various codepoints to -9 (the address which is memory-mapped to perform character-based I/O). In ungolfed form, it looks like:

0   -9
*0  72
*0  101
*0  108
*0  108
*0  111
*0  44
*0  32
*0  87
*0  111
*0  114
*0  108
*0  100
*0  33
\$\endgroup\$
1
\$\begingroup\$

Crayon, 16 Bytes

"Hello, World!"q

Try it online!

\$\endgroup\$
  • 2
    \$\begingroup\$ Welcome to PPCG! \$\endgroup\$ – Martin Ender Feb 12 '18 at 12:07
1
\$\begingroup\$

Felix, 21 bytes

print"Hello, World!";

Try it online!

Somebody linked to this language on PPCG and I thought it was interesting. In the interest of getting to know the language, I thought I'd write some programs in it.

The Felix docs all use print$ x instead of print x because print is a procedure and not a keyword, so use of the Haskell-style low-precedence application operator $ allows a slightly more natural syntax (compare print (1 + foo(5)); with print$ 1 + foo(5);. I'm not sure I agree completely with this, but it's just a convention and as I'm on PPCG I can break it without feeling guilty.

print is Felix's function to output something, with no trailing newline.

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

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

print: "Hello, World!"

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

\$\endgroup\$
1
\$\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\$
1
\$\begingroup\$

Brat, 17 bytes

p "Hello, World!"

Try it online!

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

NEUPL, 14 bytes

"!dlrow ,olleH

Try it online

Explanation:

"!dlrow ,olleH
"               Begin pushing characters to the stack.
 !              Push the character "!" to the stack.
  d             Push the character "d" to the stack.
   l            Push the character "l" to the stack.
    r           Push the character "r" to the stack.
     o          Push the character "o" to the stack.
      w         Push the character "w" to the stack.
                Push the character " " to the stack.
        ,       Push the character "," to the stack.
         o      Push the character "o" to the stack.
          l     Push the character "l" to the stack.
           l    Push the character "l" to the stack.
            e   Push the character "e" to the stack.
             H  Push the character "H" to the stack.
                Implicitly stop pushing characters to the stack.
                Implicitly pop and print each character in the stack.
\$\endgroup\$
1
\$\begingroup\$

Dreaderef, 42 bytes

"??	?\r?0"-1"Hello, World!\n"

Try it online! This file contains unprintables. Hexdump:

00000000: 2201 1004 013f 0704 3f09 3f07 5c72 063f  "....?..?.?.\r.?
00000010: 0201 1510 0130 222d 3122 4865 6c6c 6f2c  .....0"-1"Hello,
00000020: 2057 6f72 6c64 215c 6e22                  World!\n"

There already is a Dreaderef submission, but this uses a different approach (looping through memory rather than printing out each character directly).

Ungolfed:

CODE.
; Dereference the string pointer
0.  deref 16 4
; End the program if the value pointed to is zero
3.  deref ? 7
6.  bool ? 9
9.  ? 7 13 ; Black magic
12. chro ?
; Increment the string pointer
14. add 1 21 16
; Go back to the beginning
18. deref 100 -1

DATA.
21. "Hello, World!\n"
\$\endgroup\$
1
\$\begingroup\$

Reflections, 41 bytes

_Hello, World!;#_#_#_#_#_#_#_#_#_#_#_#_#_

Test it!

Explanation:

  1. The _ at (0|0) pushes my source to the stack.
  2. Hello, World! consists of no-ops
  3. ; pops the first character.
  4. 13 times #_:
    1. # redefines (0|0)
    2. _ at (1|0) prints a character
\$\endgroup\$
1
\$\begingroup\$

DipDup, 15 bytes

[Hello, World!]

Try it online!

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

MachineCode on x86_64, 125 bytes

4889f8c60748c6470165c647036cc647026cc647046fc647052cc6470620c6470757c647086fc6470972c6470a6cc6470b64c6470c21c6470d00c3
sbrk()

Requires string output via the s flag. Try it online!

This language works like so:

  • The first line is machine code. This is translated to a C function.
  • The second line is C code. It specifies the arguments to the function created in line 1.
  • A command-line argument specifies how the function's return value is used.

So, the machine code is equivalent to:

char *a(char *s) {
    s[0]='H'; s[1]='e'; s[2]=s[3]='l'; s[4]='o'; s[5]=','; s[6]=' '; s[7]='W'; s[8]='o'; s[9]='r'; s[10]='l'; s[11]='d'; s[12]='!'; s[13]=0;
    return s;
}

I generated the machine code via my C lambda script.

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

QUARK, 46 bytes

33 100^8+^6+^3−87 32 44 111^3−^^7−72›I

Sets up the numbers in reverse order, with quick number twiddling used for the lowercase characters, as they are quite close together.

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

Dirty, 16 bytes

'Hello, World!'‼

Try it online!

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

Pyt, 40 39 bytes

89*2ᴇ⁺Đ7+ĐĐ3+5⬡⁻2⁵9²6+Đ4!+Đ3+Đ6-2ᴇĐ₃áƇǰ

Explanation:

89*                                                  Pushes 72 ('H')
   2ᴇ⁺                                               Pushes 101 ('e')
      Đ7+                                            Duplicates 101, then adds 7 ('l')
         Đ                                           Duplicates 108 ('l')
           Đ3+                                       Duplicates 108, then adds 3 ('o')
              5⬡⁻                                   Pushes 44 (',')
                  2⁵                                 Pushes 32 (' ')
                    9²6+                             Pushes 87 ('W')
                        Đ4!+                         Duplicates 87, then adds 24 ('o')
                            Đ3+                      Duplicates 111, then adds 3 ('r')
                               Đ6-                   Duplicates 114, then subtracts 6 ('l')
                                  2ᴇ                 Pushes 100 ('d')
                                    Đ₃               Duplicates 100, then divides by 3 (Python 2-style integer division)
                                      á              Replaces the stack with an array containing the stack's contents
                                       Ƈ             Cast to unicode characters
                                        ǰ            Join strings
                                                     Implicit print

Try it online!

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

R16K1S60, 42 40 bytes

Program:

C301 000D 0001 5180 2C20 A539 0008 5100 C589 00FF 4701 0003 1000 4865 6C6C 6F2C 2057 6F72 6C64 2100

Source:

[C301 000D] mov sp,hello ;set the stack pointer to the start of the message
[0001     ] dw 1 ;do nothing + skip next instruction
loop:
    [5180] send 0,cx ;output cx (skipped the first time)
    [2C20] pop bx ;read a value into register bx
    [A539 0008] shr bx,cx,8 ;copy bx into cx, shift bx 8 bits to the right
    [5100] send 0,bx ;output bx
    [C589 00FF] @flags and cx,0xFF ;get the lower 8 bits of cx
[4701 0003] jnz loop ;repeat if cx is not 0
[1000] hlt ;end

hello:
    [4865 6C6C 6F2C 2057 6F72 6C64 2100] db "Hello, World!" ;byte data
\$\endgroup\$
1
\$\begingroup\$

MachineCode, 68 62 bytes

e80d00000048656c6c6f2c20576f726c6421596a015b6a0d5a6a0458cd80c3

Credit to ceilingcat for finding this (and for the language inspiration). Try it online!


Here's a hacky version that isn't true machine code but works with my language.

MachineCode, 54 bytes

e80d00000H656c6c6f2c20576f726c6421596a1[6adZ6a4Xcd80c3

Abuses the current compiler's parser. Try it online!

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

Jstx, 2 bytes

₧P

Try it online!

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

Attache, 21 bytes

Print!"Hello, World!"

Try it online!

\$\endgroup\$
1
\$\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\$
  • \$\begingroup\$ as big as = is \$\endgroup\$ – Jo King Apr 9 '18 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 '18 at 2:58
1
\$\begingroup\$

Lorale 37 (36) bytes

This is a language I am making. It shouldn't count as a loophole, as I am making this legitimately, but a hello world program requires you to pass this to the interpreter as args:

;Main{§vmain(){¶"Hello, world!"}};

Alternatively, the program could be put into the semi-IDE as:

Main{§vmain(){¶"Hello, world!"}};

making it 36, not 37 bytes.

Main{                                 Defines the main class
     §v                               Defines a void
       main(){                                       named main
              ¶"Hello, world!";       Prints "Hello, world!"
                              }};     Closes the main method and class
\$\endgroup\$
  • \$\begingroup\$ I think that 36 is allowed. \$\endgroup\$ – Esolanging Fruit Apr 20 '18 at 2:17
1
\$\begingroup\$

Beatnik, 111 bytes

k zzzzzzzzc k xx k x k d k k k zzxa k zzzzzzzzf xw k zd z xw xo k k k x xw k zk
k zzzzzzzzzzxx qs z xo xw xj kd

Try it online!

Non-crashing version, 117 bytes

k zzzc xw xw z k xx k x k d k k k zzxa k zzzzzzzzf xw k zd z xw xo k k k x xw k zk
k zzzzzzzzzzxx qs z xo xw xj kd xo

Try it online!

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

Vala, 36 bytes

File hello.vala:

void main(){print("Hello, World!");}

...without trailing newline.

After a diet suggested by @ASCII-only.

Try it online!


Vala, 42 bytes

Yayyyy!!! 42!!! \o/

File hello.vala:

void main(){stdout.puts("Hello, World!");}

...without trailing newline.

Run:

$ valac hello.vala 
$ ./hello
Hello, World!
\$\endgroup\$
  • \$\begingroup\$ You can just use print \$\endgroup\$ – ASCII-only Apr 24 '18 at 12:50
1
\$\begingroup\$

Subskin, 47 bytes


48
6f
2
a
1
4
1
4


a
3
3

43
4f
18

-3
3
b
4e

Try it online!

So Ruby allows negative indices.

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

Zig, 81 bytes

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

Try it online!

\$\endgroup\$
  • \$\begingroup\$ This looks like an interesting language. The author appears to be aware of TIO! \$\endgroup\$ – Esolanging Fruit May 9 '18 at 4:09
1
\$\begingroup\$

IO, 20 Bytes

"Hello, World!"print

Other possibility, 21 22 Bytes

write("Hello, World!")
\$\endgroup\$
  • 3
    \$\begingroup\$ Welcome to PPCG! You can add a TIO link so everybody can run your program easily. \$\endgroup\$ – ovs May 5 '18 at 16:45
  • \$\begingroup\$ You can do the same in 19 bytes by removing the space between the string and print. \$\endgroup\$ – ovs May 5 '18 at 16:46
  • \$\begingroup\$ I wasn't knowing about TIO. Thanks for the link \$\endgroup\$ – Mesabloo May 5 '18 at 16:48
  • \$\begingroup\$ @ovs that doesn't have a comma >_> \$\endgroup\$ – ASCII-only May 6 '18 at 0:13
  • 1
    \$\begingroup\$ @ASCII I put the comma and removed the space as suggested so that it's still 20 bytes \$\endgroup\$ – Mesabloo May 6 '18 at 6:50
1
\$\begingroup\$

BrainfuckSubstitutor, 65 bytes

_--!+++?>>/<<
+[_>-[?+>__-/]<_<_-]>-.>?+.?..![.>]//.!.___./-.??+.

Based off KSab's Brainfuck answer.

\$\endgroup\$

Your Answer

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

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