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

13
\$\begingroup\$

Seed, 4154 4135 4117 4078 bytes

Possibly smallest one can create in finite amount of time.

Feersum's generator has been outscored by 125 digits.

18 1999111369209307333809858526699771101145468560828234645250681099656696029279480812880779443148152835266354745917034724622145903651417563371730237765283326056988244774110441802133624468817714160177386022056512108401823787027806425684398448067970193332644167536135089961308323052217690818659345826221618714547471817786824952177760705661213021136861627615564344797191592895410701640622192392412826316893318666484043376230339929937013414786228802341109250367744273459627437423609306999946689714086908789713031946200584966850579209651689981508129953665360591585003323062426849065928803791631705897655870676902001410564547259097078231664817435753967511921076054045034302323796976905054512737624542497156263914722954936458789312271946701667519720841308380062811251340113402138536813062807047486584549696366881131076129644333426157514410757991556230404583924322168740934746079177400690540383270574734570453863131129670312070568678426587468145691141064452504683450565188718043501125177371576228281599163415914580472091806809959254536307112226422637068036069837636348250796013947548859219492684001888592443619271863264913733271796439829896342322684180478385639971904415730730155249230972472713598001454701479081682503703435292522488015910406951417625194589254609756805750713606175216991897729604817653297756338264018378339186646236428245791304007449872675676823828828025054891324604572924113135541994460293993994930010757779465315482913805320566037487246911578188713647298779820394853314711728701462997760060773720597833413054385989484972761510228922232188763499675904892361201334056531237561182096332707820332381472154893517831468669407424867949853884550905603295504680929068346527584718316837786318710085149722173684889784734888358566137013072868037395888296895408992035862679921478330680631465096402120764369879221964359613565641652779510635224788673321444028128955312660697375763703507924497355056468329176678508797277505818080245055083627993568557883893217501909841992899324584338401263402065617507377073719573642373296064002058833488593469308722954567388945161866200094063588423591356962865924188962743278147095803148276100759174767606637848987740320689762075562393521992008413240632519860537097220403160035470139899869535541445941688033346042941342229305392639867768112643798588915164061012851035069872578424685533430920913310727097269791325370108354115267003538502506307401037702631576755065238836157990287620373910423088628131973441805618500402407032751005850768445522318425479521483938945040598642922742796671148454685792926662105094734939468210307429214048710552195412807154088634170043145174020299723624868716804740205833308025010299791473201989330179511900752421521748244324520372384555472905196933204791343923384985673930225356512632819977168423365518584516873151142795940198973519372718229122661025988052451376835210066645728260048500257088773609522352231828810506243886764860621803233068079848240668323783996022507908005888468315483796728648978952610219628600082949325089555677853995177602958596492703349550377871982505777660804519503438416790609328789548538308170189581940118961959513239411467871900221985235702327603132341245854941342838886675363828149587290416073764877392438738417021129652498464495269870868163299830870636019233313974206364225614175115905798645888824666280593535350493547833757379214088677125769505793280646751090271497879000895725329057103702349349795211071357094147037863458426851391499872003703049553149335378055054176480977774050198041879243243264959205957441742983643583697591926138999543475339555662645088503078864968452030049140027407987267835123806661736568594687416676322591834962173789578844522343172160526435025531896189408441645468352864002987706103448393710107805248652709736711528349633758515438315407447026188178510124322920110858766628704828773265703683997486487094455425009292414948853993709223752434073750917088611480305840639869649933404702780843770306859066070919534638022435125602050780767420448917941603557783974740312706609928585387278690009349321957381507513875981113699582062422293555869483805964659436085153933836036107786

Try it online!

\$\endgroup\$
  • 2
    \$\begingroup\$ I don't know Befunge nor Seed, but is there a reason both you and @feersum use the Befunge-98 program "9!dlroW ,olleH"ck,@ (20 bytes)? Won't the Befunge-98 Hello World answer posted here: "ck,@!dlroW ,olleH (which is 18 bytes) result in a shorter Seed program as well? \$\endgroup\$ – Kevin Cruijssen Sep 10 at 8:06
  • \$\begingroup\$ @KevinCruijssen you are mistaken. I'm not using the same program as feersum. \$\endgroup\$ – Krzysztof Szewczyk Sep 10 at 14:03
  • 3
    \$\begingroup\$ Also, the shorter befunge solution is incorrect - it starts with a leading space and no excalamation mark. To fix these issues, the program would be 19 bytes big - that's as much as the no-9 solution I've been working on. \$\endgroup\$ – Krzysztof Szewczyk Sep 10 at 14:12
  • \$\begingroup\$ Oh. Is the Python 3 program which converts Seed programs to Befunge from the Seed Esolang page in that case incorrect? Because when I decode feersum's Seed code I get the same Befunge program as when I decode your Seed code. (As I said, i don't know anything about Befunge nor Seed. I simply copy-pasted that Python 3 script and used it for your Seed code when I noticed there is a shorter Befunge answer posted..) \$\endgroup\$ – Kevin Cruijssen Sep 10 at 14:12
  • 1
    \$\begingroup\$ The output of the latest revision appears to be incorrect. \$\endgroup\$ – Dennis Sep 28 at 17:38
12
\$\begingroup\$

