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
26 27
28
29 30
33
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\$
1
  • 2
    \$\begingroup\$ Welcome to PPCG! \$\endgroup\$ Feb 12, 2018 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\$

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

Jstx, 2 bytes

₧P

Try it online!

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

Attache, 21 bytes

Print!"Hello, World!"

Try it online!

\$\endgroup\$
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\$
1
  • \$\begingroup\$ I think that 36 is allowed. \$\endgroup\$ Apr 20, 2018 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\$
1
  • \$\begingroup\$ You can just use print \$\endgroup\$
    – ASCII-only
    Apr 24, 2018 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\$

IO, 20 Bytes

"Hello, World!"print

Other possibility, 21 22 Bytes

write("Hello, World!")
\$\endgroup\$
5
  • 3
    \$\begingroup\$ Welcome to PPCG! You can add a TIO link so everybody can run your program easily. \$\endgroup\$
    – ovs
    May 5, 2018 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, 2018 at 16:46
  • \$\begingroup\$ I wasn't knowing about TIO. Thanks for the link \$\endgroup\$
    – Mesabloo
    May 5, 2018 at 16:48
  • \$\begingroup\$ @ovs that doesn't have a comma >_> \$\endgroup\$
    – ASCII-only
    May 6, 2018 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, 2018 at 6:50
1
\$\begingroup\$

BrainfuckSubstitutor, 65 bytes

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

Based off KSab's Brainfuck answer.

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

tinyBF, 94 bytes

+|=++=>=+=|>>+>=+++++>>|>++>+++|=>=+===>>>+==>>====+++|==>=|>>>>===+++===++++++==>>+===>>>>+==

Try it online!

I noticed there wasn't a tinyBF answer here. This is based on Ksab's record-breaking brainfuck answer.

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

2Col, 2 bytes

HW

Hooray, another boring answer using a Hello world builtin.

\$\endgroup\$
8
  • \$\begingroup\$ Does this print Hello, World! exactly or some variant of it? \$\endgroup\$
    – Beta Decay
    May 24, 2017 at 11:56
  • \$\begingroup\$ @BetaDecay prints it exactly, followed by a trailing newline \$\endgroup\$
    – Mayube
    May 24, 2017 at 12:15
  • \$\begingroup\$ Oh nice. A few answers have had built ins which don't print it correctly \$\endgroup\$
    – Beta Decay
    May 24, 2017 at 12:16
  • 1
    \$\begingroup\$ The general convention when it comes to hello world programs is Hello, World! so I made HW do exactly that. Of course I'm screwed if somebody asks me to print Hello World! or Hello World \$\endgroup\$
    – Mayube
    May 24, 2017 at 12:17
  • \$\begingroup\$ Can we get a link to more information about 2Col? [Edit: Nevermind I found the GitHub repo. github.com/gunnerwolf/2col] \$\endgroup\$
    – 3D1T0R
    May 29, 2018 at 16:24
1
\$\begingroup\$

HadesLang, 20 19 bytes

-1 byte thanks to Oliver

out:'Hello, World!'
\$\endgroup\$
4
  • \$\begingroup\$ Welcome to PPCG! The output should be Hello, World!, not Hello world!. Also, there's an escaped dot in your link; it is broken for me. \$\endgroup\$
    – Dennis
    May 31, 2018 at 19:55
  • \$\begingroup\$ Based on the docs, it looks like you can omit the brackets: out:'Hello, World!' \$\endgroup\$
    – Oliver
    May 31, 2018 at 20:08
  • \$\begingroup\$ Uppercase that w, and your answer will look valid :-) Also, welcome to PPCG, we're glad you're here! \$\endgroup\$
    – Oliver
    May 31, 2018 at 20:26
  • \$\begingroup\$ @Oliver Thanks! Will do! :) \$\endgroup\$
    – Azeros
    May 31, 2018 at 20:27
1
\$\begingroup\$

brainfuck, 137 bytes

++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++.>+.+++++++..+++.<<++++++++++++++.------------.>+++++++++++++++.>.+++.------.--------.<<+.

Try it online!


Explained :

++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++.                       H
>+.                                                                    e
+++++++..                                                             l l
+++.                                                                   o
<<++++++++++++++.                                                    comma
------------.                                                        space
>+++++++++++++++.                                                      W
>.                                                                     o
+++.                                                                   r
------.                                                                l
--------.                                                              d
<<+.                                                                   !

