Shortest infinite loop producing no output

The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code might be shorter if no output is given.

Rules

• Each submission must be a full program.
• You must create the shortest infinite loop.
• Even if your program runs out of memory eventually, it is still accepted as long as it is running the whole time from the start to when it runs out of memory. Also when it runs out of memory, it should still not print anything to STDERR.
• The program must take no input (however, reading from a file is allowed), and should not print anything to STDOUT. Output to a file is also forbidden.
• The program must not write anything to STDERR.
• Feel free to use a language (or language version) even if it's newer than this challenge. -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. :D
• 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 infinite loop program. This is about finding the shortest infinite loop program in every language. Therefore, I will not accept an answer.
• 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 Brainf**k-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.
• There should be a website such as Wikipedia, Esolangs, or GitHub for the language. For example, if the language is CJam, then one could link to the site in the header like #[CJam](http://sourceforge.net/p/cjam/wiki/Home/), X bytes.
• Standard loopholes are not allowed.

(I have taken some of these rules from Martin Büttner's "Hello World" challenge)

Please feel free to post in the comments to tell me how this challenge could be improved.

Catalogue

This is a Stack Snippet which generates both an alphabetical catalogue of the used languages, and an overall leaderboard. To make sure your answer shows up, please start it with this Markdown header:

# Language name, X bytes


Obviously replacing Language name and X bytes with the proper items. If you want to link to the languages' website, use this template, as posted above:

#[Language name](http://link.to/the/language), X bytes


Now, finally, here's the snippet: (Try pressing "Full page" for a better view.)

var QUESTION_ID=59347;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=41805;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"//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"//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}#answer-list{padding:10px;width:500px;float:left}#language-list{padding:10px;padding-right:40px;width:500px;float:left}table thead{font-weight:700}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="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <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>

• I've got to start posting programs with a negative byte count to beat all these empty files! – CJ Dennis Oct 3 '15 at 4:32
• This challenge is interesting because it brings out lots of 0 byte languages (some of which are NOT esolangs). FWIW, most declarative languages have an implicit infinite loop because declarative languages don't have loops in their syntax (they assume they're running in an infinite loop). Ladder diagrams are perhaps among the oldest such languages. Then you have the Instruction Language (IL), a sort of assembly for PLCs that also assume an infinite loop. ILs, like assembly are different between manufacturers – slebetman Oct 5 '15 at 9:36
• Are programs that read and execute their own source code allowed, or does file I/O break the "must take no input" rule? – ThisSuitIsBlackNot Oct 6 '15 at 13:05
• @ThisSuitIsBlackNot Yes, file input is allowed. – user41805 Oct 6 '15 at 16:47
• Can you print "", an empty string? – OldBunny2800 Mar 7 '16 at 23:39

DUP, 2 bytes

~!


Try it here.

Found this completely by accident.

Explanation

If the stack is empty, ~ (normally bitwise NOT) just pushes -1 to the stack. !, which is normally lambda execute, pushes 1! to the return stack, which then tells the IP to go back to ~, and the loop goes on.

• The quirkster implementation shows a few non-standard behaviors that appear to be implementation errors or maybe specific to Javascript behavior. Cool find, though. Your solution should fill up the return stack rather quickly, so it’s going to crash sooner or later. – M L Jun 3 '18 at 1:48

Grond, 7 bytes

w(1){}


Compiler here https://github.com/epicTCK/Grond

• This is a very short answer... Well done! – wizzwizz4 Mar 8 '16 at 16:50

Hoon, 4 bytes

|-
$ The |- rune is a synthetic rune that expands to =<($ |.($)), a macro that expands to a self-calling function. That function returns $, the name of a limb. Gates like |. are essentially "objects" in Hoon, called cores, with a list of limbs. $ is the empty name of the limb containing the code to run to call the gate. The code creates a core with one limb, $, that returns the value at the limb \$ (itself) and calls it immediately.

• You forgot to make the Hoon, ... a header. – user48538 Mar 8 '16 at 21:09

Gogh, 1 byte

Ø