Fission, 17 bytes

R"Hello, World!";

or

;"!dlroW, olleH"L

or any cyclic permutation of the two. In Fission, we need the R or L to release an atom and get control flow going. " toggles print mode, which just prints everything encountered until switched off. Finally ; destroys the atom to avoid an infinite loop.

\$\endgroup\$
12
\$\begingroup\$

Packed 7-bit ASCII, 12

fÍëWßËfD 

Since Markdown eats some of the characters, here's a hexdump:

$ xxd hello.ascii 
0000000: 9197 66cd eb10 57df cb66 4420            ..f...W..fD 

And yes, the trailing space is necessary.

Packed 7-bit ASCII is created by taking 8-bit ASCII (the normal kind), removing the high zero bit from each byte, packing the remainder, and then padding it out with trailing zero bits.

According to this site, this character encoding is used by "a specific US MIL STD message header format", making it a real thing.

\$\endgroup\$
  • 2
    \$\begingroup\$ Is Packed ASCII a programming language on its own right? \$\endgroup\$ – user3819867 Aug 30 '15 at 16:04
  • \$\begingroup\$ @user3819867 It's an edge case. It depends on definitions. \$\endgroup\$ – isaacg Aug 30 '15 at 16:19
  • \$\begingroup\$ Packed 7-bit ASCII is the encoding SMS uses \$\endgroup\$ – slebetman Sep 1 '15 at 4:31
12
\$\begingroup\$

gs2, 2 bytes

\x12h

where \x12 is a raw byte.

\$\endgroup\$
12
\$\begingroup\$

Z80Golf, 19 bytes

00000000: 674a 4343 4003 0f78 405d 434b 0e76 7e23  gJCC@..x@]CK.v~#
00000010: e5ee 2f                                  ../

Try it online!

Z80Golf is, essentially, a Z80 machine hooked up to $8000=putchar and $8003=getchar. The source code is a binary copied to $0000 (all other memory is zeroed out, just like the registers); execution starts there and runs until a halt instruction.

It was designed by mokehehe on anarchy golf for code golf competitions there, but seems to have fallen into disuse. It's really fun to golf in, but excelling in it requires a pretty thorough understanding of the Z80 chip (that I myself don't even have, but some golfers like kodera and *yuko* do, and every solution they write is very clever.)

A naïve Hello, World! program might look like this:

start:
  ld a, (ix+hello)
  or a
  jr nz, okay
  halt
okay:
  call $8000  ; putchar
  inc ix
  jr start
hello:
  db "Hello, World!"

It assembles into a 27 byte binary. It even cheats a little bit: we don't need to explicitly zero-terminate the string "Hello, World!" ourselves, as all the memory past our source code is zeroed already. And it's still a fair bit longer than our 19-byte solution.

So how does the 19-byte solution work?

It doesn't look much like a Hello, World! program when disassembled:

  ld h,a
  ld c,d
  ld b,e
  ld b,e
  ld b,b
  inc bc
  rrca
  ld a,b
  ld b,b
  ld e,l
  ld b,e
  ld c,e
  ld c,0x76
  ld a,(hl)
  inc hl
  push hl
  xor 0x2f

We can look at the program in a slightly more revealing manner.

  db 47 ^ 'H'  ; 67  ld h, a
  db 47 ^ 'e'  ; 4a  ld c, d
  db 47 ^ 'l'  ; 43  ld b, e
  db 47 ^ 'l'  ; 43  ld b, e
  db 47 ^ 'o'  ; 40  ld b, b
  db 47 ^ ','  ; 03  inc bc
  db 47 ^ ' '  ; 0f  rrca
  db 47 ^ 'W'  ; 78  ld a, b
  db 47 ^ 'o'  ; 40  ld b, b
  db 47 ^ 'r'  ; 5d  ld e, l
  db 47 ^ 'l'  ; 43  ld b, e
  db 47 ^ 'd'  ; 4b  ld c, e
  db 47 ^ '!'  ; 0e  ld c,
  halt         ; 76        $76
  ld a, (hl)
  inc hl
  push hl
  xor 47
               ; 32749 nop instructions, and then:
               ; putchar(A)
               ; ret

Whenever the PC becomes $8000, Z80Golf is programmed to write the byte in register A to STDOUT, and then effectively execute a ret (the PC is set to (SP) and SP is incremented by 2). In our code, instead of using call $8000 to access this behavior, we let the PC wade through a sea of nops (opcode 00) from $0013 to $7fff.

Keeping this in mind, the code will run as follows:

  • Execute some meaningless instructions (effectively NOPs), starting from ld h,a.
  • Set A to mem[0] ^ 47, which is 'H'.
  • Increment HL and push it ($0001).
  • Fall through to putchar, and return to the $0001 we pushed.
  • Execute some meaningless instructions, starting from ld c,d this time.
  • Set A to mem[1] ^ 47, which is 'e'.
  • Increment HL and push it ($0002).
  • Fall through to putchar, and return to the $0002 we pushed.
  • Set A to mem[12] ^ 47, which is '!'.
  • Fall through to putchar, and return to the $000d we pushed.
    • We finally jump into the argument of the ld c, $76 — and $76 is the halt opcode!

