440
\$\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 quit because SE is EVIL 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
  • 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\$ – 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

789 Answers 789

1
9 10
11
12 13
27
3
\$\begingroup\$

A Pear Tree, 25 bytes

print'Hello, World!'#»G²Ú

Try it online!

A Pear Tree programs are written in an arbitrary ASCII-consistent 8-bit character set; for codepoint 128 and above, the interpreter cares about the codepoint numerically, not the represented character. TIO uses Latin-1, so the above program is actually a Latin-1 decoding of the codepoints that make it up.

Explanation

print'Hello, World!' should be fairly self-explanatory. However, there is some choice available here; print"Hello, World!" would have been the same length, but leads to the resulting checksum being less printable.

The checksum is the interesting part of the program. In this program, that's the #»G²Ú at the end. For golfing, you'd want the shortest workable checksum, which is normally 4 or 5 bytes long. (It's a 32-bit checksum, so 4 bytes would normally be enough, but the checksum is also executed as code, and thus needs to be a valid command; the # starts a comment, so # plus 4 bytes is normally enough to add a checksum to anything.) The checksum doesn't have to cover the whole code, but does have to cover a prefix of the part of the code that actually runs; adding comments at the end is terser than adding them at the start, and we want to execute the entire program, so for this program, I caused the checksum to cover the entire program.

Although a Hello World program doesn't benefit much from the checksumming, we could have made use of the checksum behaviour to embed the Hello World program into a larger document or write multiple copies of the program so that if one gets corrupted, the others can still run. This makes A Pear Tree considerably more robust than most languages are.

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

Bitwise Cyclic Tag But Way Worse, 324 bytes

1111111111111111111111111111111111111111111111111111111110110101101010101110101101101110111010101110111010101110111110101101110101010110101010101011011011110111011111011110101101011101110101011101011010101011010101011n0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Try it online!

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

]=[, 164 bytes

[=======[==]]=[[=[[=]]=[[=[[========]]][]=[]=[[=[=[=]]][]=[[====[====]]=[[===[==]]=[[========[=======]]=[]=[[=[=[====]]=[[=[[========]]=[[=[[]]=[[===[===]]=[[=[]]=[

]=[ was a language which only uses the symbols ], =, and [.

The ]=[ interpreter is written in 12-Basic.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ There's something amusing about the fact that the ]=[ interpreter at the link is written in the 12-basic interpreter. \$\endgroup\$ – snail_ May 31 '18 at 20:18
  • \$\begingroup\$ Permalink no longer works \$\endgroup\$ – ASCII-only Dec 26 '18 at 1:07
  • \$\begingroup\$ now I can't find the interpreter... \$\endgroup\$ – 12Me21 Dec 28 '18 at 3:18
  • \$\begingroup\$ I was looking through some old files and I found the interpreter, finally. \$\endgroup\$ – 12Me21 Mar 13 '19 at 21:32
3
\$\begingroup\$

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

Commit tree:

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

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

The program in its proper representation consists of 4 files:

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

ref:refs/heads/master

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

63c5d7873f5b0ede65885bfdfd5c935827d6752a

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

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

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

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

32 bit SPARC machine language on SunOS, 48 45 bytes

0x00:  40 00 00 02    call 0x8            ! PC relative jump, return addr to %o7
0x04:  82 10 20 04    mov  4, %g1         ! delay slot; select write() syscall
0x08:  90 10 20 01    mov  1, %o0         ! stdout is fd=1
0x0c:  92 03 E0 20    add  %o7, 32, %o1   ! put addr of string in %o1
0x10:  94 10 20 0d    mov  13, %o2        ! length of string
0x14:  91 D0 20 08    ta   %icc, %g0 + 8  ! call write()
0x18:  82 10 20 01    mov  1, %g1         ! select exit() syscall
0x1c:  91 D0 20 08    ta   %icc, %g0 + 8  ! call exit()
0x20:  48 65 6c 6c    "Hello, World!"
       6f 2c 20 57
       6f 72 6c 64
       21

Porting to 64 bit SPARC requires changing the argument of the trap instruction from 8 to 64.

To try this on a SunOS machine, compile and run the following C program.

const char main[]="\x40\x00\x00\x02\x82\x10\x20\x04\x90\x10\x20\x01\x92\x03\xe0\x20\x94\x10\x20\x0d\x91\xd0\x20\x08\x82\x10\x20\x01\x91\xd0\x20\x08Hello, World!";
| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

VBA, 15

?"Hello, World!

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

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

Turing Machine But Way Worse, 853 bytes

0 0 0 1 1 0 0
0 1 1 1 2 0 0
0 2 0 1 3 0 0
0 3 0 1 4 0 0
0 4 1 1 5 1 0
0 5 1 1 6 0 0
0 6 0 1 7 0 0
0 7 1 0 8 0 0
0 8 0 0 9 0 0
1 9 1 0 a 0 0
1 a 0 0 b 0 0
0 b 0 0 c 0 0
0 c 1 1 d 1 0
0 d 0 1 e 0 0
0 e 1 1 f 0 0
1 f 1 1 g 0 0
0 g 0 1 g 0 0
1 g 0 0 h 1 0
0 h 0 1 i 1 0
0 i 1 0 i 0 0
1 i 1 1 j 1 0
1 j 1 1 k 0 0
1 k 1 1 l 0 0
0 l 0 1 m 0 0
0 m 0 1 n 0 0
0 n 1 1 o 0 0
0 o 0 1 p 0 0
0 p 1 1 q 0 0
0 q 1 0 r 1 0
1 r 0 1 s 0 0
1 s 0 1 t 1 0
0 t 0 1 u 0 0
0 u 1 0 v 0 0
0 v 0 0 v 0 0
1 v 1 0 w 0 0
0 w 0 0 w 0 0
1 w 1 0 x 0 0
1 x 1 0 x 0 0
0 x 1 1 y 0 0
1 y 0 0 z 0 0
1 z 1 0 A 0 0
1 A 0 1 B 1 0
1 B 0 1 C 0 0
0 C 1 0 D 0 0
0 D 0 0 E 0 0
0 E 1 1 F 1 0
0 F 1 1 G 0 0
1 G 0 1 G 0 0
0 G 0 0 H 0 0
0 H 0 0 I 0 0
0 I 1 0 J 1 0
0 J 1 0 J 0 0
1 J 0 1 K 0 0
1 K 1 1 K 0 0
0 K 0 0 L 0 0
1 L 0 0 M 1 0
1 M 1 0 N 0 0
1 N 0 1 O 1 0
1 O 0 1 P 0 0
0 P 0 1 P 0 0
1 P 1 1 P 1 1

Try it online!

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

Nandy, 159B

Simply sets the stack to bits 0 and 1 and then puts them in the output stack.

o::#o>oo>o>oooo>oo>oo>o>o>o>o>oo>o>oo>ooo>oo>o>oo>ooo>oo>o>oooo>oo>o>o>oo>oooo>o>oooooo>o>o>o>o>ooo>o>oo>o>oooo>o>ooo>oo>o>oo>oo>o>oo>ooo>oo>oo>o>oooo>o>oooo>o
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Wow, I'm surprised anyone noticed this language. This can probably be golfed quite a lot if you use a loop to output at the end \$\endgroup\$ – EdgyNerd Aug 31 '19 at 12:51
  • \$\begingroup\$ But how? Can you present you program? (I actually found your language by looking at your TIO request.) \$\endgroup\$ – user85052 Aug 31 '19 at 13:15
  • \$\begingroup\$ I don't think using a loop at the end would be any shorter since it would be the same amount of bytes to output as it is to dupe a bit \$\endgroup\$ – Jo King Sep 8 '19 at 8:11
3
\$\begingroup\$

Ada, 68 bytes (-15)

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

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

Thanks to 3D1T0R and breadbox for improving this!

Try it online!

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

1+, 87 83 bytes

11+""+"""+"/*^/"\+""+";\\+"*"1+;/+""";;(|1+1+1+)";/^""1()"+()+"1+";+^;;\";();/;;1+;

Try it online!

This should be very golfable, but it is hard to golf 1+ directly.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Nice! I'm doing nothing now. \$\endgroup\$ – HighlyRadioactive Oct 9 '19 at 9:56
3
\$\begingroup\$

CRPL and its sister language PRPL, 21 bytes

Bit of an obscure language, but the official tutorial doesn't contain a Hello World program so this at least is worth something.

"Hello, World!" Trace

"Hello, World!" pushes the string Hello, World! to the stack, and Trace pops an item from the stack and add it to the trace log, the closest thing the language has to SDTOUT or a console.

Alas, for this language is too obscure for Dennis's gadget; however, I have written the following interpreter in JS with all the complexity needed for this demo. I may one day make it support more.

var code = '"Hello, world!" Trace';
var stack = [];
var vars = Object.create(null);

var literals = [];
code = code.replace(/"(.*?)"/g, (m, $1) => 'lit' + [literals.length, literals.push($1)][0]).split(/\s/);

for (var token of code) {
    if (token.match(/^lit(\d+)$/)) {
        stack.push(literals[token.slice(3)]);
    } else if (token.match(/^-?\d+.?\d*/)) {
        stack.push(+token);
    } else if (token.startsWith('<-')) {
        stack.push(vars[token.slice(2)]);
    } else if (token.startsWith('->')) {
        vars['v' + token.slice(2)] = stack.pop();
    } else {
        switch(token) {
            case 'Trace5':
                console.log(stack.pop());
            case 'Trace4':
                console.log(stack.pop());
            case 'Trace3':
                console.log(stack.pop());
            case 'Trace2':
                console.log(stack.pop());
            case 'Trace':
                console.log(stack.pop());
                break;
            default:
                throw new Error(token + 'is not implemented.');
        }
    }
}

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ No language is too obscure, you just have to ask for it on talk.tryitonline.net lol \$\endgroup\$ – ASCII-only Apr 11 '18 at 6:34
  • \$\begingroup\$ Yeah probably. You could've just edited it yourself. \$\endgroup\$ – Nissa Dec 6 '19 at 22:54
3
\$\begingroup\$

Ral, 103 bytes

What better way to introduce a new language than by posting the 768th "Hello, World!"?

Hand-made code, can probably be improved a lot.

11+:+:+:0=1+:+:+::+:.+0*/-::1+.0*+:::..1+1+1+::.0*:+:+:11+1+:+:++..10*1+1+1+:+:+:+-..1+1+1+...0*:+:+1+.

Try it online!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Cool language! I like the mix of stack and random access. \$\endgroup\$ – Redwolf Programs Apr 12 at 23:25
3
\$\begingroup\$

Spice, 20 bytes

@OUT "Hello, World!"

Explanation

Should be pretty straight forward what's happening, but we use some undefined behaviour to shave off 2 bytes (interpreter version 1.1.0.0, which is current at time of submission). The program should read:

;@
OUT "Hello, World!";

as per the spec, but we drop the ; as we only have one instruction and don't need to define an instruction separator, and so also have no trailing ; at the end.

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

W d, 12 10 bytes (SBCS)

.s*♪╧T≈╪√ù

Explanation

This program is a compressed program. After decompression this becomes:

J=QwTI[5mRb`

After string-decompression:

Hello, World!"

After quote auto-completion:

"Hello, World!"

After which it is implicitly output.

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

Roj, 18 bytes

I love this simple BASIC dialect ...

out"Hello, World!"

Explanation

out                $ Output $
   "Hello, World!" $ the string "Hello, World" $
| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

vJASS, 81 bytes

//! inject main
call BJDebugMsg("Hello, World!")
//! dovjassinit
//! endinject

This language is used for Warcraft 3, mostly custom maps. This is the shortest code you can get.

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

Tetr4phobi4, 454 bytes

4OUR
fuor
fuor
4OUR
4OUR
4444
FO44
4OUR
4OUR
4OUR
4OUR
4OUR
fuor
4OUR
4OUR
4OUR
4OUR
4OUR
fuor
4OUR
four
4444
fuor
4OUR
4OUR
4OUR
4OUR
4OUR
4OUR
4OUR
four
4444
4444
fuor
4OUR
4OUR
4OUR
four
4444
FO44
4OUR
4OUR
4OUR
fuor
FOU4
4444
ffff
4OUR
4OUR
fuor
4444
FO44
4OUR
4OUR
4OUR
4OUR
4OUR
fuor
4OUR
4OUR
fuor
FOU4
four
4444
4OUR
4OUR
4OUR
4OUR
4OUR
4OUR
4444
4OUR
fuor
FOU4
four
4444
FOU4
FOU4
fuor
4OUR
4OUR
four
4444
FOU4
FOU4
4444
44UR
fuor
4OUR
four
4444

Ungolfed Code:

{44} H -> 72
4OUR$$$$fuor$$$$fuor$$$$4OUR$$$$4OUR      {44} CELL[1] + 4 * 4 * 4 + 4 + 4
4444                                      {44} Print CELL[1]
FO44                                      {44} Next Cell

{44} e -> 101
4OUR$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR      {44} CELL[2] + 4 + 4 + 4 + 4 + 4
fuor$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR      {44} CELL[2] * 4 + 4 + 4 + 4 + 4
4OUR$$$$fuor$$$$4OUR$$$$four              {44} CELL[2] + 4 * 4 + 4 / 4
4444                                      {44} Print CELL[2]

{44} l -> 108
fuor$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR      {44} CELL[2] * 4 + 4 + 4 + 4 + 4
4OUR$$$$4OUR$$$$4OUR$$$$four              {44} CELL[2] + 4 + 4 + 4 / 4
4444$$$$4444                              {44} Print CELL[2] twice

{44} o -> 111
fuor$$$$4OUR$$$$4OUR$$$$4OUR$$$$four      {44} CELL[2] * 4 + 4 + 4 + 4 / 4
4444                                      {44} Print CELL[2]
FO44                                      {44} Next Cell

{44} , -> 44
4OUR$$$$4OUR$$$$4OUR$$$$fuor$$$$FOU4      {44} CELL[3] + 4 + 4 + 4 * 4 - 4
4444                                      {44} Print CELL[3]

{44} Whitespace -> 32
ffff                                      {44} Reset CELL[3]
4OUR$$$$4OUR$$$$fuor                      {44} CELL[3] + 4 + 4 * 4
4444                                      {44} Print CELL[3]
FO44                                      {44} Next Cell

{44} W -> 87
4OUR$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR      {44} CELL[4] + 4 + 4 + 4 + 4 + 4
fuor$$$$4OUR$$$$4OUR$$$$fuor$$$$FOU4      {44} CELL[4] * 4 + 4 + 4 * 4 - 4
four                                      {44} CELL[4] / 4
4444                                      {44} Print CELL[4]

{44} o -> 111
4OUR$$$$4OUR$$$$4OUR$$$$4OUR$$$$4OUR      {44} CELL[4] + 4 + 4 + 4 + 4 + 4
4OUR                                      {44} CELL[4] + 4
4444                                      {44} Print CELL[4]

{44} r -> 114
4OUR$$$$fuor$$$$FOU4$$$$four              {44} CELL[4] + 4 * 4 - 4 / 4
4444                                      {44} Print CELL[4]

{44} l -> 108
FOU4$$$$FOU4$$$$fuor$$$$4OUR$$$$4OUR      {44} CELL[4] - 4 - 4 * 4 + 4 + 4
four                                      {44} CELL[4] / 4
4444                                      {44} Print CELL[4]

{44} d -> 100
FOU4$$$$FOU4                              {44} CELL[4] - 4 - 4
4444                                      {44} Print CELL[4]
44UR                                      {44} Prev Cell

{44} ! -> 33
fuor$$$$4OUR$$$$four                      {44} CELL[3] * 4 + 4 / 4
4444                                      {44} Print CELL[3]
| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

MAWP, 86 85 bytes

98W;55W4W1M;93W4W;93W4W;94W1M3W;58W4M;84W;98M5W2M;94W1M3W;99M1M6W;93W4W;55W4W;92M3W;.

Creating an esolang for fun, made this for traditions!

Explanation:

98W;           - Push  72 to stack and print it as ASCII char (H)
55W4W1M;       - Push 101 to stack and print it as ASCII char (e)
        55       - Push 5 two times to stack
        W        - Multiply the top 2 numbers on stack and push result to stack
        4        - Push 4 to stack
        W        - Multiply the top 2 numbers on stack and push result to stack
        1        - Push 1 to stack
        M        - Sum the top 2 numbers on stack and push result to stack
        ;        - Print top number on stack as ASCII char
93W4W;         - Push 108 to stack and print it as ASCII char (l)
93W4W;         - Push 108 to stack and print it as ASCII char (l)
94W1M3W;       - Push 111 to stack and print it as ASCII char (o)
58W4M;         - Push  44 to stack and print it as ASCII char (,)
84W;           - Push  32 to stack and print it as ASCII char ( )
98M5W2M;       - Push  87 to stack and print it as ASCII char (W)
94W1M3W;       - Push 111 to stack and print it as ASCII char (o)
99M1M6W;       - Push 114 to stack and print it as ASCII char (r)
93W4W;         - Push 108 to stack and print it as ASCII char (l)
55W4W;         - Push 100 to stack and print it as ASCII char (d)
92M3W;         - Push  33 to stack and print it as ASCII char (!)
.              - End the program
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Common LISP, 22 bytes

(princ"Hello, World!")
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Burlesque, 17 bytes

,"Hello, World!"Q

The leading , tells Burlesque to ignore standard input. "Hello, World!" pushes a string to the stack, and Q formats it for display without quotes.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Yes, otherwise Burlesque will add "". \$\endgroup\$ – Lynn Oct 23 '15 at 21:25
  • \$\begingroup\$ Sure, that works just as well! The , primitive (it's sort of like a flag, I guess?) is there for historic reasons; Q is a new-ish synonym for sh which was longer. \$\endgroup\$ – Lynn Oct 23 '15 at 21:46
2
\$\begingroup\$

RPython, 60 bytes

def e():print'Hello, World!';return 0
target=lambda*_:e,None
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Erlang, 63 bytes

Save as h.erl, then compile with erl -s h m, I think.

-module h.
-export[m/0].
m()->io:fwrite("Hello, World!").
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Tcl, 19 bytes

puts Hello,\ World!

I think this can get smaller than it already is.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Is that missing the comma? \$\endgroup\$ – curiousdannii Aug 29 '15 at 13:00
  • \$\begingroup\$ What comma do you mean? \$\endgroup\$ – Johannes Kuhn Aug 29 '15 at 13:06
  • \$\begingroup\$ I'm just guessing, but will this print "Hello World!" rather than "Hello, World!"? \$\endgroup\$ – curiousdannii Aug 29 '15 at 13:10
  • \$\begingroup\$ Right... Forgot that piece... \$\endgroup\$ – Johannes Kuhn Aug 29 '15 at 13:12
2
\$\begingroup\$

Glypho, 480 bytes

In the "shorthand" format, it's 120 bytes:

1d+d1+d*+ddd++ddd++1+d11+d*d++d11+1+d++d1-dd+++d1<d>+-d++11+d*d*d+<d>d+d+d<d>+d+1+d1-dd+++d1-<d>+d*1+11+1+d+d*d+<d-+>[o]

An example conversion to "true" Glypho (using the translation of the Java interpreter, which differs slightly from that documented in the esolangs.org page) is:

v># #  :: < <   <v#  #*>*> ##:#**#,<,<: : > > *  *v>>v # ##,#, + +:++: ++ ##
*<<*,^,^<<#v<<v#v::v< < <,, +,+,+>>+*,,*+*+*,,*>**^v#  #,,:^#vv#>+>+ << >  >, , ++*>:
:v<v<^#^#v::v>::>v**v # #::>^>+>>:>:>>>*>>##>*^ *# #  vv ,::,<<>:++
*vv*v:v:^vv< > > ,,>>:>: << >+>>^ ^ ^^*^+,+,#::#*:*::  :v v  ,   # #<<#<#**#^,^,+##+**
+**+,:,:::>*<^v< v v+^+^*^^*+<<++##+v#v#++<>:< :* **+ +   ^ *  *<+<+<  *vv+<:^^:::
^+*<<***<^+  ++:+:^##^:>:>+::< > >#>># *  >,>, :^ ^>>^##<#,<,*^   *<:<

(using Windows line terminators \r\n) where I tried to disguise it as a 2D language for the Programming Language Quiz.

The basic approach is to push onto the stack a 0 followed by the codepoints in reverse order, and then print them with the loop [o]. In order to golf the pushing, I first push 11 and then I can push a new 11 whenever I want with <d>; the final <d-+> replaces that 11 on the bottom of the stack with the desired 0.

I experimented with various values on the bottom of the stack, and 11 is the only one for which my brute-force searcher was able to find expressions for each of the characters which were no more than 11 bytes each. (12 bytes was taking too long).

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Quick translation from my CSL answer (i.e. super suboptimal), 456 \$\endgroup\$ – ASCII-only Apr 13 '18 at 6:32
2
\$\begingroup\$

23, 52 bytes

17,13,72,101,108,108,111,44,32,87,111,114,108,100,33

This uses 23.dezsy notation: 17,13 prints the 13 integers that follow as characters.

Try it online here. (Don't forget to replace the example with the above source code.)

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Maxima, 23 bytes

print("Hello, World!")$
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

UNBABTIZED

:72.:101.:108.:108.:111.:44.:32.:87.:111.:114.:108.:100.:33

:x prints x as a character and . acts as a statement separator.

The official interpreter is written for Python 2.2. You can use it in modern versions of Python by prepending the line

# coding: latin1
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

az, 16 bytes

"Hello, World!".
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Cardinal, 15 bytes

%"Hello, World!
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

LMNtal, 35 bytes

io.use.io.print("Hello, World!",_).

A weird programming language from Japan that seems to be inspired by Prolog.

| improve this answer | |
\$\endgroup\$
1
9 10
11
12 13
27

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