The character Ø infinitely loops all code before it. (from the wiki)

Factor, 15 bytes

Yea, Factor is verbose.

[ t ] [ ] while


Do nothing forever. Hangs the Listener.

• Here on PPCG we have such an interesting definition of verbose. – Cyoce Mar 25 '16 at 6:48

Python 3, 100 79 bytes

x=lambda x:x(x)
while x:
try:x(x)
except BaseException:pass


Note: this doesn't freeze my IDLE or my machine, nor does it hog lots of memory: it just occupies (more than) a core on an eight-core processor.
Also note: pressing CTRL-C (or whatever you have KbInt bound to) a few times will eventually cause it to error and quit. I could write in protection for that but it's pointless in this case.

• You can't use BaseException to catch all exceptions? – ASCII-only Mar 24 '16 at 14:18
• @somebody I tend to forget BaseException catches KeyboardInterrupt. – cat Mar 24 '16 at 14:32
• @somebody I couldn't quite tell you why I answered this way in the first place... – cat Mar 24 '16 at 14:34

Pylongolf2, 2 bytes

><


That's it.

The Infamous Shakespeare Programming Language, 122 bytes

.
Page,a cat.
Ford,.
Act I:
Scene I:z
[Enter Page and Ford]
Page:
Am I better than zero?
Ford:
If so, let us proceed to z.

• Aren't the descriptions of the characters in the Dramatis Personae just comments? I'm pretty sure this would just terminate on the first iteration. – SuperJedi224 Jan 25 '17 at 2:03
• If they evaluate to a valid expression, then they will be evaluated. – clamchowder314 Jan 25 '17 at 22:54

Jumper, 2 bytes

:0


Move along, nothing to see here but a simple self-GOTO...

Sh, 17 bytes

while :;do :;done


Probably the shortest one.
Ungolfed:

while [ : ]; do
:
done


: is a command that always returns 0 (a.k.a. the same as true).

Sh+coreutils, 13 bytes

yes>/dev/null


yes is a program from the coreutils package, that, when not given an argument, continuously outputs y  (note the newline), while given an argument, outputs that argument plus a newline continuously. --help and --version display usage and version number, respectively.

• Why did you post this as a new answer instead of an edit to this one? Also, your "ungolfed" code doesn't do the same as the golfed code. [ : ] returns 0 because the string : is non-empty, not because it executes :. – Dennis May 15 '16 at 17:58
• @Dennis I thought that code between [ ] is actually executed. – Erik the Outgolfer May 15 '16 at 18:32
• No, that's not what happens. [ is an alias for test. If expression is a single argument, test returns false if the argument is null and true otherwise. – Dennis May 15 '16 at 20:59

Parallax Assembly, 0 bytes

The effect if set up correctly leaves the processor core initialized to zeros, which happens to be a nop. Running off the end executes the processor special registers, which also happen to be initialzed to zero except for ina, but the high bits are zero (for some reason this particular CPU floats low rather than high) so it's still a nop, and loops back to the beginning by overflowing the IP register.

Incidentally a blank CPU is already set up correctly so it's just a matter of loading the null program without disturbing the state.

Pancake Stack, 71 bytes

Put this # pancake on top!
[a]
If the pancake is tasty, go over to "a".


Yay, self-GOTOs with #pancakes...

Codan, 4 bytes

«»


All loops in Codan are infinite if they don't have breaks. This program is transpiled to C as follows:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <termios.h>
int main(void)
{
int mem[10000];
int alpha, beta, t;
for (;;) {
}

return 0;
}


PRINDEAL, 10 bytes

a t
t
t
t
t


Creates a command named t that calls itself, then calls itself regardless of whether the first call suceeded. An interpreter was posted which does not use recursion, and thus will keep running forever (or until it runs out of memory)

Revaver2pi, 5 bytes

TEL 0


TEL searches (cyclically) for the next TEL with the same first argument and jumps to there.

XRF, 5 bytes

FFFFF


Only contains one chunk, which is a NOP. The instruction pointer is the top of the stack, so it never changes and just repeats the code infinitely.