Of course, the constant 47 was carefully picked so that none of the first instructions 13 influence the execution of the code, and the last one is some opcode that takes a single-byte argument, “hiding” the halt opcode until we jump there after printing '!'.

\$\endgroup\$
11
\$\begingroup\$

BBC BASIC, 20 bytes

PRINT"Hello, World!"

Ahh, this was my first language :)

\$\endgroup\$
  • \$\begingroup\$ so BBC Basic does not accept ? as a shorhand for print? \$\endgroup\$ – edc65 Aug 28 '15 at 14:27
  • \$\begingroup\$ @edc65 I have no idea... I'll try \$\endgroup\$ – Beta Decay Aug 28 '15 at 14:28
  • \$\begingroup\$ @edc65 It doesn't work in BBC BASIC for Windows \$\endgroup\$ – Beta Decay Aug 28 '15 at 14:53
  • \$\begingroup\$ Strange, as it's quite standard in basic. A posted an answer as VBA \$\endgroup\$ – edc65 Aug 28 '15 at 14:59
  • 1
    \$\begingroup\$ @edc65, The "?" is NOT accepted, seems it conflicts with BBC Basic's PEEK() variant. But this is: P."Hello, World!" \$\endgroup\$ – user3710044 Mar 19 '17 at 8:31
11
\$\begingroup\$

PDP-11 (Unix) Assembly, 33 38 bytes

Source (No trailing newline required):

sys 4;10;15;sys 1;<Hello, World!>

Binary output:

0000000 000407 000026 000000 000000 000000 000000 000000 000000
0000020 104404 000010 000015 104401 062510 066154 026157 053440
0000040 071157 062154 000041 000000 000000 000000 000000 000000
0000060 000000 000000 000000 000000 000000 000000
0000074

The output is zero-padded to 60 bytes for some reason, but I know enough about the architecture to know that it doesn't matter and can be considered 38 (maybe 37) bytes. Unfortunately, while this works on the terminal, it actually prints to STDIN.