This can definitely be golfed. (World record is 72 bytes so I already know that)


This is basic hard coded answer, simply gets the Ascii value, resets and keeps going

brainfuck, 210 bytes

-[>+<-------]>-.[-]<-[>++<-----]>-.+++++++..[-]>+[+>+[<]>->]<.[-]--[>+<++++++]>+.[-]>-[-[-<]>>+<]>-.[-]-[>+<---]>++.[-]>+[+>+[<]>->]<.[-]>+[-->++[<]>-]>.[-]>+[++[++>]<<+]>+.[-]-[>++<-----]>--.[-]>-[-[-<]>>+<]>.

Try it online!

Explained :

-[>+<-------]>-.                                               H
[-]                                                             
<-[>++<-----]>-.                                               e
+++++++..                                                     l l
[-]                                               
>+[+>+[<]>->]<.                                                o
[-]
--[>+<++++++]>+.                                               ,
[-]
>-[-[-<]>>+<]>-.                                             space  
[-]
-[>+<---]>++.                                                  W
[-]
>+[+>+[<]>->]<.                                                o
[-]
>+[-->++[<]>-]>.                                               r
[-]
>+[++[++>]<<+]>+.                                              l
[-]
-[>++<-----]>--.                                               d
[-]
>-[-[-<]>>+<]>.                                                !
\$\endgroup\$
1
\$\begingroup\$

Thing, 37 bytes

Pushes the characters to the stack one by one (the second "l" is made with duplication, saving 1 byte), then concatenates them.

\!\d\l\r\o\W\ \,\o\ld\e\H++++++++++++

Try it online!

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

TapeBagel, 511 bytes

%% %++ %++ %++ %++ %++ %++ %++ %++ @* ## %++ %++ %++ %++ %++ @* ## %++
%++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ @* @* ## %++ %++ %++ %++
%++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ @* ## @* %++ %++ %++ %++
%++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++
%++ %++ @* ## %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++
%++ %++ @* ## %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++ %++
%++ %++ %++ %++ %++ @* ##  %++ %++ %++ %++ %++ %++ %++ %++ %++ %++
%++ %++ @* ## %++ %++ %++ %++ @* ##

%# - adds one to the integer index.

%% - resets the integer index to zero.

%& - the integer that the integer index is pointing to is inputted into the program.

#% - sets all of the integers to one.

## - resets all of the integers to zero.

&& - pauses the program.

&@ - clears the screen.

%++ - adds one to the integer that the integer index is pointing to

@[ int ] - outputs the integer as a character (1 = A, 2 = B, ... 26 = Z)

* - integer 0

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

Sisi, 21 bytes

0print"Hello, World!"

Try it online!

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

Q#, 43 bytes

function H():String{return"Hello, World!";}

Try it online!

Might as well put it out there. Q# is Microsoft's programming language for quantum computers, not that there's anything quantum happening here.

"Now hold on a moment! This isn't a complete program!"--You, probably.

Well, it's not actually possible to write a complete program in Q#. You always have to call it from a different language. So I'm just submitting a "function", although note that while Q# is a .NET language, the function keyword actually defines a class and not a method, and the submission is equivalent to the following C# code:

public class H : Operation<QVoid, String>, ICallable
{
    public H(IOperationFactory m) : base(m)
    {
    }

    String ICallable.Name => "H";
    String ICallable.FullName => "qsharp.H";
    public override Func<QVoid, String> Body => (__in) =>
    {
        return "Hello, World!";
    }

    ;
    public override void Init()
    {
    }

    public override IApplyData __dataIn(QVoid data) => data;
    public override IApplyData __dataOut(String data) => new QTuple<String>(data);
    public static System.Threading.Tasks.Task<String> Run(IOperationFactory __m__)
    {
        return __m__.Run<H, QVoid, String>(QVoid.Instance);
    }
}

You can use this link to "disassemble" Q#.

\$\endgroup\$
1
  • \$\begingroup\$ *transpile, not disassemble \$\endgroup\$
    – ASCII-only
    Dec 26, 2018 at 0:44
1
26 27
28
29 30
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.