Sonic Pi

loop do end


I think that's easy to understand.

ACIDIC, 1 byte

A single newline character. In the C# interpreter, the empty program (i.e., the second line) just loops forever.

Subleq bytecode, 3 binary words

00 00 00


Equivalent to

*00 = *00 - *00
if(*00 <= 0) goto 00


Ceylon, 30 29 bytes

This is an eternal loop (which also will not run out of memory or stack or something), 30 bytes:

shared void l(){while(true){}}


This can be golfed down one more byte to 29:

shared void l(){while(1<2){}}


In the Ceylon web runner you have to remove the function wrapper, getting this 12 byte snipped:

while(1<2){}


(I had to kill my Chromium window when trying this.)

This eternal recursion will quickly run out of stack space (about 1024 calls on my JVM implementation, with a StackOverflowError), 22 bytes:

shared void r() {r();}


I wouldn't consider this a valid solution.

Note that the for-loop (which is the shortest endless loop in Java) in Ceylon can only loop over an iterable, and all ways of constructing an infinite iterable are longer. Here is one example (38 bytes):

shared void f(){for(x in{1}.cycled){}}


BSM, 1 byte



A single space character. Had to use some brute-forcing for this... After about 125 cycles, it loops between the states 55, EF, B1, 5A, AD, B2, D9, DC, 9C, 13, 19, and F9.

Enigma-2D, 2 bytes

RL


The IP alternates between moving rightwards and leftwards.

MarioLANG(4 Bytes)

><
==

• There is already a shorter solution in the same language. – Mego Jul 2 '16 at 2:33

Nim, 16 bytes

while on:discard


on is an alias for true. Nim disallows expressions that aren't explicitly discarded, so we just discard nothing.

Logicode, 24 bytes

circ r(a)->r(a)
out r(1)


Logicode is a new language that I made recently. It only consists of the basic logic gates AND, OR and NOT.

It also contains some nifty stuff like conditionals, make-your-own circuits, and output.

Basically, the first line declares a new circuit, r, with an argument a, and declares the output of the circuit to be r(a). This basically results in an infinite loop.

out r(1) outputs r(1).

Ru, 4 bytes

¿Ϟ{}


¿ call a function while koppa is not 0/nil/false. But since Ϟ also return its argument, it's possible to chain ¿ and Ϟ.

Racket 18 bytes

(λ()(let g()(g)))


Emotinomicon, (2 chars) 6 bytes

ℹ⏩


I cleverly chose the ℹ character for 3 bytes instead of 4. Explanation:

ℹ⏩ explanation
ℹ  push the imaginary unit to the stack
⏩ close loop


It works, because 1) ⏩ has got a value (i) 2) ⏩ can't find a ⏪.

To test the code, do the following:

1. Open the interpreter.
2. Clean the box and then put a 😷 in it (not part of the code, just in case you have a dirty output stream).
3. Paste the code after that one-big-toothed strange guy.
4. Click on "generate explanation". Watch the steps done there (also, no mono-spacing issues).
5. Click on "submit". Warning: the code will run after this step!
• You're shown in the Leaderboard as 2 bytes. Also why non competing? – Roman Gräf Oct 16 '16 at 8:07
• @RomanGräf The language was made in December 2015, this challenge is from October 2015. – Erik the Outgolfer Oct 16 '16 at 8:16
• WHY is this question still active???? – Roman Gräf Oct 16 '16 at 8:19
• @RomanGräf Because I just edited my answer. Dunno why I put non-competing in there, though... – Erik the Outgolfer Oct 16 '16 at 8:20

D2, 3 bytes

+[]


Same as Brainfuck

More interesting version using the preprocessor (the code is actually never executed because the infinite loop is in the preprocessor):

(@a)a@a


Simple recursive macro

Lithp, 40 bytes

((platform ext)(invoke (stdin) resume))


There are presently no loop constructs in my language. Instead, we tell NodeJS (in which Lithp is implemented) to resume the process.stdin stream. We haven't setup a handler, but the process will never exit.

In fact, you have to send a kill message to abort the application.