So, a correct program (I believe it exits with status 1, but that's not important) is:

5200;sys 4;12;15;sys 1;<Hello, World!>

That 5200 in the beginning is actually an "inc r0" instruction, but writing it in octal is shorter. Coincidentally, the length of this source code is also 38 bytes.

0000000 000407 000030 000000 000000 000000 000000 000000 000000
0000020 005200 104404 000012 000015 104401 062510 066154 026157
0000040 053440 071157 062154 000041 000000 000000 000000 000000

Output clocks in at 20 non-zero words, or 39 non-zero bytes, and this time the assembler doesn't insert quite as much padding so the actual output file size is 48 bytes.

Unobfuscated source for the same program:

inc r0
sys write; 0f; 13.
sys exit
0: <Hello, World!>

If you actually assemble this source the output has an extra nonzero byte (value 2) in the second-last word of the output, probably something to do with the fact that named symbols were used for the system calls.

\$\endgroup\$
  • \$\begingroup\$ So is your answer optimized for short machine code, or for short source? Or both? Maybe post two header lines, one for the machine-code count and one for the asm source count? \$\endgroup\$ – Peter Cordes Apr 13 '18 at 0:52
11
\$\begingroup\$

Sed, 14 bytes

I'm hoping the sed exemption from no-input-rules applies here. If so, we can do:

cHello, World!

All that is required as input is one empty line.

\$\endgroup\$
  • \$\begingroup\$ cHello, World! \$\endgroup\$ – Mitch Schwartz Aug 28 '15 at 18:28
  • 1
    \$\begingroup\$ @MitchSchwartz excellent - I've never used the c sed command before - thanks! \$\endgroup\$ – Digital Trauma Aug 28 '15 at 18:56
  • \$\begingroup\$ Something like sed -e 'cHello, World!' <<<'' \$\endgroup\$ – F. Hauri Dec 9 '18 at 13:41
11
\$\begingroup\$

GNU Make, 27

$(info Hello, World!)
a:;@:
\$\endgroup\$
  • \$\begingroup\$ You can stick these two lines together, in either order, on one line to eliminate one more char. \$\endgroup\$ – user3710044 Mar 19 '17 at 8:48
11
\$\begingroup\$

Fortran, 28 bytes

print'("Hello, World!")'
end

You can't write print*,"Hello, World!" because there's a leading space in the default print format. Thus, we pass in our own format that simply contains a constant string.

\$\endgroup\$
  • \$\begingroup\$ Which version of Fortran is this? In F77 you'd need some spacing if I'm not mistaken. \$\endgroup\$ – Robert Benson Jul 19 '16 at 12:37
  • \$\begingroup\$ @RobertBenson F77 would also require fixed form if I'm not mistaken. In any case, this works in GFortran. tio.run/##S8svKilKzNNNT4Mw/v8vKMrMK1HXUPJIzcnJ11EIzy/… \$\endgroup\$ – Dennis Jun 6 '17 at 6:24
  • \$\begingroup\$ Yes, F77 is fixed format, so you'd need some tabs, which adds to byte-count :( \$\endgroup\$ – Robert Benson Jun 7 '17 at 15:10
  • \$\begingroup\$ GFortran: print*,"Hello, World!";end 26 bytes, but it prefixes a space char :( \$\endgroup\$ – roblogic Aug 27 at 9:55
11
\$\begingroup\$

VSL, 35 33 bytes

Saved 2 bytes thanks to @ASCII-Only

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

Try it online!

Okay after over one year development, the day has come where I can post this :D

There is a print("Hello, World!") function but this is shorter. As I seperate libc and libvsl this will probably have to switch over to print but for now this is the shortest.

\$\endgroup\$
  • \$\begingroup\$ Using fn can save two bytes \$\endgroup\$ – ASCII-only Apr 11 '18 at 3:16
10
\$\begingroup\$

Javascript, 22 bytes

alert("Hello, World!")

You don't NEED semicolons in Javascipt!

\$\endgroup\$
  • \$\begingroup\$ Don't you need them? \$\endgroup\$ – OldBunny2800 Apr 14 '16 at 21:19
  • \$\begingroup\$ Apparently not for 1 liners (I don't know JS golfably) \$\endgroup\$ – Blue Apr 14 '16 at 21:21
  • 1
    \$\begingroup\$ The JS interpreter will automatically insert them where it thinks they should be, if they aren't present \$\endgroup\$ – MayorMonty May 8 '16 at 22:54
  • \$\begingroup\$ It does not print to stdout like the spec says \$\endgroup\$ – Valentin Lorentz Jun 1 '16 at 19:45
  • 1
    \$\begingroup\$ @ValentinLorentz Javascript doesn't have a stdout - I used the nearest alternate; see Default for Code Golf: Input/Output methods \$\endgroup\$ – Blue Jun 1 '16 at 19:48
10
\$\begingroup\$

C#, 85 67 bytes

class P{static void Main(){System.Console.Write("Hello, World!");}}

I guess it cannot get worse. Did not even beat Java this time.

\$\endgroup\$
  • 7
    \$\begingroup\$ class P{static void Main(){System.Console.WriteLine("Hello, World!");}} -- 71 bytes. More golfing you must do young padawan. \$\endgroup\$ – Stephan Schinkel Aug 28 '15 at 13:36
  • 7
    \$\begingroup\$ You don't need to specify the accessibility modifiers, C# will use defaults so you can remove both instances of public . You can also use the Write method on Console to save a few more bytes. \$\endgroup\$ – user20151 Aug 28 '15 at 13:36
  • 4
    \$\begingroup\$ The newline in the output is optional, so use Write instead of WriteLine to save 4 bytes \$\endgroup\$ – SLuck49 Aug 28 '15 at 15:49
  • \$\begingroup\$ Yeah, a lang of Microsoft is worse than Java! \$\endgroup\$ – Mega Man Jul 18 '16 at 18:23
10
\$\begingroup\$

Pancake Stack, 1118 1073 bytes

Put this supercalifragilisticexpialidociouseventhoughthesoundofitissomethingquite pancake on top!
Show me a pancake!
Put this floccinaucinihilipilification pancake on top!
Put the top pancakes together!
Show me a pancake!
Put another pancake on top!
Put this piquant pancake on top!
Put the top pancakes together!
Show me a pancake!
Show me a pancake!
Put another pancake on top!
Put this big pancake on top!
Put the top pancakes together!
Show me a pancake!
Put this osteosarchaematosplanchnochondroneuromuelous pancake on top!
Show me a pancake!
Put this kolmivaihdekilowattituntimittari pancake on top!
Show me a pancake!
Put the top pancakes together!
Put this scrumptious pancake on top!
Put the top pancakes together!
Show me a pancake!
Eat the pancake on top!
Show me a pancake!
Put this big pancake on top!
Put the top pancakes together!
Show me a pancake!
Eat the pancake on top!
Show me a pancake!
Eat the pancake on top!
Take off the syrup!
Show me a pancake!
Put this nonilfenossipolietilenossietonolo pancake on top!
Show me a pancake!
Eat all of the pancakes!

I've been avoiding this one because I haven't found a good way of golfing it yet, but here's a submission for now.

The relevant operations are:

Instruction                               Result
--------------------------------------------------------------------------
Put this X pancake on top!                Push word length of X to stack
Eat the pancake on top!                   Pop and discard
Put the top pancakes together!            Add top two
Put another pancake on top!               Duplicate
Show me a pancake!                        Print as ASCII without popping
Take off the syrup!                       Decrement all stack values by 1
Eat all of the pancakes!                  Terminate program

If you take a look a Pancake Stack's full instruction set, you'll notice that you only ever have access to the top two stack elements at any time, which makes this language a pain to program in normally. That and the fact that you can only output as ASCII, i.e. no numeric output.

Note that, if you're using the Python interpreter, you'll need an extra line with a ~ afterwards if you want to test by piping in a file. We don't use it here, but anything after the ~ is treated as normal STDIN input.

\$\endgroup\$
10
\$\begingroup\$

???, 96 bytes

,;;..;...;.;,,,,;,,"......";...........-,'",-.";;,,,,!;...!;,!!...!;;;!-!-!-!...!,,,,,,!-,!;;;.!

Based on the 95-byte approach by Mitch Schwartz.

Note that the 92-byte Brainfuck solution would yield 97 bytes in ???, because the sequential loops require four more apostrophes.

\$\endgroup\$
  • 24
    \$\begingroup\$ This is... wait, wrong challenge. \$\endgroup\$ – Dennis Aug 29 '15 at 4:38
  • \$\begingroup\$ 80 bytes \$\endgroup\$ – ASCII-only Apr 12 '18 at 5:24
10
\$\begingroup\$

Ziim, 1222 bytes

In an unexpected turn of events, I'm counting this submission in UTF-16.

↘ ↓↘↘↘↘↙↓↘↘ ↙↓↘ ↓↘ ↙↘←↓ ↘↘↙↓↘↘↘↙↓↘↘↘↘↙↓↘↘↘↘↙↓ ↘↘↙↓↘↘↙↓↘ ↙ ↘ ↓↘ ↙↘←↓↘ ↙ ↘ ↓ ↘↘↙↓↘↘↙↓↘↘↘↘↙↓ ↘ ↙↘←↓↘ ↙ ↘ ↓ ↘ ↙ ↘ ↓↘↘↙↓↘↘↘↙↓↘↘↘↙↓↘↘ ↙↓↘←↓↘ ↙↓↘ ↓↘↘↙↓ ↘↘↙↓↘↘↙↓↘ ↙↘←↓↘ ↙↘←↓ ↘ ↙↘←↓ ↘↘↙↓↘↘↙↓ ↘ ↙ ↘ ↓↘↘ ↙ ↘ ↓↘ ↙↓↘←
↓→↘ ↑↑↓→↘ ↑↓  ↓→↘ ↓↓↓→↘↘ ↓→↘ ↑↓→↘ ↑↑↓→↘ ↑↑↓→↘↘ ↓→↘ ↓→↘ ↓↓↓↓→↘ ↓↓↓→↘ ↓↓↓↓→↘↘ ↓→↘ ↓→↘ ↑↑↓→↘↘ ↓↓↓→↘ ↓↓↓↓→↘↘ ↓↓↓↓→↘ ↓→↘ ↑↓→↘ ↑↓→↘ ↑↓  ↓→↘ ↓  ↓→↘ ↓→↘↘ ↓→↘ ↓→↘ ↓↓↓→↘ ↓↓↓→↘↘ ↓↓↓→↘↘ ↓→↘ ↓→↘↘ ↓↓↓↓→↘ ↑↓↓↓↓→↘ ↓  ↓→
↗  ↑↖ ↗  ↑↖↗↑↗↗  ↑↗↗↗  ↑↑↗  ↑↖↗  ↑↖ ↗  ↑↖ ↗  ↑↑↗  ↑↗  ↑↗↗↗↗  ↑↗↗↗  ↑↗↗↗↗  ↑↑↗  ↑↗  ↑↖ ↗  ↑↑↗↗↗  ↑↗↗↗↗  ↑↑↗↗↗↗  ↑↗  ↑↖↗  ↑ ↗  ↑↖↗↑↗↗  ↑↗↑↗↗  ↑↗  ↑↑↗  ↑↗  ↑↗↗↗  ↑↗↗↗  ↑↑↗↗↗  ↑↑↗  ↑↗  ↑↑↗↗↗↗  ↑↖↗↗↗↗  ↑↗↑↗↗

Because the code snippet above will likely not render in a very readable manner for you (either because of missing characters, or because the diagonal arrows aren't as monospaced as they should be), here is an image of the solution. I've marked the concatenators where a new byte starts in red:

enter image description here
Click for larger version

Well, this is a bit embarrassing. I spent quite some time on this solution, and at 610 characters, it is 267 characters shorter than the one on the esolangs page. However, it contains a lot more arrows, and because those are 3 bytes in UTF-8, it's actually longer than the one on esolangs (1516 vs 1345). But because this solution is so dense and contains far more arrows than spaces, I'm actually saving bytes by using UTF-16 and counting each character as two bytes.

Anyway, regardless of how we're counting, this is far from optimal. The above code is entirely linear, and builds one bit at a time. So I'm not reusing any bitstrings (like I could for the ls or os or even other substrings). I chose this approach because I wanted to start with something where it would be easier to pack the arrows very densely. If one used a more square layout, one could make use of a lot more repetition in the output (on a bit level), and thereby make massive savings.

\$\endgroup\$
  • \$\begingroup\$ Most 2d languages are generally scored by the area of the bounding box, why not do that here? \$\endgroup\$ – SuperJedi224 Jan 29 '16 at 17:31
  • \$\begingroup\$ @SuperJedi224 [citation-needed]? I've never scored any 2D language like that and the only one which I've seen like that is Piet where I think that's not how we should do it. \$\endgroup\$ – Martin Ender Jan 29 '16 at 17:40
  • \$\begingroup\$ I've definitely seen befunge and <>< scored that way before, and that's how I've generally been scoring BotEngine. \$\endgroup\$ – SuperJedi224 Jan 29 '16 at 17:56
  • \$\begingroup\$ @SuperJedi224 if I saw that I would recommend changing it. Programs should be scored by the size of the source file and I don't know any 2D language that chokes on omitted trailing spaces. Plus, if a submission did use up the entire bounding box, you wouldn't be counting any bytes for the aspect ratio of the grid, which is also important information. \$\endgroup\$ – Martin Ender Jan 29 '16 at 18:11
10
\$\begingroup\$

Carrot (version: ^3), 13 bytes

Carrot is a language of Κριτικσι Λίθος. The syntax is stack^commands, where the stack is a string, and the interpreter outputs everything that's on the stack at the end of the program. The carrot is optional if you have no commands.

Hello, World!

In version ^, the carrot wasn't optional yet if you had no commands, so then it was 14 bytes:

Hello, World!^
\$\endgroup\$
  • 1
    \$\begingroup\$ +6 carrot.png \$\endgroup\$ – Addison Crump Nov 1 '15 at 18:11
  • \$\begingroup\$ Write the version number as "^". \$\endgroup\$ – Cows quack Nov 2 '15 at 5:51
  • \$\begingroup\$ @ΚριτικσιΛίθος Sure! Done. \$\endgroup\$ – ProgramFOX Nov 2 '15 at 6:40
  • \$\begingroup\$ Version ^3 makes the ^ optional is you do not want to use any commands. Thus this can be shortened down by one byte. \$\endgroup\$ – Cows quack Nov 3 '15 at 8:40
  • \$\begingroup\$ @ΚριτικσιΛίθος Cool! Added that. \$\endgroup\$ – ProgramFOX Nov 3 '15 at 8:43
10
\$\begingroup\$

Labyrinth, 46 45 40 bytes

72.10:1.:8:..:):1:.#2#4..:1..4.:8.0.33.@

Try it online!

Labyrinth is my new two-dimensional programming language (although the 2D'ness isn't really used here). Labyrinth operates on two stacks (although this code only uses one). Each character is a separate command. However, as opposed to most similar languages individual digits don't push that digit (which makes it annoying to build up larger numbers), instead they multiply the top of the stack by 10 before adding themselves. This allows you simply to write out the numbers you want to push. (Another language with this concept is Emmental.)

The other commands you need to know for the above code are . which prints the top of the stack (modulo 256), : which duplicates the top of the stack, ) which increments it and # which pushes the current stack depth. @ terminates the program. There's only one tricky part: W is printed by appending a 1 to 111 (o), because 1111 % 256 = 87.

Here is what the stack and output look like throughout the program:

Command(s)  Stack               Output
72          [72]                ><
.                               >H<
10          [10]                >H<
:           [10 10]             >H<
1           [10 101]            >H<
.           [10]                >He<
:           [10 10]             >He<
8           [10 108]            >He<
:           [10 108 108]        >He<
..          [10]                >Hell<
:           [10 10]             >Hell<
)           [10 11]             >Hell<
:           [10 11 11]          >Hell<
1           [10 11 111]         >Hell<
:           [10 11 111 111]     >Hell<
.           [10 11 111]         >Hello<
#           [10 11 111 3]       >Hello<
2           [10 11 111 32]      >Hello<
#           [10 11 111 32 4]    >Hello<
4           [10 11 111 32 44]   >Hello<
..          [10 11 111]         >Hello, <
:           [10 11 111 111]     >Hello, <
1           [10 11 111 1111]    >Hello, <
..          [10 11]             >Hello, Wo<
4           [10 114]            >Hello, Wo<
.           [10]                >Hello, Wor<
:           [10 10]             >Hello, Wor<
8           [10 108]            >Hello, Wor<
.           [10]                >Hello, Worl<
0           [100]               >Hello, Worl<
.           []                  >Hello, World<
33          [33]                >Hello, World<
.           []                  >Hello, World!<
@
\$\endgroup\$
  • 1
    \$\begingroup\$ This maybe could be golfed more if you allow the code to intersect itself. \$\endgroup\$ – TheNumberOne Aug 29 '15 at 14:24
  • \$\begingroup\$ I really don't understand why "1111" is a "W". The ascii code for 'W' is 87. Can somebody explain this to me? \$\endgroup\$ – Robert Hickman May 25 '17 at 15:29
  • \$\begingroup\$ Oh, I see the explanation in the description, but I wasn't aware that . did a % 256 before printing. \$\endgroup\$ – Robert Hickman May 25 '17 at 15:41
10
\$\begingroup\$

ELF 32-bit LSB executable (Linux), 59 bytes

0000000: 7f 45 4c 46 01 00 00 00 00 00 00 00 00 90 43 0d  .ELF..........C.
0000010: 02 00 03 00 19 90 43 0d 19 90 43 0d 04 00 00 00  ......C...C.....
0000020: b9 2e 90 43 0d b2 0d cd 80 cc 20 00 01 00 48 65  ...C...... ...He
0000030: 6c 6c 6f 2c 20 57 6f 72 6c 64 21                 llo, World!

This exits with INT 3 (breakpoint), so your shell may display a message to indicate this. However, the program itself prints nothing to STDERR.

Try it online!

Verification

$ cksum hw32
3205536342 59 hw32
$ ./hw32
Hello, World!Trace/breakpoint trap
$ ./hw32 | cat; echo
Hello, World!
$ ./hw32 | xxd -g 1
0000000: 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21           Hello, World!
\$\endgroup\$
  • \$\begingroup\$ or echo $(./hw32) \$\endgroup\$ – F. Hauri Dec 9 '18 at 13:53
10
\$\begingroup\$

LLVM IR 4.0.1, 149 145 152 bytes

declare i8@puts(i8*)@t=global[14 x i8]c"Hello, World!\00"define void@main(){call i8(i8*)@puts(i8*getelementptr([14 x i8],[14 x i8]*@t,i1 0,i1 0))ret void}

I'm not very good in LLVM IR, so chances are good, that it's possible with fewer bytes.

Ungolfed Version:

declare i8 @puts(i8*) ; Declare puts from C standard. i8, was the shortest return type possible.

@t=global [14 x i8] c"Hello, World!\00" ; Hello world string as global, to have a pointer to it.

define void @main(){
    call i8(i8*) @puts(i8* getelementptr([14 x i8], [14 x i8] *@t, i1 0, i1 0)) ; Get pointer to constant "Hello, World!" and pass it to puts
    ret void
}
\$\endgroup\$
  • \$\begingroup\$ would int main be smaller, with ret 0 instead of ret void? I don't know LLVM IR at all, really >.< \$\endgroup\$ – Peter Cordes Apr 13 '18 at 0:54
10
\$\begingroup\$

Hexagony, 30 29 bytes

H;_e;r;2l.;P.QW;l/P1;@;0d;\o;

Try it online!

Source laid out:

    H ; _ e
   ; r ; 2 l
  . ; P . Q W
 ; l / P 1 ; @
  ; 0 d ; \ o
   ; . . . .
    . . . .

One more byte off!

Here's a crappy gif of the program in action.

29 byte gif

Given there's 2 nops inside the program itself, I'm confidant this can be golfed by at least one more byte. I'm willing to offer a bounty for a smaller version.

Old version:

H;e;r;0Pld;P_1;l;;o;Q\;W\;$2@\

Try it online!

Source laid out:

    H ; e ;
   r ; 0 P l
  d ; P _ 1 ;
 l ; ; o ; Q \
  ; W \ ; $ 2
   @ \ . . .
    . . . .

Reuses the same tricks as Martin Ender's answer, i.e Q2 printed is the comma, P0 is the space, P1 is the bang, but manages to be 2 bytes shorter through clever mirroring to reuse several ;s and the o.

Explanation:

Here's a coloured Hexagony grid to show the non-branching path that the pointer takes:

30 byte path

The executing code, ignoring mirrors, is:

H;e;l;;o;Q2;P0;W;d$;o;$2r;0Pl;Wd;P1;@

Filtering out the skipped instructions and the literals that are overwritten by other literals, we are left with:

H;e;l;;o;Q2;P0;W;o;r;l;d;P1;@

Which simply prints "Hello, World!"

After a few attempts, I gave up on a size 3 Hexagony answer. You need a minimum of 12 instructions out of 19 reserved for string literals, along with three ;s for printing and one @ for ending the program. This leaves only 3 spaces for IP management and memory management, provided you find the optimal path that reuses both the o and the l. From all this, I'll rule that a size 3 answer is impossible, though I'll give a sizable bounty to anyone who proves me wrong.

\$\endgroup\$
  • 1
    \$\begingroup\$ I posted a shorter solution. \$\endgroup\$ – user202729 May 19 '18 at 13:55
  • 1
    \$\begingroup\$ I came up with a 25-byte solution by hand - this will be my first answer here! I'm a bit miffed now to find this has already been beaten, albeit by brute force. Up until half an hour ago i thought Martin's original post was the only one for Hexagony. Still, my approach is different from the others. Hope to post soon although it may have to wait till Saturday when I get back from vacation and have access to my computer again. \$\endgroup\$ – Oliphaunt Aug 22 '18 at 20:29
  • \$\begingroup\$ @Oliphaunt It's been a while, but I noticed you never posted your 25 byte solution. Do you still have it or remember it? \$\endgroup\$ – Jo King Sep 26 at 2:51
9
\$\begingroup\$

R, 20 bytes

cat("Hello, World!")
\$\endgroup\$
9
\$\begingroup\$

Mouse, 19 bytes

"Hello, World"33!'$

Oddly enough, ! inside of a string makes a newline, so we have to work around that by getting the ASCII code for !, which is 33, and outputting that as a character.

\$\endgroup\$
9
\$\begingroup\$

Prelude, 38 bytes

92480969393782833909095806(^+^+^^+++!)

If you're using the Python interpreter, you'll need to make sure that NUMERIC_OUTPUT is set to False.

Prelude is a relatively simple stack-based language, with 0-9 pushing the corresponding single digits and the only arithmetic being addition and subtraction. In particular, there is no multiplication.

To make the most of the single digit pushing behaviour, I took a look at the code points in various bases. For base 12, we get this:

[[6 0] [8 5] [9 0] [9 0] [9 3] [3 8] [2 8] [7 3] [9 3] [9 6] [9 0] [8 4] [2 9]]

Everything here is a single digit - that's perfect! This means that we can encode each character using two digits via base 12, e.g. H -> 72 (base 10) -> 60 (base 12). That's what the long string of 26 digits at the beginning is for.

The back half of the code then needs to take each pair of digits a, b and give 12*a+b. But remember, Prelude doesn't have multiplication! What it does have, however, is ^ and v, which get the top stack values from the program rows ("voices") above and below. Since this is a one-line program, ^ effectively duplicates the top of the stack, allowing us to do ^+^+^^++ to multiply the top stack element by 12. We then add the second digit with + and output with !. All of this is wrapped in (), which is a BF-like loop which executes while the top stack element is nonzero.

\$\endgroup\$
9
\$\begingroup\$

Emotinomicon, 18 characters / 30 bytes

Try it here.

😭!dlroW ,olleH😲⏪⏬⏩

Explanation:

😭  !dlroW ,olleH   😲  ⏪   ⏬   ⏩   explanation
😭                                   begin quote string
    !dlroW ,olleH                   
                    😲               end quote string
                        ⏪           open loop
                            ⏬       pops and outputs top of stack as character
                                ⏩   close loop
\$\endgroup\$
9
\$\begingroup\$

Foo, 14 bytes

"Hello, World!

Not printing Hello World seems to be a lot harder in Foo that the opposite...

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Would s print Hello World? ;) \$\endgroup\$ – OldBunny2800 Apr 14 '16 at 21:18
  • \$\begingroup\$ Probably. \$\endgroup\$ – Dennis Apr 14 '16 at 21:20
  • \$\begingroup\$ If you find out, you might be able to golf it down to 0 or 1 byte! \$\endgroup\$ – OldBunny2800 Apr 14 '16 at 21:22
