# 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

## Backshift, 1 byte

0

### How it works

This tries to move 0 1-0=1 times backwards. This does not halt, as it tries to do this until it encounters a 1 (which is impossible).

[(0,1)]

### How it works

This is a looping counter; that means it starts from 0 and counts up in 1s forever.

• This should be split up into two answers. – lirtosiast Jul 6 '19 at 9:44

## Forth, 19 bytes

: b begin again ; \ compiles word that loops endlessly
b                 \ executes this word


Try it online!

# Malbolge, 1787 bytes

This one doesn't rely on interpreter bug.

bP&A@?>=<;:9876543210/.-,+*)('&%$T"!~}|;]yxwvutslUSRQ.yx+i)J9edFb4_^]\yxwRQ)(TSRQ]m!G0KJIyxFvDa%_@?"=<5:98765.-2+*/.-,+*)('&%$#"!~}|utyrqvutsrqjonmPkjihgfedc\DDYAA\>>Y;;V886L5322G//D,,G))>&&A##!7~5:{y7xvuu,10/.-,+*)('&%$#"yb}|{zyxwvutmVqSohmOOjihafeHcEaYAA\[ZYRW:U7SLKP3NMLK-I,GFED&%%@?>=6;|9y70/4u210/o-n+k)"!gg$#"!x}{zyxZvYtsrqSoRmlkjLhKfedcEaD_^]\>Z=XWVU7S6QPON0LKDI,GFEDCBA#?"=};438y6543s1r/o-&%*k('&%e#d!~}|^z]xwvuWsVqponPlOjihgIeHcbaB^A\[ZY;W:UTSR4PI2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QP3N0FEJ-+**?DC&A#98=~|:98yx/4u21rp(',mk)(ig%|{"ca}^z][wZXtWUqTRnQOkNLhKIedcFEYB@@?ZYRW:UTS6QPO11F..CHGF)(CB;@#>!~;XzV7gwu-QrrqMoJIkZF'WC$#AbQ_{^L9wI64"VDConzl+j);JJ%qGFEZ~}]{ygwRuc8aSq44"H1Y.iV,e*RQ


Try it online!

# jq -n, 9 + 3 = 12 bytes

def f:f;f


The -n option makes jq not consume any input, otherwise it waits for stdin before starting the loop.

## Pizza Delivery, 2 bytes

(]


While L is zero, end while.

## Rust, 17 bytes

fn main(){loop{}}


Just for fun :P

• @pppery I mean that it's not in order to win anything, I'm just submitting it for fun – Sagittarius Jan 13 '20 at 14:44

|


Try it online!

or (if my understanding is correct) any other one-byte program from @/\!^?_\$<>=~+-*:%().#--that is, any instruction which depends on the return value of what's below it, either directly or to the left or right, since in the case of a one-byter all three of those wrap back around to the same command. I suspect that most if not all of these would run out of call stack given enough time, but I don't know Perl so I can't quite tell what the interpreter is actually doing.

• Perl 6 doesn't have a hard recursive limit, so it would just recurse until it runs out of memory – Jo King Sep 25 '19 at 6:47

# 1+, 5 bytes

1##1#


Explanation:

1#    [Jump to 1st hash]
#   [1st hash in program (counting starts from 0)]


## Alternatively, 5 bytes

(|())


Explanation:

This program define and execute a function with an empty name. The function calls itself. Thus, it is infinite recursive.

• Whew... Aww, counting starts from 0! I thought it starts from 1. – null Sep 25 '19 at 4:52

## Nandy, 4 bytes

:#()


Never decrement: never end. (0 NAND 0 is 1. Thanks to @EdgyNerd for noting that.)

• This can be 4 bytes by just flipping to top of the stack then looping (since 0 NAND 0 is 1) – EdgyNerd Oct 6 '19 at 14:32

# Plumber, 7 bytes

[]
[[]]


This is the shortest possible infinite loop in Plumber.

Plumber programs are divided into units, which are always two characters wide (and padded to two with spaces if shorter). This one consists of three units: [], [[, and ]]. When a Plumber program is run, a 0 packet is dropped from all [] on the top row. This packet can be picked up by a ][, which pushes it to the sides.

A [[ will push it to the right, but it continues down (and is destroyed upon leaving the 2d space). Likewise, when the ]] is pushed into from either side (left in thus case), the packet is dropped and destroyed, and pushed back to the left. The [[ pushes it back to the ]], and this continues indefinitely.

# Taktentus, 4 bytes

_:=0


This is jump for line number 0 (first)

In English: https://esolangs.org/wiki/Taktentus

## Wi, 1 byte

I


Forever, execute the input (which is then not printed to the console).

## Wi, 4 bytes

Pretty much a terrible language for looping.

i""E


## Explanation

i   E % Foreach the range from 0 to positive infinity:
""   % Push the null string

Flags:i  % Implicit print disabled
$$$$

• Foreaching to infinity? That sounds like an interesting approach. Reminds me of TRANSCRIPT, which has no while loop -> no infinite loop -> not interesting to me. If only variables can be infinity... – null Dec 21 '19 at 13:56
• I feel glad that you find my language interesting! (I initially didn't think it as interesting...) – user85052 Dec 21 '19 at 13:57
• (Very off topic and self-promoting and attention-drawing and... but: Do you have prime detection in 1+?) – null Dec 21 '19 at 14:00
• And also, if W have "implicit print disable command" just like Retina, it could be 3 bytes XD – null Dec 21 '19 at 14:02
• Nope. The Foreach loop body has to be exist in W. If not this foreaches over the implicit input printing positive infinity on each iteration. – user85052 Dec 21 '19 at 14:03

TI-BASIC, 4 Bytes

Written in TI-BASIC for TI-83 or 84 series.

While 1:End


Previous version, 5 Bytes

Lbl A:Goto A

• What about prgmA where your program is called A? – Calculuswhiz Jun 24 '20 at 17:11

# Rust, 18 bytes

fn main(){loop{}}


Thankfully loop exists :) , recursion causes a stack overflow plus its the same amount of bytes.

# Integral, 6 Bytes

⌡◙d⌡◙d


Don't Try it! (it will screw up your browser)

• Wow, you mastered the mystery of Integral loops! – user96495 Aug 6 '20 at 6:04
• @petStorm infinite ones that is. – lyxal Aug 6 '20 at 6:06

# MAWP v1.1, 2 bytes

[]


Stack starts with 1, brackets loop as long as top of stack isn't 0.

Try it!

• 1+ 5 vs 2 MAWP (J is 5 bytes!) – null Aug 12 '20 at 10:02

main:x=x


One byte shorter than the classic main=main.

# ezfuck, 2 bytes

+{


Basically equivalent to +[] in BrainFuck.

+ increments the current cell to 1, then { jumps back a single command while the current cell is non-zero.

• The "non-competing" rule has been lifted, which means that this is a competing submission. – Esolanging Fruit Jul 9 '17 at 23:49
• @Challenger5 Oh, thanks. Are you sure? It doesn't say in the question that new languages are allowed. – Carcigenicate Jul 9 '17 at 23:53
• Marking as NC was the default for newer languages, but it was changed after a recent meta discussion – Esolanging Fruit Jul 10 '17 at 0:00
• @Challenger5 Awesome, thank you for pointing me to that page! That's certainly a welcome change – Carcigenicate Jul 10 '17 at 0:03

# 05AB1E, 1 Byte

[


Try it online!

[  # begin infinite loop


# International Phonetic Esoteric Language, 37 4 bytes

01ɑɒ
10   (loop bounds 0-1, set current IDX=0, LIM=1)
ɑɒ (since IDX<LIM, infinite loop)


7 bytes. Labels are fun.

|a|ʟ|a|


Defines a label a and jumps to a.

3 bytes (WIP language) (OLD)

ɘ0e


What the code does is push 0, then check if the stack is falsy, which 0 is. Then it jumps, without any output.

No TIO interpreter yet, but is runnable by cloning the repository above, and calling python3 main.py "code here".

ɘ0e
ɘ   ; begin falsy jump
0  ; push 0
e ; pop, if falsy jump; else end falsy jump


# sed, 3 bytes

:;b


Pretty simple. Make an unnamed label, then branch to it. Not all versions of sed support unnamed labels, in which case there is a 5 byte solution.

:a;ba


## NDBall, 11 bytes

(0)>0
(1)<0


the ball bounces back and forth forever

the ball starts on (0) then is told to move forward along the 0th dimension making it go to (1)

then at (1) it is told to move backward along the 0th dimension, making it go back to (0)

the new line is mandatory, hence the extra byte

this was done in NDBallSim V1.0.1

# Pixilang, 8 bytes

a:goto a


A pixel based programming language.

# C#9, 8 bytes

for(;;);


In C#9, they introduced Top-Level Statements which means one source file no longer needs any boilerplate.

• Welcome to the site, nice first answer! This is the shortest C# code I've seen in a while :p – Redwolf Programs Nov 23 '20 at 20:13

# Vyxal, 1 byte

{


Try it Online!

-3 thanks to answering the right question

## Explained

{      # Start an infinite while loop


# ARM Thumb-2 machine code, 2 bytes

e7fe

1:
b.n     1b


It is an instruction that jumps to itself. There isn't much else to it.

Being a single narrow instruction, it is the shortest possible solution.

# Canvas, 2 1 byte

⁹


Try it here!

⁹ redirects execution to the main program. This means the program contains a call to itself, so it runs forever.

## vJASS (Warcraft 3), 58 bytes

//! inject main
loop
endloop
//! dovjassinit
//! endinject


Without exitwhen inside the loop, it loops infinitely.

# Pxem, Filename: 4 bytes + Content: 0 bytes = 4 bytes.

• Filename: .w.a
• Content: none

# BRASCA, 3 2 bytes

1J


Try it!

## Explanation

1J - Move the pointer back one character.
`