9
\$\begingroup\$

ELF 64-bit LSB executable (Linux), 104 bytes

0000000: 7f 45 4c 46 02 01 01 03 b0 04 b3 01 b2 0e eb 18  .ELF............
0000010: 02 00 3e 00 01 00 00 00 08 00 40 00 00 00 00 00  ..>.......@.....
0000020: 30 00 00 00 00 00 00 00 b9 48 00 40 00 90 eb 30  0........H.@...0
0000030: 01 00 00 00 01 00 38 00 01 00 00 00 00 00 00 00  ......8.........
0000040: 01 00 40 00 00 00 00 00 48 65 6c 6c 6f 2c 20 57  ..@.....Hello, W
0000050: 6f 72 6c 64 21 0a 00 00 6f 72 6c 64 21 0a 00 00  orld!...orld!...
0000060: cd 80 b0 01 b3 00 cd 80                          ........

This sets as many proper headers as possible without affecting the byte count, prints a trailing linefeed and exits cleanly with exit code 0.

Try it online!

Verification

$ cksum hw64
3288151474 104 hw64
$ file hw64
hw64: ELF 64-bit LSB executable, x86-64, version 1, statically linked, corrupted section header size
$ ./hw64
Hello, World!
$ echo $?
0
\$\endgroup\$
  • \$\begingroup\$ Disassembly output of the code stuffed into the ELF headers would be nice, if you needed any special tricks to make instruction bytes also be valid ELF headers. (Future readers: see muppetlabs.com/~breadbox/software/tiny/teensy.html for more about this kind of hack.) \$\endgroup\$ – Peter Cordes Apr 13 '18 at 0:57
  • \$\begingroup\$ O_o why is there an extra orld! \$\endgroup\$ – ASCII-only Apr 13 '18 at 4:55
  • \$\begingroup\$ @ASCII-only The answer saves bytes by storing data in the ELF's program header. The longs at 0x50 and 0x58 encode the virtual and physical addresses of the segment, and they program segfaults if they do not match. \$\endgroup\$ – Dennis Apr 13 '18 at 5:26
9
\$\begingroup\$

INTERCAL, 285 bytes

DO,1<-#14
DO,1SUB#1<-#238
DO,1SUB#2<-#108
DO,1SUB#3<-#112
PLEASE DO,1SUB#4<-#256
DO,1SUB#5<-#64
DO,1SUB#6<-#194
PLEASE DO,1SUB#7<-#48
DO,1SUB#8<-#26
DO,1SUB#9<-#244
PLEASE DO,1SUB#10<-#168
DO,1SUB#11<-#24
DO,1SUB#12<-#16
PLEASE DO,1SUB#13<-#162
DO,1SUB#14<-#52
DO READ OUT,1
DO GIVE UP

Try it online!

\$\endgroup\$
8
\$\begingroup\$

COBOL, 55 bytes

PROGRAM-ID.H.PROCEDURE DIVISION.DISPLAY"Hello, World!".

Thankfully not quite as verbose as some ancient bloated languages like Java.

\$\endgroup\$
  • 2
    \$\begingroup\$ You're cheating. Last I checked, COBOL needed a lot of newlines and useless spaces at the start of each line... \$\endgroup\$ – Wouter Verhelst Dec 15 '15 at 11:05
  • \$\begingroup\$ When I compile that at tutorialspoint.comcompile_cobol_online.php it says Error: syntax error, unexpected "end of file", expecting "FUNCTION-ID" or "PROGRAM-ID" because it doesn't like the missing newlines. The exact same code on three lines compiles and runs. \$\endgroup\$ – Jerry Jeremiah Mar 17 '16 at 23:34
  • 1
    \$\begingroup\$ @JerryJeremiah This works just fine with GNU COBOL, assuming you provide the -F (or -free) flag. tio.run/##S85Pys/RTc8r/f8/… \$\endgroup\$ – Dennis Jul 17 '17 at 20:45
8
\$\begingroup\$

if(j)invert()if(l)change()if(q)input()if(t)output(x);, 13 bytes

Hello, World!

Breaks the scoreboard. Any non-instruction characters are printed verbatim.

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