# Question
Title: Shortest code to produce infinite output
Write the shortest code you can that produces an infinite output.

That's all. You code will only be disqualified if it stops producing output at some point. As always in code golf, the shortest code wins.

Here's a list of answers that I think are really clever, so they can get credit:

## Leaderboard

```
var QUESTION_ID=13152,OVERRIDE_USER=8611;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```

```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;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="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><div id="language-list"> <h2>Winners 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><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>
```

# Answer
> 231 votes
## Befunge (1)

```
.

```

Outputs `0` forever. It works because in Befunge lines wrap around, and you get `0` if you pop from the empty stack.

# Answer
> 114 votes
# x86 .COM Executable, 7

in hex:

```
b8 21 0e cd 10 eb fc

```

---

The others need kilobytes or more of system libraries and runtime. Back to basics:

```
$ echo -ne '\xb8!\xe\xcd\x10\xeb\xfc' > A.COM
$ dosbox A.COM

```

You can change the 2nd byte (`0x21`, or `!`) to change the output.

Uses a BIOS interrupt for output; doesn't need DOS, but I didn't have QEMU set up.

---

## Explanation

The machine code corresponds with the following assembly:

```
        mov     ax, 0x0e21
again:  int     0x10
        jmp     again

```

The output is all in the `int` call -- per this reference, int 0x10 with 0x0e in AH will print the byte in AL to the screen.

Knowing that register AX is a 16-bit word comprised of AH in the high byte and AL in the low byte, we can save an extra load (and thereby a byte in the machine code) by loading them together.

# Answer
> 106 votes
# Windows Batch file, 2 chars

```
%0

```

Calls itself infinitely.

# Answer
> 79 votes
# Befunge 98 - 2

```
,"

```

Outputs ",,,,,,,,,,," for eternity.

# Answer
> 66 votes
# sh, 3 bytes

```
yes

```

outputs `y` continuously

# Answer
> 43 votes
## GHCi + Data.Function, 8 bytes

Old thread, but a fun one is

```
fix show

```

in Haskell, it prints

```
"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\…

```

forever since it's basically running

```
let x = show x in x

```

It knows that `x` is a string, so the first character is `"`, so this needs to be escaped with `\"`, but know that `\` needs to be escaped so `\\\x`, and so on and so on.

# Answer
> 35 votes
**Windows Batch file, 9 characters**

```
:a
goto a

```

# Answer
> 35 votes
# Bash, 4 bytes

```
$0&$

```

Outputs `./forever2.sh: line 1: $: command not found` continuously.

Because `$0` is backgrounded, each parent dies after the invalid command `$`, and so stack/memory is not eaten up, and this should continue indefinitely.

Strangely the output gets slower and slower over time. `top` reports that system CPU usage is close to 100%, but there are memory- or CPU-hog processes. Presumably some resource allocation in the kernel gets less and less efficient.

# Answer
> 34 votes
## Java, 54 characters

Best attempt in Java:

```
class A{static{for(int i=0;i<1;)System.out.print(1);}}

```

# Answer
> 33 votes
# Brainfuck, 4

```
+[.]

```

Alternatively,

```
-[.]

```

# Answer
> 30 votes
# LOLCODE (36)

```
HAI IZ 1<2? VISIBLE "0" KTHX KTHXBYE

```

Thought I'd give LOLCODE a shot, has a surprisingly large amount of functionality.

# Answer
> 27 votes
### JavaScript: 14

> ## WARNING: you really don't want to run this in your browser

```
for(;;)alert()

```

# Answer
> 25 votes
## Turing Machine - 6 Characters :

```
#s->1Rs

```

where `#` is blank symbol (on the tape by default), `s` describes the only existing (start) state, `1` is printing a digit, `R` means shifting to the right, `s` at the end is staying in the same state.

# Answer
> 22 votes
## C, 23 chars

Slightly shorter than the best C/C++ answer so far. Prints empty lines infinitely (but if compiled without optimizations, overflows the stack).

```
main(){main(puts(""));}

```

# Answer
> 22 votes
# x86 .COM Executable, 5 bytes

in hex:

```
40 CD 29 FF E6

```

in asm:

```
inc ax
int 0x29
jmp si

```

Explanation:

`inc ax` increments the register AX by one. `int 0x29` is the "fast put char" routine of MSDOS, which simply outputs the value in AL (the low part of AX) and advances the cursor by one. `jmp si` is just a weird way to jump back to the top, since the register SI is 0x100 on almost every DOS-like operating system, which is also where a .com program starts ;) It's also possible to do a short jump instead, which also uses 2 bytes.

Sources:

MSDOS Start Values

Sizecoding WIKI

# Answer
> 21 votes
## Haskell, 10

```
print[1..]

```

I think this is the shortest code to

1. Print something out.
2. Create an infinite `Show`:able datastructure.

For those interested, it prints:

```
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,...

```

# Answer
> 18 votes
## Python 3: 15, 17, or 18 characters

mdeitrick's answer is longer in Python 3, which replaces the `print` statement with a function call (15 chars):

```
while 1:print()

```

This remains the shortest I've found in Python 3. However, there are some more-interesting ways of printing in an infinite loop that are only a few characters longer.

* `print()` returns `None`, which != 9, making it an infinite loop; the `8` is a no-op that substitutes for `pass` (18 chars):

```
while print()!=9:8

```
* `iter(print, 9)` defines an iterable that returns the output of `print()` until it equals `9` (which never happens). `any` consumes the input iterable looking for a true value, which never arrives since `print()` always returns `None`. (You could also use `set` to the same effect.)

```
any(iter(print,9))

```
* Or, we can consumer the iterable by testing whether it contains `8` (17 chars):

```
8in iter(print,9)

```
* Or, unpack it using the splat operator:

```
*_,=iter(print,9)

```
* The weirdest way I thought of is to use splat destructuring inside a function call, `function(*iterable)`. It seems that Python tries to consume the entire iterable before even attempting the function call—even if the function call is bogus. This means that we don't even need a real function, because the type error will only be thrown after the iterable is exhausted (i.e. never):

```
8(*iter(print,9))

```

# Answer
> 18 votes
## VBA: 12

Audio is output, right?

```
do:beep:loop

```

Put that in your 'favorite' coworker's favorite macro-enabled MS office file for some 'fun'!

```
Private Sub Workbook_Open()
    Do:Beep:Loop
End Sub

```

Bonus points if they're using headphones.

# Answer
> 18 votes
# Marbelous 4

```
24MB

```

Marbelous does surprisingy well here. This will post an infinite amount of dollar signs `$`, though it will hit the stack limit rather quickly.

**How it works.**

24 is a language literal, which will fall off the board and be printed to STDOUT as its corresponding ascii character. MB is the name implicitly given to the main board, since the main board has no input, it will fire every tick. And since cells are evaluated from left to right, the literal will always be printed before the next recursive call.

So this is rougly equivalent to this pseudocode:

```
MB() {
    print('$');
    while(true) MB();
}

```

## A solution without infinite recursion 11

```
24@0
@0/\..

```

This one works by looping the literal between two portals `@0`, whenever the 24 hits the lower `@0` it is transported to the cell underneath the upper `@0`. It the lands on the `/\`, which is a clone operator, it puts one copy of the marble (literal) on it's left (back on the portal) and another one to its right. This coopy then falls off the board (since `..` is an empty cell) and gets printed to STDOUT. In pseudocode, this would translate to:

```
MB() {
    while(true) print '$'
}

```

## A shorter solution without infinite recursion 9

```
24
\\/\..

```

This one constantly tosses the marble around between a cloner and a deflector, putting one copy on the rightmost cell, to be dropped off the board. In pseudocode that would look something like:

```
MB() {
    List charlist = ['$'];
    while(true) {
        charlist.add(charlist[0];
        charlist.add(charlist[0];
        charlist.pop();
        print(charlist.pop());
        // Wait, what?
    }
}

```

**note**

The `..` cells are necessary on the two last boards since the marbles would land off the board (and be discarded) otherwise. For some extra fun, you replace the `24` marble by `FF` and the empty `..` cell by a `??`, which turns any marble into a marble between 0 and it's current value before dropping it down. Guess what that would look like on STDOUT.

# Answer
> 16 votes
# perl, 10 chars

Here's another 10 char perl solution with some different tradeoffs. Specifically, it doesn't require the -n flag or user input to start. However, it does keep eating memory ad infinitum.

```
warn;do$0

```

save to a file, execute that file and you get eg:

```
Warning: something's wrong at /tmp/foo.pl line 1.
Warning: something's wrong at /tmp/foo.pl line 1.
Warning: something's wrong at /tmp/foo.pl line 1.

```

# Answer
> 16 votes
# piet - 3 codels

Outputs an infinite number of 1's

# Answer
> 16 votes
# Bitxtreme, 0.25 bytes

Binary representation:

```
00

```

From the documentation:

> The first bit of each pair is a pointer to the memory position which holds the value to subtract from the accumulator. The result is stored in that same memory position pointed to by the operand. If the result is negative (the bits are in two's complement representation) then the second bit of the pair will be added to the current PC, modulo 2.

The program counter and accumulator are initialized to zero; then, the contents of memory location 0 are subtracted from the accumulator. This happens to be 0, leaving the accumulator at zero. Since there was no carry, the second bit is not added to the program counter.

The program counter is then incremented by 2 modulo 2, sending it back to the start, and causing an infinite loop. At each step, the special memory location 0 is modified, causing its contents (a `0`) to be written to output.

It can be argued that this program should be scored as 1 byte, because the official interpreter in Python requires zero-padding. However, I don't think the zero-padding is really *code*.

# Answer
> 15 votes
# \>\<\> (Fish), 2

A creative way to use the infinite codebox of fish:

```
"o

```

Because the instruction pointer returns back to the beginning of the line after reaching the end, this code can essentially be read as

```
"o"o

```

which means 'read the string "o" and then output it'.

You can test the code here

# Answer
> 14 votes
# Z80Golf, 0 bytes

Try it online!

Surprisingly, this is an empty *machine code* program that produces infinite output.

### How it works

Z80Golf machine initializes all the memory and registers to zero, and then loads the code to address 0. But there's nothing to load, so the whole memory becomes a no-op program.

When the PC hits the address `$8000` (`$` indicates hex in Z80 assembly), `putchar` is simulated. It consists of printing the register `a` to stdout and a `ret` instruction. Initially the stack pointer `sp` is zero, and `ret` does `pc <- [sp]; sp <- sp + 2`. The whole memory is zeroed, so the `ret` always returns to the start of the program regardless of `sp`.

The conclusion is that an empty Z80Golf program is a program that infinitely prints null bytes.

# Answer
> 12 votes
# Summary: Ruby - 9, Golfscript - 6, \>\<\> - 2, Whitespace - 19, ~~Perl - 2~~

One language I know, and two I've never, ever, used before :D
EDIT: Perl one didn't work when I installed Perl to try it :(

## Ruby, 9

```
loop{p 1}

```

Simply prints 1 on separate lines continually.

Also, a bunch of alternatives:

```
loop{p''} # prints [ "" ]  on separate lines continually
loop{p p} # prints [ nil ] on separate lines continually

```

10-char solution:

```
p 1while 1

```

I was actually surprised that I could remove the space between the first `1` and the `while`, but apparently it works

## Golfscript, 6

```
{1p}do

```

My first Golfscript program! :P

## \>\<\> (Fish), 2

```
1n

```

## Whitespace, 19

```
lssslssstltlsslslsl

```

Where `s` represents a space, `t` represents a tab, and `l` a linefeed.

# Answer
> 12 votes
**C, 25 24**

```
main(){main(puts("1"));}

```

# Answer
> 12 votes
## dc, 7

```
[pdx]dx

```

prints 'pdx\n' infinitely many times.

# Answer
> 12 votes
# Minecraft \> 1.9 2 + 5 = 7 Bytes

Note that this version of this "language" was created after the question.

Surprisingly good for MineCraft. o-o

This is using this definition of MineCraft scoring.

The command `say 1` put inside of a permanently active repeating command block. It will permanently output `[@] 1` to the chat.

# Answer
> 11 votes
# Seed, 4 bytes

```
99 5

```

Try it online! Outputs `11` infinitely

Generates the following Befunge-98 Program:

```
[glzgx"Lz^v*M7TW!4:wi/l-[, s44~s;|Sa3zb|u<B/-&<Y a@=nN>Nc%}"gq!kCW $1{2hyzABRj*glr#z(@Zx@xT=>1'.b
/

```

Try it online!

---

The relevant part is just this:

```
[>1'.b
/

```

`b` pushes `11` to the stack and `.` prints it. `1` and `49` are also pushed to the stack, but never actually printed.

Animation of the code running:

# Answer
> 11 votes
# Vyxal, 4 bytes (UTF-8)

```

```

Try it Online!

Outputs `cookie` forever.

# Answer
> 9 votes
**BASIC**

```
10 PRINT "HELLO WORLD"
20 GOTO 10

```

# Answer
> 8 votes
## C, ~~26~~ ~~25~~ 24 (no recursion)

```
main(){for(;;puts(""));}

```

Prints endless `'\n'` characters. This is a byte longer than the shortest C answer, but doesn't rely on tail call optimization to avoid overflowing the stack.

# Answer
> 8 votes
# Postscript 9

```
{1 =}loop

```

Output 1 in an infinite loop.

# Answer
> 8 votes
# C, 20 bytes (competing according to the challenge's creator)

Suppose the following code is contained in `e.c`:

```
int i;
#include"e.c"

```

In a machine with infinite system resources, GCC will create an infinitely big temporary file trying to resolve a recursive #inclusion.

# Answer
> 7 votes
## R, 13 characters

```
repeat cat(1)

```

# Answer
> 7 votes
## Python, ~~17~~ 13

```
while 1:print

```

Thanks to Ben and r.e.s.

# Answer
> 7 votes
## PowerShell 2.0: 17 11 8

My initial solution:

> `while(1 -eq 1){1}`

Thanks to r.e.s.:

> `while(1){1}`

I think Danko Durbić has the winner, here. I'm not even sure why this should work, but it does and I can't think of anything shorter so far.

```
for(){1}

```

# Answer
> 7 votes
## C#, 57

Another C# entry, with a twist:

```
class M{static int Main(){for(;;)System.Console.Beep();}}

```

This interpretation of "output" may be stretching, but still valid I think (and saves 4 characters! :)

# Answer
> 7 votes
**Xojo, ~~18~~ 12 chars**

Again, please don't actually run this (same reason as the JavaScript answer):

```
do
Beep
loop

```

Never said the output couldn't be audio...

# Answer
> 7 votes
## Windows Batch File, 1 character

Create a file called **a.bat** containing:

```
a

```

When you execute this batch file, it executes itself. The Windows Command Prompt by default echos every command to the console, so the output resembles:

```
C:\>a

C:\>a

C:\>a

C:\>a

```

# Answer
> 6 votes
### sed ~~7~~ 5 chars (version 4.2)

```
sed -e ':;p;b' <<<'Hello world!'

```

Unfortunely, this won't work anymore, from version 4.4 of GNU sed:

```
sed -e ':a;p;ba' <<<'Hello world!'

```

# Answer
> 6 votes
# Perl 6, 13 11 characters

Using some nice Perl6 syntax for infinite lazy lists:

```
.say for ^∞

```

The code will print all integers from 0 upto infinity or until RAM runs out to store single big integers, whichever comes first.

# Answer
> 6 votes
# Brachylog, 2 bytes

```
ẉ⊥

```

Try it online!

Not only does it print infinitely, this prints something much more interesting than most answers here: all integers.

### Explanation

```
        Assign an integer value to the input ; since it is not constrained, it can take any
          value in (-∞, +∞), meaning there is an infinite number of choice points
        The way = is implemented makes it so that the order of choices it will try is:
          0, 1, -1, 2, -2, 3, -3, …

 ẉ      Write that integer to STDOUT, followed by a linebreak
  ⊥     False (i.e. go back and try the next integer choice point)

```

# Answer
> 6 votes
# Microsoft Word Math AutoCorrect, 4 bytes

1. Add a new entry in the **Math** AutoCorrect table (not the regular one): `$` -\> `$$`. This makes a new production rule for us. (3 bytes)
2. Insert an Equation (Alt + =), and type a single `$`. The AutoCorrect will replace it with a `$$`, but that's not you inputting any extra characters, so it doesn't add to the byte count. This initializes our memory tape. (1 byte)
3. Press the "Professional" button under Equation Tools. This is where the program officially starts running.
4. Watch the little right-moving Turing Machine freeze up Word.

## Explanation

The Professional button makes the Autocorrect sweep from left to right, running the production rules. On initial state `$$`, it sees a `$` in the first position and replaces it with `$$`.

1. Then check the next position to the right.
2. Replace `$` with `$$`, otherwise halt.
3. Repeat.

Note: the GUI doesn't show the `$`'s being generated as the GUI doesn't update until the operation halts, which it won't here. If you open up your Task Manager, you can see the memory usage going up to see that this is indeed what's happening. Sure, I could have made it produce more `$`s but the production rate would still just be O(1) per loop anyway, and I'd be spending precious bytes programming it. Oh, and I'm counting the `$`s as output.

# Answer
> 5 votes
# tinylisp, 15 bytes

```
(d f(q(A(f g
(f

```

Try it online!

An infinite stream of errors. Just as DLosc intended, hopefully.

# Answer
> 4 votes
## Haskell, 18 chars

```
a=1:a;main=print a

```

N.B.: No new line at end!

# Answer
> 4 votes
**Perl, 10 chars**

TIMTOWTDI:

```
$ perl -nE 'say;redo' <input>   # 10 chars (1+8+1)
$ perl -E 'say while+1'         # 11 chars
$ perl -E 'o:say;goto o'        # 12 chars
$ perl -E 'for(;;){say}'        # 12 chars
$ cat inf.pl
warn;exec$^X,$0                 # 15 chars

```

If you have infinite RAM (maybe in the cloud ;-)

```
$ perl -E 'sub o{say;&o}o'      # 14 chars
$ perl -E '&{*1=sub{say;&1}}'   # 17 chars, just kidding *gg*

```

# Answer
> 4 votes
# Matlab, 13

```
while 1
1
end

```

This prints

```
ans =

 1

```

infinitely many times.

# Answer
> 4 votes
# PHP - ~~17~~ ~~16~~ ~~13~~ 11 bytes

```
<?for(;;)echo O;

```

Oh well, I guess PHP can't ~~ever~~ always win... <sub>Thank you, m.buettner</sub>

Edit:

```
<?for(;;)0/0;

```

As it turns out, division by zero triggers a warning in php. So, even though the output it produces goes to `STDERR`, it's still infinite!

Edit 2:

```
for(;;)0/0;

```

(Run with `php -r`)

# Answer
> 4 votes
# Emotinomicon 18 bytes, 5 chars

```
⏪⏩

```

Explanation:

```
 - push 0 to the stack
⏪ - open loop
 - push 0 to the stack
 - pop top of the stack, and output it as a number
⏩ - end loop

```

As long as there's something on the stack, it's going to loop indefinitely

# Answer
> 4 votes
# Wolfram Language ( Mathematica ) 14 bytes 12 characters

```
Do[Echo@1,∞]

```

# Answer
> 4 votes
# Bash, 3 bytes

```
top

```

Haven't seen anyone do this yet. It's tied with the `yes` answer.

# Answer
> 4 votes
# unsure, 20 bytes

```
um but uh okay wait

```

Don't try it online, it freezes the browser. Listen to the code. Even it wants you to wait. Think this through. Don't be like me. Don't lose that unsaved tab.

# Answer
> 4 votes
# tinylisp, 13 bytes

```
(d f(q(a(f
(f

```

Try it online!

Outputs an infinite stream of errors. -1 thanks to DLosc.

The tinylisp interpreter throws a warning because `a` shadows the builtin `a`, but continues evaluation.

# Answer
> 3 votes
## APL, 7

```
{∇⎕←⍵}1

```

Defines a function which output its argument and call itself with the same argument, then call it once with argument `1`

# Answer
> 3 votes
# Brainfuck, 8 bytes

```
+[[+.]+]

```

Assumes wrapping.

I'm aware that a solution was already posted by @cardboard\_box - allthough his doesn't print any printable characters.

# Answer
> 3 votes
# Ruby, 9 bytes

```
loop{p 1}

```

`p 1` is equivalent to `puts 1.inspect`

Try it online!

# Answer
> 3 votes
**Shell, 16 Chars**

```
cat /dev/urandom

```

# Answer
> 3 votes
**Haskell, 9 characters**

```
show[1..]

```

Prints an infinite list of integers starting from 1, exploiting the lazy evaluation of Haskell.

# Answer
> 3 votes
# Piet, 3 codels

==\> \<== here it is ;)

Just to make it visible, the same at codel size 10:

This program bounces forward and backward, executing:

forward direction:

```
1
PSH (push on stack)
OUN (output number)

```

backward direction:

```
MUL (multiply)
POP (pop from stack)

```

The backward instructions are ignored because the stack is empty.

So, the program prints an infinite amount of 1’s in the console.

Edit: I just noticed that captncraig came up with the same answer before me. Sorry for that. Please upvote captncraig’s answer instead.

# Answer
> 3 votes
# Jelly

**2 bytes**

```
Ȯß

```

Try it online!

### How it works

```
Ȯß  Main link. Implicit argument: 0

Ȯ   Output/print the implicit argument.
 ß  Recursively call the main link.
    Thanks to tail call optimization, this results in an actual infinite loop.

```

# Answer
> 3 votes
# Desmos, 1 byte

```
x

```

Graphs y=x forever.

# Answer
> 3 votes
## GNU sed, 5 bytes

```
:;l;b

```

Any sed script requires input to start executing. With `echo|sed ':;l;b'`, a line with a single `$` character on it is printed continuously.

# Answer
> 3 votes
# TeX, ~~14~~ 12 bytes

```
\def~{x

~}~

```

Less infinite than the other solutions, though, as TeX writes its output to a file.

# Answer
> 3 votes
# Java (JDK 10), 32 bytes

```
a->{for(;;)System.out.print(1);}

```

Try it online!

# Answer
> 3 votes
# Japt, 4 bytes

```
i@Oo

```

Try it online!

### How it works

```
Ui@Oo

Ui     Call every 10 milliseconds...
  @Oo    the function that prints `undefined`.

```

Without input, `U` is initialized to zero, and `0 .i` is the wrapper for `setInterval` JS function. According to its spec, the interval is low-capped at 10, so the target function is called every 10ms (approximately).

`Oo` prints its arguments to output, and with no arguments, it prints `undefined`.

---

The following is only correct with unbounded call stack (and therefore not a valid submission). When run on an actual browser, it overflows the stack in an instant.

## 3 bytes

```
ßOo

```

Try it online!

`ß` recursively calls the program. The whole source is translated to `rp(O.o())` which first calls `O.o()` and then calls the program again.

# Answer
> 3 votes
# Intercept 1.1, 37 bytes

*Almost exact copy of my answer to a different question.*

```
malware bm bitminer
software install 1

```

Prints newlines to the terminal. You'll probably have to leave this one overnight, as there is a delay of 5-15 minutes between each newline.
Will print infinitely as long as:
Your internet connection does not drop.
Nobody runs an antivirus program on your system.
Input is marked with a `>>`. The command prompt is the empty `>>`.
Assuming a system with only `TZ_INFECT` installed...

```

>> malware bm bitminer
creating bm (bitminer)
... wait a minute ...

finished creating bm (bitminer)
>> software install 1
Success
bm installed

...wait...
(newlines)

>>

```

Note that I'm using a custom client that prefixes `[BROADCAST]` to all `broadcast` events.

# How???

`TZ_INFECT` is Intercept's malware generator. We can generate a bitminer by running `malware <name> bitminer`. This will create a new piece of software with the given name of type `bitminer`

We then install the bitminer: `software install <index>`, where `index` is the 0-based index of the software as given by `software list`. This is why I made sure the only piece of software on the system was the malware generator. This places our new bitminer at index `1`.

There is a bug in the implementation of `bitminer` that results in an empty `broadcast` event to be sent to the client whenever bits are generated. Since bits are generated at random intervals, the broadcasts are sent at random intervals. Forever.
Note: the newlines are harder to detect using the official game client, but you can see them by running a command and watching the newlines slowly push the resulting output off the screen.

# Answer
> 3 votes
# TeX, 11 bytes

The following results in an infinite amount of `Undefined control sequence.` errors (if run in batch mode no human interaction needed):

```
\def~{\[~}~

```

# TeX, 14 bytes

The following creates a PDF with infinite lines each containing a dot (theoretically that is, since the process never terminates, the file isn't finalized so not really created). I've stopped the process after more than 1000000 pages were output. At some point memory wouldn't suffice anymore for this.

```
\def~{.\par~}~

```

# Answer
> 3 votes
# , 1 byte

```
I

```

Try it online!

Outputs `IôŸ` (the bytes `49 f4 9f`) repeated forever.

## Explanation

In binary, `I` is `01001001`, which is broken into 3-bit chunks to get `010 010 01`. This (including the implicit trailing bit `1`) is converted to octal to get the instructions `223`. These instructions are executed and push **`223`** on the frame to get **`||223`**.

The last section of the frame (**`223`**) is copied to the command list, and executed. **`2`** duplicates the last section, and the second **`2`** duplicates the duplicate, leaving **`||223|223|223`** on the frame. **`3`** outputs the last section of the frame, **`223`** (which is automatically converted to `7223` because it contains anonymous commands) and then removes the last two sections. This leaves the frame as **`||223`**.

This process (executing **`223`**) is repeated forever, each time adding `7223` to the output.

The very first `7` specifies the output format as "the same way the source was", meaning that each future command in the output adds three bits. This means that output consists of the bits `010 010 011 111` (from `2237`) repeated forever. This is `49f` in hexadecimal, so repeating it leads to the bytes `49 f4 9f 49 f4 9f ...` .

# Answer
> 3 votes
# \[BASIC\] 10 9 bytes

```
1?:goto 1

```

Try it online!

Infinite carriage return/line feeds. (I saved a byte when I realized I could just output new lines without a 0 or other character!)

It's the first program every BASIC programmer learnt back in the day! Good old "GOTO" and the hatred it earned from "real" programmers...

Of course, a more "structured" version would use an infinite WHILE loop, but that's 6 bytes more:

```
while(1):?:wend

```

Try it online!

(note:TIO truncates the output eventually, but in a standard BASIC interpreter, the code will run forever.)

# Answer
> 3 votes
# Zsh, 15 bytes

```
while;do 0;done

```

prints `command not found: 0` infinitely

Try it online!

# Answer
> 3 votes
# Cascade, 5 bytes

```
}h
|"

```

Try it online!

-2 bytes thanks to Jo King.

# Answer
> 3 votes
# Grass, 11 bytes

Taken from original document (Japanese):

```
wWWwwwwWWww

```

Try it online!

## How it works

In pseudo code:

```
function f(x){
   Out("w");
   return x(x);
}
f(f)

```

# Answer
> 2 votes
# TCL (15)

```
while 1 puts\ x

```

(kind'a silly that we must write at least 30 characters per reply :)

# Answer
> 2 votes
# TI-Basic, 5

```
Pause

```

It does produce infinite output; in the top right hand corner, the pixels are alternating ;)

# Game Maker Language, 11

```
while(1){a}

```

The `a` produces errors infinitely ;)

# Answer
> 2 votes
## F# - 22

```
while 1=1 do printf"x"

```

# Answer
> 2 votes
**PowerShell (8)**

Save "a.ps1" file with following script code:

```
1
.\a.ps1

```

from command line run the script.

My initial solution was different, but I found that it has already been answered by Iszi.

I managed to write another solution with same byte length.

# Answer
> 2 votes
**PDP-11 Machine Code: 2 bytes (or 6 if you actually want output)**

```
mov -(pc),-(sp)    ; octal opcode = 014746

```

On many PDP-11's, this instruction will actually do what it says - back the PC up, push its own opcode onto the stack, and repeat until all 64K ram is used up and then just keep filling circularly (or until something like a segfault happens). Not really infinite output, but it's in the spirit.

In 6 bytes you could do this, sending characters directly to the console

```
mov #SerialPortTxRegAddr,r0  ; oct= 012700 177562 hex = 0x15C0  0xFF72
movb -(pc),(r0)              ; oct= 114710        hex = 0x99C8

```

Which would send a series of 0xC8 characters (these would be probably be seen as 'H' by any terminal which would be attached to the PDP-11)

Yes, I'm actually that old :-)

# Answer
> 2 votes
## Mathematica, 11 bytes (invisible) or 17 bytes (visible)

Clearly not going to win here, but it works

```
For[,0<1,1]

```

If you actually want to see the characters streaming down the screen, use

```
For[,0<1,Print@1]

```

(20 bytes). I had thought I might do well with

```
Range@∞

```

or even

```
1~Table~{∞}

```

But to my surprise, the Kernel checks for infinite bounds and disallows them.

# Answer
> 2 votes
# Zozotez LISP: 7

When started with the minimal interactive session dictated in the documentation:

```
(:'r p)

```

How it works is that it redefined read so the REPL prints what print returns rather than keyboard input. The never ending output is continious lines of: `Zozotez-moi~>NILNIL`

When started with the full interactive session it gets longer, but does the same (10 bytes):

```
(:'read p)

```

Without a bootstrap Zozotez does just `(eval(read))` thus we need to implement a loop in one expression (16 bytes):

```
((:'z(\()(p)(z))))

```

The `:` is set to it binds z to the lambda expression `(\()(p)(z))`, when called without arguments calls print (`p`) with default argument `NIL`, then calls `z` (recurses).

`:` returns the value (the function) so wrapping it all in parenthesis makes the initial call.

# Common Lisp: 15

```
(loop(print())) ; prints infinite lines of NIL

```

# Racket: 21

```
(let z()(print'N)(z))

```

Works similar. The names let makes and calls the proecdure l that takes no arguments. The body prints N, then recurses. print without arguments displays data quoted so it prints `'N'N'N....`

# Scheme: 23

```
(let z()(display'N)(z))

```

Same as Racket version only that display is used which don't quote output. `NNNN...`

# Answer
> 2 votes
I've got two:

## C - ~~27~~ ~~26~~ 24 bytes

```
main(){for(;;)puts("");}

```

This one infinitely prints `\n`, due to the behavior of `puts(3)`

## Brainfuck - ~~13~~  bytes

```
+[.]

```

This one infinitely prints the invisible Start Of Heading control character.

---

(Thanks to scottinet, Sylwester and Erik the Golfer for suggestions that helped shorten the answer)

# Answer
> 2 votes
**Piet (135 codels/pixels)**

Prints an infinite sequence of $ signs (arbitrary, could've been anything. Loaded in the upper right corner of course).

Run with npiet -v11 the.gif

# Answer
> 2 votes
# Atari 8-bit Basic — 7 characters

```
1L.:G.1

```

This is what you can type. Internally, it expands to:

```
1 LIST : GOTO 1

```

In Atari 8-bit Basic you can use `LIST` in a program.

I seem to remember this shorter sequence:

```
1L.:R.

```

Which expands to:

```
1 LIST : RUN

```

This would work, but I'm not sure if `R.` corresponds to `RUN`.

# Answer
> 2 votes
# Rebol, 18 chars

```
forever[print now]

```

Can shave off 1 perhaps even 2 more characters by choosing something different to `now` (for eg. `pi`).

However I like that it prints the time forever :)

# Answer
> 2 votes
## Thue, 19

```
b::=~1
a::=ba
::=
a

```

The code prints an infinite stream of 1's.

The code is quite simple and easy to understand.

* `b` *can be* expanded as "output 1" (then b is replaced with empty string)
* `a` *can be* expanded as/replaced by `ba`
* `::=` on its own ends the list of rules
* `a` on the last line represents the initial state.

# Answer
> 2 votes
# Brainfuck - 6/4

Brainfuck does this easily:

```
-[.>-]

```

If we assume that the interpreter didn't zero the cells on startup but instead gave us already-initialised cells, the count goes down by two:

```
[.>]

```

# Answer
> 2 votes
# Bash, 9 characters

```
echo 1;$0

```

Because the $0 variable always holds the filename.

# Answer
> 2 votes
## C# (16)

Directly executable in LinqPad:

```
for(;;)0.Dump();

```

# Answer
> 2 votes
# Pyth, 2

```
#G

```

(or `#` followed by any normal variable, actually).

`#` is `while True`. Variables are printed implicitly, and since `G` is `'abcdefghijklmnopqrstuvwxyz'`, that gets printed infinitely.

# Answer
> 2 votes
# QBasic, 6 (5?) characters

```
?1:RUN

```

`?` is short for `PRINT`, and `RUN` without arguments runs the current file from the top. This is the shortest (and most interesting) way to get an infinite loop in QBasic.

If, as in the accepted answer, infinite newlines count, then I present this 5-character version:

```
?:RUN

```

# Answer
> 2 votes
# x86 machine code, 6 bytes

```
b40e cd10 ebfc

```

Assembly version of the code:

```
mov ah, 0Eh;    bios teletype output
code_golf:
int 10h;        print character(ascii 0)
jmp code_golf;  loop

```

This code constantly prints ASCII 0 (NULL).

This was run using DOSBOX

# Answer
> 2 votes
**The Hexadecimal Stacking Pseudo-Assembly Language** (24):

```
000000
400000
120000
010000

```

Continuously prints 0s.

# Answer
> 2 votes
# APL, ~~6~~ 4 bytes

```
→⍞←1

```

A traditional style APL function, so even works on all legacy APLs.

# Answer
> 2 votes
# ArnoldC, 81 bytes

```
IT'S SHOWTIME
STICK AROUND 1
TALK TO THE HAND 0
CHILL
YOU HAVE BEEN TERMINATED

```

Prints `0` forever.

### Explanation

```
IT'S SHOWTIME            # start program
STICK AROUND 1           # infinite while loop (since 1!=0)
TALK TO THE HAND 0       # print 0
CHILL                    # end loop
YOU HAVE BEEN TERMINATED # end program

```

# Answer
> 2 votes
## APL, 4 bytes

```
1
→1

```

This code must be put in a function, since the →(goto) operator has only sense in a function.

# Answer
> 2 votes
# Oration, 21 bytes

```
to iterate, 1
listen,

```

40 bytes:

```
to iterate, 1
listen,
capture,
that's it

```

The first does `print()` (but it's python 2, so prints infinite `()`), the second does `print('')` (the capture begins a string and the that's it ends it).

# Answer
> 2 votes
# Sesos, 2 bytes

```
0000000: 2c06                                              ,.

```

Prints an infinite amount of ones.

Try it online! Check *Debug* to see the generated binary code.

### How it works

The binary file above has been generated by assembling the following SASM code.

```
set numout ; Switch to numeric output

add 1      ; Set the current cell to 1.
jmp        ; Jump to the corresponding exit marker.
    put    ; Print the integer in the current cell to STDOUT.
           ; (implicit jnz)
           ;     If the integer in the current cell is non-zero,
           ;     jump to the previous instruction.

```

# Answer
> 2 votes
# Cubix, 2 bytes

```
.O

```

**Test it online!**

Cubix is a stack-based 2D language, created by me in March 2016. Cubix differs from ordinary 2D languages in that it's not strictly 2D: the code is wrapped around a cube. This program wraps to this cube net:

```
   .
>O . . .
   .

```

where the IP (instruction pointer) starts at the arrow. `O` outputs the item on top of the stack as a number; if the stack is empty, it outputs `0`. `.` is a no-op.

When the IP reaches the right side of the cube net, it simply wraps back around to the left and runs `O` again. Thus, this code outputs `0` forever.

# Answer
> 2 votes
## Ruby, 10 bytes

```
loop{puts}

```

This program prints out an infinite stream of newlines.

# Answer
> 2 votes
# Retina, 4 bytes

```
+:`0

```

**Try it online**

Doesn't match, so output `0`, then it does match so output `1`, now it doesn't so output `0`, etc...

# Answer
> 2 votes
# Emojicode, 41 bytes

```
.

```

# Answer
> 2 votes
# Dyalog APL, 5 bytes

```
⍞←⍣⊢0

```

`⍞←` character output

`(f⍣g)Y` power operator repeatedly applies left operand to the argument until `(f Y) g Y` returns true. In this case `f` is the assignment to output and `g` is  which returns the right argument, which is always `0` as the assignment doesn't modify it.

Note that the right operand could also be any of `⊣≠≢`

I hesitate to add a link to try it online :)

# Answer
> 2 votes
# Chip-8, 5 bytes

Sound output counts, right?

```
0x6F 0xFF 'set register 15 to 255
0xFF 0x18 'set sound timer to the value of register 15
0x12      'jump to first instruction (second byte is 00 so it can be omitted)

```

If drawing graphics counts, 3 bytes:

```
0xD0 0x0F 0x12

```

# Answer
> 2 votes
# Shakespeare Programming Language, 116 bytes

```
.
Puck, a pig.
Page,.
Act I:.
Scene I:.
[Enter Puck and Page]
Page:
Open thy heart! Let us return to act I.
[Exeunt]

```

Will output -1 forever.

# Answer
> 2 votes
# HTML + JavaScript, 35 bytes

This alerts repeatedly. For some reason, it alerts `8`. It also produces a 404 error in the console each iteration.

```
<img onerror=alert(this.src=x) src=

```

**JSFiddle**

---

This is 32 bytes, but is far less interesting:

```
<img onerror=for(;;)alert() src=

```

# Answer
> 2 votes
# Shakespeare Programming Language, 89 bytes

```
,.Ajax,.Puck,.Act I:.Scene I:.[Enter Ajax and Puck]Scene V:.Ajax:Speak thy!Let usScene V!

```

Try it online!

I haven't used this language before, this is mostly based on tips from "Tips for golfing in The Shakespeare Programming Language", so I think it can be made shorter.

# Answer
> 2 votes
# Alchemist, 10 bytes

```
_->_+Out_a

```

Try it online!

### Explanation

Initially the universe contains the `_`-atom, there is only one reaction consuming `_` and creating a new `_` with the side-effect of printing `a`. This will go on until the real universe terminates.

# Answer
> 2 votes
# Lean Mean Bean Machine, 5 bytes

```
O
$
~

```

Try it online!

Endlessly output `0`

`O` spawns a marble, which drops and runs the operation there each tick. New marbles have a value of `0`.
`$` prints the marble's value.
`~` teleports the marble to the top of the current column.

# Answer
> 2 votes
# TI-BASIC, 5 bytes

```
Disp 1:prgmA

```

This solution requires that the program's name is `prgmA`.

Displays `1` on a new line forever, or at least until the calculator runs out of free RAM.

---

Here's an alternative **7 byte** solution that is guaranteed to never terminate:

```
While 1:Disp 1:End

```

It has the same output as the above solution.

---

**Notes:**

* Each successive `prgmA` call uses up 16 bytes of free RAM.
* If there aren't 16 free bytes, then the program crashes with an `ERR:MEMORY` error.

# Answer
> 2 votes
## Keg, 4 characters

```
{A,}

```

This outputs "A" to the console infinitely.

## Non-completing forms

This simply auto-completes the `}` at the end.

```
{A,

```

```
{

```

This uses a later-added feature of auto-pushing & printing.

# Answer
> 2 votes
## bitch, 3 characters

Yet another answer(am I supposed to be doing that?)

```
>/<

```

This program outputs infinite 0's to the console.

# Answer
> 2 votes
# Bitwise Cyclic Tag But Way Worse, ~~9~~ 1 byte

```
2

```

Turns out that this is a valid answer, I over-complicated that way too much. Outputs endless null characters

Try it Online!

# Answer
> 2 votes
# Rabbit~, 3

```
]:[

```

Prints the number 93 (Int representation of '\]') infinitely.

Inverted brackets loops while input is equal, doesn't terminate since input is always '\]'

# Answer
> 2 votes
# Rust, 23 bytes

```
fn main(){loop{dbg!()}}

```

Try it online!

> Outputs infinitely:
>
> ```
> [src\main.rs:1]
> [src\main.rs:1]
> [src\main.rs:1]
> [src\main.rs:1]
> [src\main.rs:1]
> [src\main.rs:1]
>
> ```

# Answer
> 2 votes
# Shakespeare Programming Language, 86 bytes

```
8.Ajax,.Puck,.Act I:.Scene I:.[Exeunt][Enter Ajax and Puck]Ajax:Speak thy.Let usAct I.

```

Try it online!

Prints infinite literal NULs. Since all characters initialize to 0, we can just print the value of one of them and loop back to Act I. I use Jo King's trick of beginning Scene I with `Exeunt` to save bytes over using a second scene. Pretty simple stuff.

# Answer
> 2 votes
## VisiCalc, 3 bytes

You need an extra newline to enter the instruction.

```
/-/

```

The trailing newline is significant.

## Explanation

<pre><code>/   Start a command:
 -  Replicate forever
  / The target for replication is the / character
Extra newline to enter the instruction

You end up with a cell with an infinite number of /'s.
However, the current cell can only show a finite amount
of /'s because cells are trunctuated based on their lengths.
```
</code></pre>

# Answer
> 2 votes
# Malbolge, 1505 bytes

```
b'a;$9"~}HG{iyxwuu?O=pL:]mHj5!3DCezRQ=+^:('&Y$#m!1So.QOO=v('98$65a!}^{@hyf<WV9sr%4#I20FEJVBfw)btOr@#!7~|4{y1xv.us+rp(om%lj"ig}fd"cx``uz]rwvYnslkTonPfOjiKgJeG]\EC_X]@[Z<R;VU7S6QP2N1LK-I,GF(D'BA#?>7~;:9y16w43s10)p-,l*#(i&%e#d!~``{tyxZpuXsrTTongOkdMhg`Hd]ba`_^W@[ZYXW9UNSRQPOHMLKJ-++FE''<A$?>=<;:387xw43s10/(-&m*)('&}${d!~}|^zyxwvutmVqpiRQlkjiKafedc\E`_^@\[ZYX;V9NMRQ42NGLK.IH*F?DCBA$#>7~;{{8xx5uu2rr/oo,ll)ii&f|e"!aw`{z\r[vXnmVTpongPkNihgJ_dcFa`B^]\UZ=RWV8TSLQ4ON0LE.IHA)E>'BA:?!7~5|38y6/v321q).-&m*)i'&%|{d!~}_{zs\wvutsUqTonPlOjiKgJedFbE`_A]@[Z<X;VU7S6QP22GL/JIB+FEDC%;@?>7~;:987w5v32r0)p-,+k)('~g$#"b~w|uz]xwvutsrqTinQlOjLhgfeH]bE`CB]\>ZSXWVUTSRQPON1LE.I,+*((&&$$""~~||zzxxv4u210/(-n+l)(i&g$ddy~}`u^]\ZvutVlUjSQQOOMMKgfeG]F[DBB@@>><X;99NS6QP3NG0KJ-H+F(('<%@#"~~||z876v.u,sqqoommkki'&%e{dyb``^^\\ZvuWslUjoRmlNNibgJeHcFDDY^A\[Z=XQV987553311/KJI+A*?(&BA@"8!6}{9zxx/43s1*q(ommkki'h%$ecc~}v_^][wZutWrUpohQlkNiLgIIHcbaZ_B]@[><<QVUT6L5JO2MLK.IHGF?(C&%:#!=<|:3z1xvvttr0/.n&m$ki'&f${dyb``^zyxZpYnWUUSSQmPkjLLgfedc\aD_BA?[>YXW:UTSRQJO2ML/J-H**?DC&;$?"!}}{{y765u-t+rppnn%*kii~%f#"!xa|_zyxZpYnWUqpoQgPeNLLJJHHFFDDBB@\?ZY;;PU8S6QPO1G0EJ-HGF)>C&%@#>=~;|92y65v3t1qqp-&ml)j'&gee"!x}|{z]xwYutWlqTonmPkjchgfIHFF[`_^@V?T=;;997SRQ3I2G0.JI+G@)>'%%##!!}}{987w/v-2sqq(onI*6FXDDU0S!Q>O{]sKwp$#s!Uj|nPle+vbK'_7$\n!Y|@{?=,XW:('6_^#3NlkKJIBxe?b'a;^#8[<Z|zVy0SetPb=`o'm8Hk(E3CCe@Rb`<*:sKJ%54"2DS/AQlOj)hK`HdGbn`2^Az.T<;WV87rRo#m[MLjJVyASdu&<$q"8J}}{z2xwwe3cOa/on,JH#iigCUe"yba+*)][wI$4Wr2CRRz?kN*ht9&^cF!mCB{izyx;vt8'65Q42[Z0.hI+xeRQ

```

Try it online!

This was built with Prof. Masahiko Sakai's LAL toolchain from the following source code.

```
PROGRAM_START_TO ENTRY@Argh

ROUTINE Argh {
REV_JMP:REV JMP

ENTRY:

OUTPUT
DUP

JMP REV_JMP
}

```

Online LAL assembler

# Answer
> 2 votes
# MAWP, 4 bytes

```
[!:]

```

Explanation:

```
[     start of loop
!     duplicate top of stack (1)
:     print top of stack
]     end of loop

```

Prints 1 infinitely

# Answer
> 2 votes
# Vim, 10 bytes

`<esc>` is the byte typed when you press the escape key

```
qqiq<esc>@qq@q

```

This will output q infinitely into your vim buffer.

Here's how it works:

```
qq          # create macro q
  iq        # enter insert mode and type q
  <esc>     # escape to normal mode
  @q        # make the macro call itself
q           # end macro
@q          # call macro q

```

# Answer
> 2 votes
# 05AB1E, 1 byte

Try it online!

```
∞  # [1, 2, ..., ∞]
   # implicit output

```

# Answer
> 2 votes
# GFortran, ~~21~~ 18 bytes

Endless newlines. Try it Online!

```
1 print*;goto1
end

```

Alternate solution (19B), hopefully less annoying for @Sapphire\_Brick!

```
do;print*;enddo
end

```

# Answer
> 2 votes
# Vyxal, 1 byte

**Don't try it online**

Polyglots with 05AB1E.

# Vyxal, 2 bytes

```
{፣

```

A bit more of a creative way to do the job.

# Answer
> 2 votes
### Brainf\*ck (4 bytes)

```
+[.]

```

Infinitely produces `0x01` character.

# Answer
> 2 votes
# PowerShell, 8 bytes

```
for(){1}

```

Try it online!

Not the most clever, but it gets the job done.

# Answer
> 2 votes
# Dis, 1 byte.

```
{

```

Outputs infinite amount of NULL characters; may be slow, depending on the implementation.

# Answer
> 2 votes
## Arduino, ~~61~~ 60 bytes

Managed to shave off one byte by changing what counts as "output".

```
void setup(){pinMode(13,1);digitalWrite(13,1);}void loop(){}

```

Explanation:

```
void setup() {
  pinMode(13, OUTPUT); // OUTPUT is defined as 1
  // Arduino boards have a built-in LED connected to pin 13, hence the choice of pin
  digitalWrite(13, HIGH); // HIGH is defined as 1
}

void loop() {}

```

This leaves the built-in LED on, which in a sense is output.

---

Original answer:

```
void setup(){Serial.begin(300);}void loop(){Serial.print(0);}

```

Fills the Serial monitor with `0`s.

# Answer
> 2 votes
# Nim, 16 bytes

```
while 1>0:echo 0

```

# Answer
> 2 votes
# ℒight, 0 bytes

Prints "#" infinitely.

# Answer
> 2 votes
# TRANSCRIPT, 33 bytes

```
You can see a f here.
>TIE F TO F

```

Try it online!

Generate endless warnings due to unclosed loop. At first it doesn't seem possible to loop infinitely in TRANSCRIPT because it only have for loops, but this works.

# Answer
> 2 votes
# Seed, 4 bytes

```
1 87

```

Try it online!

# Answer
> 2 votes
# Dyalog APL: 8 characters

Now you can choose what to infinitely print out! Yeeeay!!!

```
{⍞←⍵⋄∇⍵}

```

# Answer
> 2 votes
# Assembly (MIPS, SPIM), 8 bytes

```
main:j$0

```

Try it online!

This has both infinite stdout output *and* infinite stderr output, meaning that I have \\$\infty * 2\\$ output. Clearly that makes my answer twice as good as the others and I should win .

Jumps to the zero register, which is an invalid address. Without macros:

```
main:
    # Jump to the address in the zero register, which is 0
    jr  $zero

```

This causes the default exception handler to emit the following error message repeatedly while it advances the PC past the offending instruction to "solve" the problem.

```
  Exception 6  [Bad instruction address]  occurred and ignored
  Exception 6  [Bad instruction address]  occurred and ignored
  Exception 6  [Bad instruction address]  occurred and ignored
...

```

All while the interpreter also prints this error message to stderr:

```
Exception occurred at PC=0x00000000
  Bad address in text read: 0x00000000
Exception occurred at PC=0x00000004
  Bad address in text read: 0x00000004
Exception occurred at PC=0x00000008
  Bad address in text read: 0x00000008
...

```

This continues until it eventually wraps to `__start`, jumps to `main`, then jumps back to `0x00000000`.

# Answer
> 2 votes
# (,), 10 Chars or \\$10\times \log\_{256}(3)\approx1.98\\$ Bytes

```
(,,(),,())

```

# Answer
> 1 votes
## PHP, 9 chars

```
for(;;)a;

```

Assumes `error_reporting` includes notices, and you can run it like this:

```
php -r "for(;;)a;"

```

The output is the following (repeated until the script is stopped):

```
PHP Stack trace:
PHP   1. {main}() Command line code:0
PHP Notice:  Use of undefined constant a - assumed 'a' in Command line code on line 1

```

**Note:** 11 characters if code is written in a file: `<?for(;;)a;`

# Answer
> 1 votes
# C#, 60

```
class A{static void Main(){for(;;System.Console.Write(1));}}

```

# Answer
> 1 votes
## Golf-Basic 84, 2 characters

```
p`

```

Causes upper-right line of 5 pixels to alternate continuously.

# Answer
> 1 votes
## Assembly X86 - 44

Ok Im not a geek with assembly x86 but I wanted just to add this as a possible solution. COnsidering the number of dependencies needed by assembly code this code should be the shortest, a simple infinite loop that prints "x":

```
loop:
  movl $120, %rdi
  call putchar
  jmp loop

```

# Answer
> 1 votes
# awk, 15/19 chars

Canonical version, 19 characters:

```
BEGIN{for(;;)print}

```

Version requiring user input (one newline will do), 14 chars (scores as 15 because of the required input):

```
{for(;;)print}

```

# Answer
> 1 votes
# ~-~! \- 17 bytes, with cheating 14 bytes

```
'=|@*:'&*|:'&|.|:

```

~-~! has a very limited set of characters, and does not support explicit numbers, so yeah. Outputs infinite `.`s.

If I sway the rules a bit and have the user input the character to be output infinitely, I can have 15 bytes:

```
'=|@*:'&*|:'&^:

```

Depending on the implementation, the last `:` for both of these can be left out, lowering the byte counts to 16 and 14.

# Answer
> 1 votes
## J 11

```
echo@-^:_]1

```

Outputs 0's because inversion (`-`) does not converge when repeated ad infinitum (`^:_`).

# Answer
> 1 votes
A couple of attempts for AVR, starting with one of the older MEGA/TINY models:

```
inc r1
out DIRC, r0
out DIRC, r1
rjmp .-2

```

And for XMEGA:

```
inc r0
sts PORTC_DIR, r0
rjmp .-2

```

Both of these rely on registers being cleared at reset. The output is toggling the direction of PORTC pin 0 (input/output). You need to connect a pull-up resistor to this pin to create a square wave.

# Answer
> 1 votes
# Coffeescript 15

```
 alert 0 while 1

```

# Answer
> 1 votes
# Bash - 13

```
cat /dev/zero

```

OK, not the shortest, but I'm surprised this isn't here already.

# Answer
> 1 votes
# Bash - 7 Characters

```
echo
$0

```

Prints endless newlines, at least until your computer crashes.

# Answer
> 1 votes
## k4/q (11)

```
{x}{x""}/-1

```

The second function, `{x""}`, sends the empty string to `x`. If `x` is an integer, it's interpreted as a file descriptor. If `x` is `1` or `2`, this means to print to `stdout` or `stderr`. If `x` is `-1` or `-2`, this means to additionally print a newline. The result of sending a string to a file descriptor is that file descriptor.

The first function `{x}` is an idempotent function. (k has an actual idempotent function, `::`, but in this context, it would have to be written `(::)`, so this is shorter.)

The construct `g f/x`, where g and f are functions, is a variation on functional "fold": `f x` is called, then `g f x` is tested as a boolean; if it is false, execution stops; if not, `f` is called on the result of the prior call. (The return value is the result of the last call to `f`.) Every integer but `0` is truthy, so the `-1` returned by `{x""} -1` allows the execution to continue.

As a bonus, and at no extra character cost, if you swap the `/` for a `\`, you'll waste infinite amounts of RAM too: `g f\x` does the same thing, but it saves *all* the intermediate results as it runs--its return value is the full list of intermediate returns of `f`.

Just for fun, here's another alternate version. It's the same length, but only valid in k (not q):

```
`{x}{x@$x}/1`

```

This one prints "1"s forever, through more or less the same method, but a couple details are slightly different.

# Answer
> 1 votes
## Simplefunge, 3 chars

Does it count if, you know, it is your own language?

```
>o<

```

Prints 0 over and over again, as the tape is initialized as a tape of infinite zeros.

# Answer
> 1 votes
# CJam, 6 bytes

```
1{1p}h

```

or

```
{1p1}g

```

which prints an infinite number of `1\n` without risk of stack overflow (as there's no recursion).

I think CJam might be younger than the question, but this answer isn't a winner, so I don't see any harm.

# Answer
> 1 votes
# LOOP, 1

```
.

```

Outputs 000000000...

# Answer
> 1 votes
# This Programming Language, 2

In the spirit of the Befunge answer,

```
i'

```

Outputs 105 indefinitely.

# Answer
> 1 votes
# **Turing Machine Code (9)**

(This is the dialect of turing machine code used by many online turing machine simulators)

```
0 * 1 r *

```

It will endlessly ouput ones while moving rightward along the tape.

# Answer
> 1 votes
# Forth, 24 bytes

Defines then calls a word that loops forever, pushing and printing `<0>` each iteration.

```
: f begin .s 0 until ; f

```

**Try it online**

---

With a `do-loop` (25 bytes):

```
: f 0 0 do 0 .s +loop ; f

```

Prints `<1> 0`  forever.

# Answer
> 1 votes
# Mathematica, ~~34~~ 33 bytes

```
$IterationLimit=∞;#0@Print@1&[]

```

If there were no limitation on the maximum length of evaluation chain in Mathematica, `#0@Print@1&[]` is only 13 bytes, 4 bytes shorter than `For[,0<1,Print@1]`.

# Answer
> 1 votes
**Qt 5.4 QMake pro file, 42 chars**

```
defineReplace(A){log(A)return($$A())}$$A()

```

Is an infinite loop, but sadly gets caught out by qmake interpreter before it can get very far.

```
AAAA[...]Ran into infinite recursion (depth > 100).

```

Not sure if that counts under disqualification.

# Answer
> 1 votes
## Self-modifying Brainfuck, 4 bytes

Prints `]` forever. Note that the traditional BF programs work as well.

```
<[.]

```

The pointer starts one to the right of the source code on the tape, so moving left once puts the pointer at `]`.

# Answer
> 1 votes
# PlatyPar, 3 Bytes

```
1WA

```

Explanation:

```
1    ## push 1 to the stack
 W   ## while(stack[-1])
  A  ## alert(stack[-1])

```

Works the same as my truth machine, except manually inputting the 1 instead of asking for it.

Try it online!

# Answer
> 1 votes
# Detour, 1 bytes

```
,

```

Try it online!

`,` outputs its contents, and passes it on to the next cell (`,`). In the event of not being given input, a `0` will be passed in.

# Answer
> 1 votes
## BASTARD 30 Bytes

```
{(., <> {fi out {t 0}(.)})(.)}

```

This makes use of a few things that are still in question with the spec, but I'm the authour, so what the hell.

*Note:* BASTARD is still under development, and I haven't finished the spec, or even a rough REPL, so it probably should be disqualified for everything.

### Explanation:

1. Everything has to sit in a `{}` block.
2. We define a function called `.` that takes no arguments.
3. The function prints an undefined variable from the stack, which equates to `'nil'`.
4. The function also calls itself, thus an infinite loop.
5. We call the infinite function.

*Note:* Anonymous functions may or may not be introduced in the future. The current syntax proposed would reduce the above to 24 bytes:

```
{(<> {fi out {t 0}(@)})}

```

The only new concept here is `@`, which is a self-reference to the anonymous function.

# Answer
> 1 votes
# Quetzalcoatl, 14 chars

```
while 1: ::' '

```

This is for an older version of Quetzalcoatl.

# Answer
> 1 votes
# Fuzzy Octo Guacamole, 3 bytes

```
(1)

```

Infinitely outputs 1.

Due to weird implicit output and recursive loops (it executes the code inside the loop using recursion), 1 is outputted by the implicit output.

# Answer
> 1 votes
# Reng v.1.2, 1 byte

Try it here!

```
n

```

Pops `N` and prints `N`. `N` is always zero, popping off the empty stack.

# Answer
> 1 votes
## Sonic Pi, 19 Bytes

```
loop do puts "" end

```

Sonic Pi is a sound language, but it's also fully a programming language.

# Answer
> 1 votes
# Scratch, 3 bytes

(scoring used)
Adds a blank item to list **=** repeatedly and indefinitely.

# Answer
> 1 votes
## Burlesque - 2 Bytes

```
bc

```

basically just creates an infinite list and outputting infinite lists will obviously produce infinite output.

Don't try this in the online shell because some browsers freeze when trying to render the result because it's huge :) (at some point either the browser stops rendering or the webserver closes the stream).

# Answer
> 1 votes
## Hexagony, 1 byte

*This answer is non-competing, as Hexagony is newer than this challenge.*

```
!

```

Try it online!

Prints an infinite amount of `0`s by printing the value of the initial memory edge (which happens to be `0`) over and over. The `!` is executed in a loop because the source code is toroidal.

# Answer
> 1 votes
# Woefully, 49 bytes (newer than challenge)

```
||| |
|| |
| |
|| |
||| |
|||| |
||||| |
|||||| |

```

Explanation

```
v     v represents char pointer, instruction pointer finds first space after the char
|||A|                                                      pointed at by char pointer
||A|  A- Push zero
|A|
||B|
|||B| B- Pop and print (number)
||||B|
|||||B|
||||||B|
    [end] End- go back to character char pointer is pointing at. Char pointer has not moved
so it will just execute the same again

```

# Answer
> 1 votes
# zsh (8 chars)

```
</dev/z*

```

Analogous to `cat /dev/zero`.

Note: This does depend on there not being any other files in `/dev` starting with `z`, other than `/dev/zero`.

# Answer
> 1 votes
TI-83 Hex Assembly, 6 bytes

```
PROGRAM:I
:AsmPrgm
:EF0A45
:C3959D

```

Run with `Asm(prgmI)`. Prints garbage over and over again. The only way to stop the printing is to physically remove the batteries from the calculator and re-insert them, at which point the calculator's RAM will be cleared. I count each hex digit pair as one byte.

# Answer
> 1 votes
# Casio FX-7000G, 6 bytes

```
Lbl 0◢
Goto 0

```

This uses the calculator's own encoding, where each token is stored as a byte.

`Lbl 0` sets the label of the first line to `0`. The triangle means "print last value", which is in this case `0`. The next line is your standard `Goto` statement, jumping back to the top so the value can be printed again.

Due to the calculator's limitations, the user must press `EXE` after each printed value before the next can be displayed.

# Answer
> 1 votes
# Labyrinth, 1 byte

```
!

```

Labyrinth's stack has implicit zeroes at the bottom and the `!` character outputs the integer representation of top of the stack. Since the program never finds anywhere else to go besides this single character, it keeps repeating that instruction.

# Answer
> 1 votes
# 8th, ~~24~~ 19 bytes

```
: f 0 . recurse ; f

```

The word `f` pushes a `0` on the stack and print it in a recursive way

# Answer
> 1 votes
# GO, 13 bytes

`for{print(0)}`

Try it online!

# Answer
> 1 votes
# Pushy, 3 bytes

```
3[_

```

Explanation:

```
3 \ pushes 3 to the stack

[ \ starts an infinite loop

_ \ prints out the contents of the stack

```

# Answer
> 1 votes
# Commodore Basic, 5 bytes

```
1?:R╭

```

PETSCII substitution:  = `SHIFT+U`

Prints a newline, then runs itself. Forever.

# Answer
> 1 votes
# SmileBASIC, 6 bytes

```
?EXEC.

```

`?` is print, `EXEC` runs a program, and `.` is the same as `0.0`.

If newlines don't count as output, here's a 7 byte answer:

```
?.EXEC.

```

`?.` = `PRINT 0.0`, `EXEC.` = `EXEC 0.0`

# Answer
> 1 votes
# √ å ı ¥ ® Ï Ø ¿ , 3 bytes

```
(o)

```

Will output:

```
===== OUTPUT =====

0 0 0 0 0 etc.

==================

```

followed by execution information.

TIO Compiler. Enter the code as the first input and `None` as the second.

# Answer
> 1 votes
## Alice, 1 byte

```
o

```

Prints null bytes indefinitely.

# Answer
> 1 votes
# Braingolf, 6 bytes

```
[1+!_]

```

Try it online!

# Answer
> 1 votes
## Check, 3 bytes (non-competing)

```
#<#

```

Outputs infinite newlines.

Check is my new esolang. It uses a combination of 2D and 1D semantics.

### Explanation

This uses a bit of a hack in the language - namely, that `<` means "print a newline" in 1D mode, and "move left" in 2D mode.

The IP first runs into a `#`, which turns it into 2D mode. However, it runs into `<`, which immediately points it back. It runs into the first `#` again and switches back to 1D mode. The IP then hits `<`, which outputs a newline, and then hits the second `#`, which switches it back to 2D mode again. The IP wraps around to the first `#`, where it switches back to 1D mode. It hits `<` again, printing another newline, and the process repeats.

# Answer
> 1 votes
# Decimal, 12 bytes

```
11D91D30191D

```

Try it online!

Explanation:

```
11D   ; push whatever's in RAM to the stack as an INT
91D   ; declare jump 1
301   ; print
91D   ; goto jump 1

```

Another version that does not invoke undefined behavior:

```
82D   ; builtin - push random INT to stack
91D   ; declare jump 1
301   ; print
91D   ; goto jump 1

```

# Answer
> 1 votes
# Unreadable, 16 bytes

```
'"""""'"""'"'"""

```

Try it online!

# Answer
> 1 votes
# MOO, ~~39~~ 38 bytes

```
while(!suspend(player:tell()))endwhile

```

Huge abuse of side effects; `player:tell()` by default does not return a value, which means it implicitly returns zero, and the resulting `suspend(0)` is necessary to avoid running out of ticks.

# Answer
> 1 votes
# Cubically, 3 bytes

```
%0)

```

This should look like this:

```
(%0)
(    open loop that can always be jumped to
 %0   print 0th face sum as integer (0)
   ) jump back to loop regardless of faces

```

However, `)` will just jump back to the start of the file if no jump point is provided.

# Answer
> 1 votes
# Dreaderef, ~~9~~ ~~8~~ 7 bytes

```
5?1 1-1

```

Try it online!

## Explanation:

In a more readable form (which can still be fed into the preprocessor), this program is:

```
numo 0
deref 1 -1

```

The `numo` (numeric output) statement does just about what you'd expect: it outputs `0`. I could have used `chro`, but that makes it output unprintables and doesn't affect the byte count.

To understand the second line, you have to know a little bit about Dreaderef:

* Programs are loaded into the data space at the beginning of execution.
* The pointer to the current instruction is located at position `-1`.

What `deref 1 -1` does is:

* Dereferences 1 (takes the value of the cell at index 1). This always returns 0.
* Stores the result in cell -1, which is effectively a GOTO to instruction 0.

Dreaderef doesn't have a "load constant" instruction, so the best way to load a constant into a cell is to use some sort of arithmetic instruction or copy it from some other cell with `deref`, which is what I do here.

# Answer
> 1 votes
# JavaScript, 20 bytes

```
for(;;)console.log()

```

Sends infinite undefined output.

# Answer
> 1 votes
# VBScript, 23 characters

```
Do:Wscript.Echo"C":Loop

```

Needs to be run with `cscript.exe` for command-line output. If run with `wscript.exe` (default action), it opens infinite dialog boxes.

---

Also, here's a shorter (17 character) version which opens boxes regardless of whether it's running using `cscript.exe` or `wscript.exe`.

```
Do:MsgBox"C":Loop

```

However I'm not sure if that counts too, as it doesn't print anything and just opens dialog boxes indefinetely.

# Answer
> 1 votes
# PHP, 16 bytes 8 bytes

My first attempt and this Code Golf :)

```
while(a)

```

I'm sure I could make it better without that echo? hmm...

# Answer
> 1 votes
# GW-Basic, 9 bytes (tokenised)

```
TRON:RUN

```

This will output `[0]` until the cows come home. Actually only 3 bytes are actual tokens; here's the full content of the file:

```
255      unprotected
xxx xxx  offset, recalculated on LOAD
0 0      line number 0
162      TRON
':'      :
138      RUN
0        line terminator

```

You can often delete trailing zeroes, but this one was required because when GW-Basic starts up, another value is at the memory location where that zero will get loaded, so without it you'd get a syntax error.

# Answer
> 1 votes
# Pyth - 2 bytes

```
#0

```

Exlanation:

```
#0
#  Loop forever
 0 Print 0

```

# Answer
> 1 votes
# Flipbit, 4 bytes

```
^[.]

```

Try it online!

Yay for Bra\*nfuck derivatives!

# Answer
> 1 votes
# PHP, 14 bytes

```
for(;;)echo 0;

```

try it online

# Answer
> 1 votes
# TIS `-n` `1` `1`, 12 bytes

```
@0
MOV 0 ANY

```

Try it online!

Just shoves a bunch of `0\n` to the output. On TIO, reached the 128KiB cutoff quite quickly. Without the `-n` flag, prints null bytes instead.

If you are familiar with TIS-100, you will be used to a 3x4 array of computational nodes, however, this solutions only uses one such node, nominally giving the zeroes downward as output.

The only instruction that send data out of a computational node is `MOV`, and that requires a source and a destination. the smallest possible source is a single digit number, and the smallest possible destination is `UP`. However, to produce actual output, the data needs to travel downwards, restricting the choice to either `DOWN` or `ANY`.

# Answer
> 1 votes
# Gol\>\<\>, 1 byte

```
D

```

Try it online!

`D` is a command designed for debugging, which prints the entire stack (from bottom to top) between brackets. `D` on empty stack generates `[]\n` to stdout, and the IP loops through the row endlessly.

# Alternative solution, 1 byte

*Credits to Jo King*

```
N

```

Try it online!

Unlike `><>`, `Gol><>` has infinite zeroes at the bottom of the stack, which allows to print the top without pushing anything. Any of `Nno` will do; `N` prints `0\n`, `n` prints `0`, and `o` prints null bytes.

Alternatively, there are many 2-byte solutions:

* One of `0-9a-f`, `l`, or `m` followed by one of `NnoD`; Try it online!
    + Any of `0-9a-f` pushes a hexadecimal digit to the stack, `l` pushes the current stack size, and `m` pushes `-1`.
    + `N` prints the top as number with newline, `n` is the same without newline, and `o` prints as a char.
* `S"`; Try it online!
    + Initially `S"` is interpreted as one command which prints the encountered chars up to ending `"`. The next loop of `S"` is interpreted as a literal `S` and then closing `"`, which prints a single `S` to stdout.
* `"` followed by any of `NnoD`; Try it online!
    + Use `"` as both opening and closing quote, then print the char.

# Answer
> 1 votes
# Ahead, 1 byte

```
O

```

Prints 0 forever. `O` pops the stack and prints that value as a number written out (as opposed to a Unicode character). Like Befunge, the empty stack pops 0, so this will print 0.

Since this is a 1x1 board, the head has nowhere to go and will stay on this cell forever, outputting forever.

# Answer
> 1 votes
## Prolog (14 bytes)

```
a:-write(0),a.

```

Simple tail recursive predicate in swi-prolog. Called like so `a.`

# Answer
> 1 votes
# Flobnar, 4 bytes

```
0,_@

```

Try it online!

Outputs `0x00` bytes indefinitely.

This works because `_` is said to get the conditional from the cell on the *other* side of it, and then use its value to choose between the east and west cells. It is expected to be evaluated from a vertical direction, but it doesn't *have* to be.

`@` indicates the starting point for the program and evaluates to the return value of the cell to its west (`_`). `_` evaluates what's on the other side (`0,`) to print `0`. `,` always has a return value of 0, however, and this causes the horizontal if to choose the branch to its east. This is `@`, which evaluates the cell to its west, continuing the cycle.

Flobnar doesn't have decimal output by default, but the linked implementation has a `-d` flag which enables `.` for decimal output. This allows a slightly prettier version that outputs printable characters instead.

```
0._@

```

Try it online!

# Answer
> 1 votes
# Taxi, ~~377~~ 369 bytes

*-8 bytes by getting rid of the quotes.*

```
Go to Post Office:w 1 l 1 r 1 l.
[B]
! is waiting at Writer's Depot.
! is waiting at Writer's Depot.
! is waiting at Writer's Depot.
Go to Zoom Zoom:s 1 l 1 l 4 l 2 r.
Go to Writer's Depot:w.
Pickup a passenger going to Post Office.
Pickup a passenger going to Post Office.
Pickup a passenger going to Post Office.
Go to Post Office:n 3 r 2 r 3 r 1 l.
Switch to plan B.

```

The repetition of the passengers is needed for the driver to get enough fare to get enough gas to continue forever.

Try it online!

# Answer
> 1 votes
# Aheui (esotope), 6 bytes

```
박망

```

Try it online!

---

or simillar codes with same length like following;

```
반망
받망
...
박맣
...

```

will produce infinite output.

# Answer
> 1 votes
# Perl 6, 8 bytes

Thanks to nwellnhof for this solution.

```
.say xx*

```

Try it online!

Prints `(Any)` infinitely.

# Perl 6, 10 bytes

```
1...!*.say

```

Try it online!

Defines a list that increments until the result of printing the current number is false (which never happens).

# Answer
> 1 votes
# bitch, 3 bytes

```
>/<
```

Try it online!

---

**Explanation**

```
>      Begin loop
 /     Print accumulator value (intialised to 0)
  <    Loop back to beginning of loop
```

# Answer
> 1 votes
# Clean, 7 bytes

```
f=[0:f]

```

Try it online!

Gives `[0,0,0,0,...`

# Answer
> 1 votes
# Muriel, 39 bytes

```
A:"\";.A;@\"A:\\\"\"+|A+A";@"A:\""+|A+A

```

Try it online!

This is near identical to the Muriel quine, except I've changed the print command in the last instruction to an eval command, and the addition of `.A;` in order to print something (in this case, the shortest thing was a part of the source code (`"+|A+A";@"A:\""+|A+A`) itself).

# Answer
> 1 votes
# Gol\>\<\>, 1 byte

```
n

```

There we go, I feel like this cheats a little bit, but it works! Now to golf this more... ;)

Try it online!

# Answer
> 1 votes
# 05AB1E, 2 bytes

Version 1 (3 bytes)

```
[A,

```

prints out the alphabet

Version 1 (2 bytes)

```
[,

```

Outputs infinite newlines

Try it online!

# Answer
> 1 votes
# Voovoos, 3 bytes

```
x.<

```

Pretty much just endlessly bounces between the `.` and `<`
`.` pops the top of the stack and prints it, but if you pop an empty stack in voovoos you get `0`, so it just endlessly prints `0`.

# Answer
> 1 votes
# YABALL, 3 bytes

```
!.?

```

Try it online!

**Explanation**

```
!                  Go off of "reverse mode" (a mode where the IP goes left instead of right) if in reverse mode, otherwise no-op
.                  Print current cell, which is NUL
?                  Go in "reverse mode"

```

Basically an infinite loop printing NULs.

The commands are executed like so: `!.?.!.?.!.? ...`

# Answer
> 1 votes
# Turing Machine But Way Worse, ~~27~~ 13 bytes

```
0 0 0 1 0 1 0

```

Try it online!

Outputs infinite `NUL` characters.

# Answer
> 1 votes
## MINOL, 5 bytes

```
GOTO0

```

Any expression in MINOL that isn't entered as part of a program (that is, isn't assigned a line number by the user) is considered line 0. While seemingly not a part of the official spec (which, as far as I can tell, is a series of letters sent to and subsequently reformatted and published by 'Dr. Dobb's Journal of Computer Calisthenics and Orthodontia' in 1976), lines executed this way always seem to spit out a newline. This obviously wouldn't be the case in a full program, which would take 11 bytes (inc. the trailing CR):

```
1 PR:GOTO1

```

# Answer
> 1 votes
# Triangular, 4 bytes

```
,%0/

```

Prints 0 repeatedly.

Try it online!

**Ungolfed:**

```
  ,
 % 0
/

```

# Answer
> 1 votes
# Underload, 8 bytes

```
(:S:^):^

```

Endlessly outputs `:S:^`

Try it Online!

# Answer
> 1 votes
# Pyth, ~~3~~ 2 bytes

```
#d

```

Try it online!

Prints the string " " (single space) until a print instruction produces an error (which, I mean, I *guess* could happen).

# Answer
> 1 votes
# 33, 5 bytes

```
1a[o]

```

## Explanation:

```
1a    (Set the accumulator to 1, to allow the loop to continue to run)
  [o] (Print the accumulator, 1, forever)

```

# Answer
> 1 votes
# TSQL, 16 17 bytes

```
l:PRINT'1'GOTO l

```

WHILE 1=1PRINT'1'

# Answer
> 1 votes
# MarioLANG, 7 bytes

```
>:<
===

```

Mario will walk back and forth, printing as he does.

Try it online!

# Answer
> 1 votes
# Intcode, 9 bytes

```
4,0,5,0,1

```

Outputs "4" an infinite number of times.

# Answer
> 1 votes
## Spice, 26 bytes

Spice module that recursively calls itself. Quite quickly hits a stack overflow.

Given the code is saved to a module named 'x':

```
;return@OUT a;LOD .\x a a;

```

## Un-golfed explanation

```
;a;return@    - define variables: "a" and the required "return"
OUT a;   - output a, implicitly "[0]"
LOD .\x a a;  - call this module, passing a, storing result in a

```

# Answer
> 1 votes
## Roj, 19 bytes

```
while(1)do out""end

```

This produces output because of the `[out]:` buffer.

# Answer
> 1 votes
# T-SQL, 15 bytes

```
a:PRINT 0GOTO a

```

6 years and 10 pages of answers, and no SQL versions yet.

Notes:

* `PRINT` is 1 byte less than a `SELECT`.
* A label with a goto is 1 byte shorter than the shortest `WHILE` statement: `WHILE 1=1PRINT 1` (you can't just do `WHILE 1` in SQL)
* Depending on the version of SQL Management Studio, the "messages" pane (which displays the result of `PRINT` statements), might not immediately refresh; this is a client-side UI issue only.

# Answer
> 1 votes
# Ruby, ~~11~~ 9 characters

```
loop{p:p}

```

Old answer:

```
p 0 while 1

```

# Answer
> 1 votes
# Go, 59 characters

```
package main
import "fmt"
func main(){for{fmt.Print(0)}}

```

# Answer
> 1 votes
# International Phonetic Esoteric Language, 6 bytes

```
10ɑeoɒ

```

Will print `0` with newlines forever.

Explanation:

```
10ɑeoɒ
10     (push the bounds for the loop: from 0 to 1)
  ɑ    (pop the bounds and start the loop)
   e   (push the current index)
    o  (print)
     ɒ (check if index < start. 0 < 1, so loop)

```

# Answer
> 1 votes
# Rockstar, 13 bytes

```
while 1 say 1

```

Try it here (Code will need to be pasted in)

# Answer
> 1 votes
## ARM Thumb, Linux syscalls only, 12 bytes

Raw machine code:

```
2704 2001 4669 2201 df00 e7f9

```

Assembly:

```
        .text
        .globl _start
        .thumb
        .thumb_func
_start:
        movs    r7, #4    @ write syscall
        movs    r0, #1    @ STDOUT_FILENO
        mov     r1, sp    @ sp is a valid pointer. May not be legible, but...
        movs    r2, #1    @ one byte is fine
        svc     #0        @ syscall: write(STDOUT_FILENO, sp, 1)
        b       _start    @ loop forever

```

## ARM Thumb, with libc, 6 bytes

Raw machine code (`f7ff fffe` is an unlinked libc call):

```
f7ff fffe e7fc

```

Assembly:

```
        .text
        .globl main
        .thumb
        .thumb_func
@ Note that putchar returns the char it put, so we do this:
@ for (;;) putchar(argc);
main:
        bl      putchar @ putchar(argc)
        b       main    @ Loop forever

```

Fun fact: These programs do the exact same thing, printing argc % 256 in binary infinitely, since `sp[0]` at `_start` is also `argc`.

# Answer
> 1 votes
# Befunge-93, 1 byte

```
'

```

Try it online!

```
'  # full program
'  # invalid command, NOP but raises warning

```

# Answer
> 1 votes
# Duocentehexaquinquagesimal, 2 bytes

Try it online!

# Answer
> 1 votes
# A0A0, 43 39 bytes

```
A0A0
A0C3G1G1A0
A0O0A0
A0A1G-3G-3A0
G-3

```

Prints 0 forever. This uses a classic infinite loop which was created by the inventor of the language. Considering the only important thing about this code is that it runs infinitely, I'll use this post as an explanation of this looping construct, since it's the basis for all loops.

Loops are generally not really difficult in programming languages, even those which only have goto instructions and not proper looping constructs. A0A0 has goto instructions, so what's the problem? A0A0 is a self-modifying language which deletes the instruciton after it executes it. So if we were to use a goto to form a loop, we would simply end up at nothing and the program halts. This is not what we want.

Thankfully, the language contains instructions to modify its own code. There are two instructions that do this. `A#` and `C#` where # is a placeholder for an integer. `A#` appends the current line of instructions (excluding itself) to the line # positions below. `C#` clears the line # positions below this line. Since all integers are allowed, negative numbers can be used to go to lines above and 0 can be used to stay on the same line.

Let's take a look at the basis of the loop.

```
A0 A0
A0 C3 G1 G1 A0
A0 instructions here A0
A0 A1 G-3 G-3 A0
G-3

```

The first thing we do when entering the loop is go past four `A0` instructions which append their own lines to themselves. Remember that it excludes itself, so this first `A0` is not copied. This would be an issue on subsequent iterations, which is why at the very end of the loop, there is also an `A0`. This means that this A0 at the end is copied, which preserves the ability to copy the loop infinite amount of times.

You'll notice that the last line does not have any kind of append instruction. This is necessary, because we must at some point go back up and we can't go up if we have an `A#`. But if we never place a `G-3` there again, we eventually will end up there and, again get stuck since there's no instruction there. This is what line 4 is for. It contains the following:

```
A1 G-3 G-3

```

It places two `G-3` in line lower - at line 5. This preserves the ability for us to keep jumping back up forever. However, this line contains an A0 at the end. And during exeuciton, it may contain many more instructions we don't want. If we execute anything that is not `G-3`, we go to line 6 and left the loop. This is where line 2 comes into play. It contains a `C3` instruction, which clears the line three lines lower. This is line 5. Because the instructions are aligned properly, this means that the line is cleared the moment we would hit an instruction that is not `G-3`. And since at the same point there will be another `A1 G-3 G-3` on line 4, this now empty line will get two `G-3` instructions again, just in time.

You may observe that, since there are also `G-3` instructions on line 4, we may sometimes jump up to line 1 instead of line 2. And this is where line 1 comes into play. It only contains `A0 A0`. This will repeat itself infinitely on that line and acts as an infinite no-op. After executing a single instruction, the program counter automatically moves to the next line and we're back on line 2 again.

And all of this code gives us freedom on line 3. We can put whatever instructions we want in there, as long as these instructions don't modify the loop. We can even have multiple lines in the middle, as long as you change the `G-3` to the appropriate amount.

Edit: Optimized by 4 bytes. It turns out that there is no minimum requirement of 3 instructions for the loop, allowing us to drop 2 instructions, totalling 4 bytes.

# Answer
> 1 votes
# Mascarpone, 6.875 bytes

```
['@.:!]v*:!

```

Try It Online!

### Explanation:

```
[     ]     // push a string that will define an operation
 '@.        // push the symbol '@ and output it (popping it in the process)
    :!      // duplicate the top of the stack and execute it
       v*   // push a function/operation that does the above
         :! // duplicate the operation, and execute it.

```

The operation duplicates and executes itself tail-recursively, generating the infinite output.

5 bits are sufficient for the characters used by this program, thus the total size is 55 bits, or 6.875 bytes

# Answer
> 1 votes
# INTERCAL, 26 bytes

```
DOCOMEFROM#1(1)DOREADOUT#0

```

Try it online!

This works for both C-INTERCAL and CLC-INTERCAL.

# Answer
> 1 votes
# RETURN, 62 bytes

```
(())(()()()()()()()()()()()()()()()()())((()()()()()()()()()))

```

Try it online!

## Explanation:

```
(()) Add 1
(()()()()()()()()()()()()()()()()()) While nonzero repeat what's in the next group of brackets
(
  (()()()()()()()()()) Put character
)

```

# Answer
> 1 votes
# KonamiCode, 15 bytes

`v(^)L(^)<<<B(^)`

Explanation:

```
v(^) [Writes 1 to memory address 1.]
L(^) [A loop marker]
<<<  [Output the current memory address as a number]
B(^) [A reverse-jump instruction, ending the loop.]

```

*Note:* We can't use 0 for the first instruction becuase the comparison buffer is set to 0 by default. This means that the reverse-jump's condition will be fulfilled and the loop will immediately exit. However, we could also replace this instruction with S(^) and have the program run the same way.

# Answer
> 1 votes
# APOL, 8 bytes

`w(T p(0))`

I'm not sure if this could reasonably be made smaller.

# Answer
> 1 votes
# Python 3, ~~18~~ 15 bytes

*Thanks to DLosc for -3 bytes!*

```
while 1:print()

```

# Answer
> 1 votes
# Headass, 2 bytes

```
PE

```

Try it here! copy and paste this: `srun("PE")`

Prints an infinite stream of 0s and newlines.

```
P   Print the value of the current register (initialized at 0) + a newline
 E  Go to code block determined by value at current register,
    Block 0 = return to start.

```

# Headascii, 2 bytes

```
!E

```

Try it here! copy and paste this: `erun("!E")`

Similar to the last one, but instead of printing 0s and newlines, it just prints newlines.

```
!   Print the value of the string register (initially empty) + a newline
 E  Go to code block determined by value at current register,
    Block 0 = return to start.

```

# Answer
> 1 votes
# Appleseed, 26 bytes

```
(def start!(q(_(print!(0to

```

Try it online!

### Explanation

```
(def start!                 ; Define the start! event handler as
           (q               ; A function
             (_             ; That takes any number of arguments
               (print!      ; And outputs
                      (0to  ; The infinite list of all nonnegative integers

```

# Answer
> 1 votes
# rusty\_deque, 17 bytes

```
1~{dup~ow~}~loop~

```

Forever print `1`s to the screen.

# Answer
> 1 votes
# BitCycle, 10 bytes

```
 !
 ~<
1A^

```

Outputs an infinite bit stream of alternating 1s and 0s, or, with the `-u` or `-U` flags, an infinite sequence of 1s.

Try it online! or with an online visualizer

# Answer
> 1 votes
# Common Lisp, 15 bytes

```
(loop(princ'x))

```

Try it online!

# Answer
> 1 votes
# Regenerate `-a`, 1 byte

```
*
```

Attempt This Online!

Prints newlines forever :P it's finding and printing every possible match for at least 0 nothings, delimited with newlines. Surprised this isn't a syntax error.

# Answer
> 1 votes
# BitCycle, 6 bytes

```
!~<
1^

```

Inspired by emanresu A's suggested golf to des54321's answer. Similarly to that answer, this outputs alternating 0s and 1s.

Try it here!

### Explanation

The initial `1` bit is directed north into the dupneg (`~`). A negated copy (`0`) is sent west to the sink (`!`) and is output. A non-negated copy is sent east, whereupon it is immediately directed west again back into the dupneg. Now the original copy is sent north and leaves the playfield, while the negated copy is sent south, redirected north again, and the cycle continues forever (with the bit changing parity each time).

# Answer
> 1 votes
# Pip, 4 bytes

```
W1P1

```

Prints the number `1` with a trailing newline over and over. Attempt This Online!

This is a simple loop; in pseudocode,

```
while 1:
  print 1

```

Almost any expression can be printed instead of `1`. For example, `W1Pr` prints random floats between 0 and 1 forever.

A more interesting option, also 4 bytes:

```
P*,u

```

This constructs an infinite range starting at 0 (`,u`) and then prints each element of it (`P*`). The result is an infinite loop that outputs the natural numbers one at a time. Attempt This Online!

# Answer
> 1 votes
# Trilangle, unbounded memory, 3 bytes

```
'1!

```

Push a 1 to the stack, print it, repeat.

## Trilangle, 4 bytes

```
'1,!

```

Push a 1 to the stack, print it, pop it off, repeat.

## Trilangle `-w`, 1 + 2 = 3 bytes

```
,

```

When run with the `-w` flag or in the online interpreter, popping from an empty stack prints a warning.

# Answer
> 1 votes
# !@#$%^&\*()\_+, 4 bytes

```
^(?)

```

Try it online!

# Answer
> 1 votes
# Zsh, 3 bytes

```
yes

```

Try it online!

# Answer
> 0 votes
# JAVA - 72 chars:

counting everything:

```
class T{public static void main(String[]a){for(;;)System.out.print(0);}}

```

Obviously, Java was not built for code golfing.

# Answer
> 0 votes
## Quomplex, ~~6~~ 4

```
[*1]

```

Infinitely outputs `1`.

# Answer
> 0 votes
# q/KDB, 13 chars

```
while[1;0N!1]

```

Outputs

```
1

```

forever.

For more information on q/KDB :

Another Solution:

```
{0N!1}/[0<;1]

```

# Answer
> 0 votes
## Chinese, 2 bytes

Prints `ÿ` continuously.

# Answer
> 0 votes
## C, 25 bytes

```
main(){while(puts("1"));}

```

# Answer
> 0 votes
# Golfscript - 7

```
{1a}:a~

```

I'm still learing golfscript, but unless I'm mistaken, this puts 1 on the stack, then starts over?

But apparently, the stack only prints when the program terminates, so perhaps this is better:

```
{1.p}do

```

(thanks Dennis)

# Answer
> 0 votes
# Bash - 13 bytes

```
cat /dev/zero

```

to see run `cat -v /dev/zero`

Documentation here: /dev/zero and here Purpose of /dev/zero?

# Answer
> 0 votes
**Windows PowerShell (12)**

```
for(;;){'-'}

```

# Answer
> 0 votes
# Clojure

```
(repeat 1)

```

Returns a lazy seq of 1's '(1 1 1 1 1 1 1 1 1 1 ...)

# Answer
> 0 votes
## Scala REPL (19 characters)

```
while(true)print(1)

```

# Answer
> 0 votes
# PureBasic - 17 chars

```
r:
Debug 0
Goto r

```

A slight variation on the classic BASIC infinite loop :-)

# Answer
> 0 votes
## JavaScript, 23 characters

```
while(1)console.log(1);

```

# Answer
> 0 votes
## Processing, 26

```
for(int i=0;i<1;)print(1);

```

Prints `1` continuously.

# Answer
> 0 votes
## Groovy, 14

```
for(;;)print 1

```

from the command line: groovy -e "for(;;)print 1"

# Answer
> 0 votes
## Java, 74 characters

Since Java 7 and later versions seeks for main function at first instead of static block; I think this would be the best option to print infinite loops with small code. For your reference: static block won't execute in Java 7.

```
class I{public static void main(String[]a){for(;;)System.out.println(1);}}

```

# Answer
> 0 votes
**PHP: 22 chars**

```
<?PHP while(true){print(0);} ?>

```

*My first golf, hope I did it right :)*
It will hang your browser if you do it on a PHP page, but from the command line it does the expected: prints something until you get bored and stop it.

# Answer
> 0 votes
## C++ 29

```
main(){while(1)std::cout<<1;}

```

# Answer
> 0 votes
**SCALA 18**

```
while(1>0)print(1)

```

# Answer
> 0 votes
**AppleScript:**

```
repeat until 1 < 0
    say "hi"
end repeat

```

# Answer
> 0 votes
## Groovy - 15 chars

```
for(;;)print 1

```

# Answer
> 0 votes
## Clojure - 18 15 chars

```
(while 1(pr 1))

```

# Answer
> 0 votes
## CoffeeScript, 14

Pretty unoriginal and similar to JavaScript:

```
alert 6while 1

```

# Answer
> 0 votes
# GoLunar, 4 bytes

This is the equivalent of 5543 zeros in a row in Unary, which is equivalent to `+[.]` in BrainF\***.

```
5543

```

# Answer
> 0 votes
I haven't seen **Thue** used here much, so here we go:

# Thue (~~22~~ 19 bytes)

```
a::=ab
b::=~1
::=
a

```

# Answer
> 0 votes
# Cardinal, 3 characters

```
.%$

```

Explanation:

```
.    print active value
 %   start pointers here
  $  jump to x,y = active, inactive value

.%$

Pointers spread out in all cardinal directions from every %
All pointers carry two values, initialized to 0. The upper value is
called the active value, and it can be accessed directly. The lower
value is called inactive value. Inactive values can only be accessed
by flipping both values, switching the active to inactive, and the
inactive to active, or by using instructions like $ that grab the
inactive value directly to e.g. execute a jump.
The < and > below the values are the positional and directional
markers of the pointers. In programs, they instruct pointers to change
the movement direction.

0 0     At this step, the first active value (from the left pointer)
0 0     gets printed in the console, the right pointer is going to
<%>     jump to x,y=0,0

0      The jumped (former left) pointer prints out the next 0
0
>%$

 0
 0     ... travels on ...
.>$

  0
  0
.%>    ... reaches the jump instruction again, going to jump to 0,0 again

0
0
>%$    ... print out the next 0... and so on, to infinity.

```

http://esolangs.org/wiki/Cardinal

# Answer
> 0 votes
# Bat, 2 chars

```
%0

```

The output is (starting from a blank line, I've added nbsp to make it visible bellow)

```

d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"

d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"

d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"

d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"

d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"

d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"

```

# Answer
> 0 votes
# \>\<\> Fish - 2 characters, I'm counting the shortest one.

Thijs beat me to it, but oh well. Here are a couple more \>\<\> answers.

`1n`
-Infinite 1's, 2 bytes

```
   >"drlow ,olleH"l
                  ?
                  !
   ^              <
                  o

```

-Infinite "Hello, world", 84 bytes.

Edit: Whoops. It's character count, not bytecount. I also fixed the first answer. Edit 2: Thanks mbomb007 for shaving off 1 character.

# Answer
> 0 votes
# BotEngine, 1x3=3

Noncompeting as BotEngine is much too recent a language. Anyway, here we go:

```
>CT

```

It starts with a right-moving bot on the `>`. When it reaches the `C`, it creates a left-moving bot (which starts on the `C`.) On the next step, the left-moving bot reaches the `>` and is turned around to move right and the right-moving bot reaches the `T`, destroying itself and printing `TRUE`. The step after that, the other bot gets to the `C` starting the process over again.

`>CF` also works but prints `FALSE` instead of `TRUE`. Using `P` in this case would print empty lines instead.

# Answer
> 0 votes
# Javascript ES6, 28 bytes

```
setInterval`console.log()`

```

I didn't want to code an infinite `for` loop like everyone else...

Try it here using anything BUT Firefox.

# Answer
> 0 votes
# Mouse-2002, 3 bytes

```
(0!)

```

prints `0` forever.

---

Alternatively, for a more interesting and (theoretically) infinite error with no loop, **the Ackermann Function in 99 bytes** in this language:

```
"M>"?a:"N>"?b:#Y,a.b.;$Y1%n:2%m:m.0=k:n.0=j:j.k.>[n.1+!|j.k.<[#Y,m.1-,1;!|#Y,m.1-,#Y,n.,n.1-;;!]]]@

```

Expanded:

```
"M>" ? a:
"N>" ? b:

1 a:
1 b:

#Y, a. b.;!

$Y 1% n: 2% m: ~ ack
  m. 0 = k: ~ store whether m == 0 in k
  n. 0 = j:
  j. k. > [ ~ if y>x
    n.1+ ~ print it
  | j. k. < [ ~ if x>y
    #Y, m. 1-, 1;
  | #Y, m. 1-, #Y, m.,n. 1-;;!
    ]
   ]
  ]
@
$

```

Errors recursively, forever, as long as the input was a positive nonzero integer. (result of a bug in the interpreter: the code is correct!)

# Answer
> 0 votes
# , 4 chars / 7 bytes

```
↻ô1;

```

`Try it here (Firefox only).`

Translates to `while(output(1));` in JS.

# Answer
> 0 votes
## R, 15 bytes

Infinitely prints 1

```
while(T)cat(1)

```

# Answer
> 0 votes
# Pyth, 4 bytes

Pyth is a new programming lenguage, so this answer doesn't count.

```
.V"0

Explanation:
.V   - Forever loop
  "0 - Outputs zeros

```

# Answer
> 0 votes
# ForceLang, 23 bytes

```
label l
io.write goto l

```

Looks weird, but it works. The key here is that `goto` does not interrupt the evaluation of the current line, and returns `nil`.

# Answer
> 0 votes
# Pylons, 5

```
wp,1}

```

While 1, print the (empty) stack.

# Answer
> 0 votes
# Come Here, 21 bytes

```
COME FROM1 1TELL1NEXT

```

In the reference implementation, this prints infinitely many smiley characters. Don't ask me why.

# Answer
> 0 votes
## Clojure, 14 bytes

```
(pr(cycle[1]))

```

# Answer
> 0 votes
## Brainfuck, 26 bytes

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

```

Do 4\*4\*2+1 (33, !) and the final loop is a infinite loop that only print the current memory cell (!).

# Answer
> 0 votes
# Haystack, 6 bytes (non-competing, the language came 2 years after the challenge)

```
>"a"o<

```

This will print `a` \[infinity\] times.

If the above code gives a syntax error because of the lack of `|` (that character is the needle. The ultimate goal of all Haystack programs is to find the needle in the haystack), one can simply append it to the end:

```
>"a"o<|

```

# Answer
> 0 votes
# Kitanai, 24 bytes

```
#print"0"&2&1#print"1"&~

```

The "#" defines a flag, the first "print" displays 0, then the "&2" jumps to the second "#", it then prints "1", goes to the origin ("&~") which is just after "&2", then it jumps to the first "#" thanks to the "&1". And it does all that infinitely :)

# Answer
> 0 votes
# FALSE, 8 bytes

Interpreter.

There are many programs that work, each 8 bytes. The one I find the most interesting is:

```
[1$][.]#

```

This is a while loop (`#`). `[1$]` is the condition, and it pushes two `1`s. The last is popped for the condition (true), and then `[.]` is executed, which prints the number.

Here are some other programs (including the above):

```
[1$][.]#
[1][1.]#
[1$.][]#
[^^.][]#
[^.^][]#
[^][^.]#

```

A more interesting 9-byte (arbitrary 1-char repeated):

```
['c$,][]#

```

I feel that the following 7-byte programs should work on some FALSE interpreters, but I haven't found any such yet:

```
[1"][]#
[.1][]#

```

# Answer
> 0 votes
# QBIC, ~~3~~ 2 bytes

```
{?

```

## Explanation:

```
{   Start a DO-loop
 ?  PRINT nothing, followed by \n
    The DO-loop is implicitly closed by QBIC.

```

# Answer
> 0 votes
# Haxe, 19 bytes

```
while(1>0)trace(1);

```

There are several things about Haxe that make this challenge more difficult than in similar languages:

1. Its lack of a `for(;;)` loop
2. Its unwillingness to consider anything other than `true` or `false` truthy or falsy
3. Its unwillingness to print an empty line (with `trace();`)

If not for these things, this program might have been 15 bytes:

```
for(;;)trace();

```

Test it online here, though you may not want to, as it freezes your browser.

# Answer
> 0 votes
# C++, 23 bytes

```
main(){for(;;)puts(";");}

```

I was too lazy, but hey, It outputs a javascript script, which does absolutely nothing!

# Answer
> 0 votes
# QC 6 bytes

Not competing because language is newer than the question

`A00$00`

```
A00 prints nothing(because memory is empty) and a new line
$00 jump to start(no recursion, sets instruction pointer to 00)

```

# Answer
> 0 votes
# Commodore 64/VIC-20 assembly, 8 bytes (assembled)

```
033C LDA #$40
033E JSR $FFD2
0341 JMP $033E

```

When executed with SYS 828, this will continuously output the @ character to the screen using the Kernal routine to print. If you don't care what you're outputting, then you can remove `033C LDA #$40` and save two whole bytes (the last thing in the accumulator will be outputted).

# Answer
> 0 votes
# Fith, 16 bytes

```
{ 1 . q } :: q q

```

`{ 1 . q }` pushes to the stack an anonymous function which prints `1` then calls a function named `q`. `:: q` binds this function to the word `q`, then the final `q` calls the new infinitely-recursing function.

### Non-recursive version (19 bytes):

```
{ 1 } { 1 . } while

```

This pushes a condition function, which will always push 1, and a body function, which prints 1. The `while` word continues to run the body as long as the condition leaves a truthy value on top of the stack.

# Answer
> 0 votes
# Röda, 12 bytes

```
{[0]while{}}

```

This is an anonymous function that prints zeros infinitely.

# Answer
> 0 votes
# Whitespace, 16 bytes

```

```

Try it online!

Saves 3 bytes on the previous Whitespace answer by abusing empty labels and declaring the value 0 as a 0-bit number (the spec unfortunately requires a sign bit). Posting as a new answer as the previous answer combines multiple unrelated entries.

# Explanation

(s - space, t - tab, n - newline)

```
nssn # Declare label ''
sssn # Push +0 onto the stack
tnst # Pop and output the stack value as a number - outputs the character '0'
nsnn # Jump to label ''

```

# Answer
> 0 votes
# shortC, 5 bytes

```
AWP'1

```

Prints `1` forever. Explanation:

```
A     main function
 W    forever
  P   print char
   '1 char '1'

```

Try it online!

# Answer
> 0 votes
# Fission 2, 2 bytes

```
R"

```

Try it online!

Same concept as the Befunge answer. An atom is spawned at the `R`, and moves right. It reaches the `"` and enters string mode, wraps to the beginning of the line and prints an `R`, then exits string mode and wraps again.

Outside of string mode, `R` simply changes the atom's direction to right, which is the direction it's already moving in.

# Answer
> 0 votes
# Add++, 9 bytes

```
+1
W,+1,O

```

Prints `1` Followed by a newline for ever.

Try it online!

# Answer
> 0 votes
# AHK, 11 bytes

```
Loop
Send,a

```

Pretty boring but couldn't find an AHK answer in here and thought it worthy of submission.

# Answer
> 0 votes
# Bitwise, 19 bytes

```
OUT 0 &1
JMP &-2 &1

```

Prints a load of null bytes. Try it online!

`OUT 0 &1` prints the 0th register when a literal 1 is truthy. `JMP &-2 &1` jumps back two (one) lines when a literal 1 is truthy.

# Answer
> 0 votes
## Evil, 4 bytes

Continuously prints the Start of Heading character:

```
amwb

```

If NUL is allowed you could do `mwb`.

An alternative, that goes through the ASCII characters, would be:

```
mawb

```

Quick explanation of commands:

* `m` = marking character;
* `a` = increment accumulator;
* `w` = write accumulator to STDOUT;
* `b` = go backwards to marking character and continue execution from there.

# Answer
> 0 votes
# J-uby, 11 Bytes

```
-:p|:+&1!~0

```

Explanation

`!~` is iterate until constant: `x = f(x) until x == f(x)`

`-:p` is the global print function, and `:+&1` increments a number

So `-:p|:+&1` prints a number and returns the next integer

We start at `0`

# Answer
> 0 votes
# VBA, 18 Bytes

Anonymous VBE immediate window that outputs an infinite quantity of newline characters `vbCrLf` to the VBE immediate window

```
Do:DoEvents:?:Loop

```

# Answer
> 0 votes
# R, 15 chars (or 6)

```
repeat print(1)

```

or, you could cheat slightly with just

```
repeat

```

which will invisibly return `NULL` for each time through the loop. Thus it will return `NULL` infinite times, you just can't tell.

# Answer
> 0 votes
# Jq 1.5, 9 bytes

```
repeat(1)

```

Try it online! (truncated at 128K)

# Answer
> 0 votes
# cQuents 0, 1 byte

```
$

```

Try it online!

Outputs `1,2,3,4,5,6...` up to Python's int cap (aka as long as you have memory).

Alternately, any number would work, printing that number separated by commas infinitely:

```
7

```

Try it online!

This may work at some point with an empty program once I finish this language - theoretically it should print `0,0,0,0,0,0...` for an empty program but I haven't implemented empty nodes.

# Answer
> 0 votes
# Funky, 13 bytes

```
for()print(1)

```

Try it online!

# Answer
> 0 votes
# Whispers, 28 bytes

```
> 1
>> Output 1
>> While 1 2

```

Try it online!

# Answer
> 0 votes
# Aceto, 2 bytes

```
pO

```

```
p  prints the top stack element (implicit 0)
O  returns to the origin of the program

```

Try it online!

alternate version:

```
nO
```

```
n prints a newline, O returns to origin
```

# Answer
> 0 votes
# C, ~~29~~ ~~28~~ ~~26~~ 23 bytes

```
main(){main(puts(""));}

```

-2 @steadybox

-3 @rtpatx

gcc won't like it, but it compiles.

Outputs null bytes continuously. You can swap out the `0` for anything 0-9.

You can use 7 if you really hate your speakers.

# Answer
> 0 votes
# Forked, 1 byte

```
%

```

Prints the top of stack (0 if empty). The IP wraps upon hitting the edge of the playing field, looping infinitely.

# Answer
> 0 votes
# Wumpus, 2 bytes

```
OO

```

Try it online!

Outputs infinite `0`s

Funnily enough, even though a single `O` causes an infinite loop, a new command is only executed once it leaves the current cell, meaning the pointer gets trapped inside the `O` triangle, bouncing off the walls. Adding another cell (which could be almost any cell that doesn't end the program such as `@` or `%`) allows the pointer to escape and execute the `O`utput instruction again.

# Answer
> 0 votes
# Momema, 5 bytes

```
j0!j1

```

Try it online! Outputs to STDERR. Requires the `-d` interpreter flag.

The Momema interpreter has a `-d` (debug) flag that enables a `!` instruction, which outputs some debugging information to STDERR.

## Explanation

```
j  0  #  label j0: jump past label j0 (no-op)
!     #            debug
j  1  #  label j1: jump past label j0 (back to start)

```

# Answer
> 0 votes
# axo, 2 bytes

```
{_

```

Try it online!

```
Implicit 0 on top of the stack
{  prints it
_  returns to origin, or 0,0

```

# Answer
> 0 votes
# FALSE, 7 bytes

```
[^.^]3#

```

This works in *some* FALSE interpreters (http://www.quirkster.com/iano/js/false-js.html (Paste the code, click "show", then click "step" a bunch of times (not "run" because it's an infinite loop!))). Outputs an infinite amount of `-1`s.

## Explanation:

Some versions of FALSE are weakly typed, so a normal number can be used as a function pointer.

`[^.^]` pushes a function to the stack. (specifically, the character in the code that is starts at.) In this case, it pushes the number 0.

`3` Pushes the number 3, which when called as a function will start execution at the `]` of the previous function (meaning that it skips all the code)

`#` Is a "while" loop. It pops two functions, then calls the first function (that is, the one which was PUSHED first). It then pops a value from the stack, and if this value is true, it runs the second function and repeats. If the value is false, it continues.

Our function `[^.^]` will first use `^` to push the next character of STDIN (if input is empty, it pushes -1), then `.` prints the numerical value (-1), and `^` pushes the next value of input again. This is the value which will be "returned" and used in the loop. Because it is non-zero, the second "function" is called (which is just a number pointing to a location in the code), and the interpreter immediately sees a `]`, causing it to return from the function.

# Answer
> 0 votes
# Stax, 3 bytes

```
W1P

```

Run and debug it

Outputs 1 forever. Since Stax terminates when trying to peek or pop an empty stack, I am not sure how to do it in 2 bytes or less.

# Answer
> 0 votes
# MathGolf, ~~4~~ 3 bytes

```
Äo↔

```

Try it online!

## Explanation

```
Ä     start block of length 1
 o    print TOS without popping
  ↔   do while false without popping

```

# Answer
> 0 votes
# ORK, 170 bytes

```
There is such a thing as a o
A o can i

When a o is to i:
I have a scribe called W
W is to write "!"
I am to loop

When this program starts:
I have a o called O
O is to i

```

Try it online!

**O**bjects **R** **K**ool. Maybe, but they're inconvenient (why can't I just loop the main function?).

# Answer
> 0 votes
## Burlesque - 2 bytes

```
bc

bc box cycle

```

Rather boring. `bc` encloses the top of the stack in a block and then infinitely repeats this block and thus when the value is printed when the program stops it'll obviously never stop producing output.

# Answer
> 0 votes
## JavaScript + HTML, 56 bytes

```
(g=_=>requestAnimationFrame(_=>document.writeln(g())))()

```

# Answer
> 0 votes
# Turing Machine But Way Worse, 13 bytes

```
0 0 1 1 0 1 0

```

Try it online!

prints chr(128),chr(128+64),chr(128+64+32),...,chr(128+64+...+2+1) infinitely.

No explanation since the code is self-explanatory.

# Answer
> 0 votes
# JVM bytecode (OpenJDK asmtools JASM), 194 bytes

```
enum i {public static Method main:"([Ljava/lang/String;)V" stack 2 locals 1 {l:getstatic java/lang/System.out:"Ljava/io/PrintStream;";ldc 0;invokevirtual java/io/PrintStream.print:(I)V;goto l;}}

```

Ungolfed

```
enum i {
    public static Method main:"([Ljava/lang/String;)V" stack 2 locals 1 {
    l:
        getstatic java/lang/System.out:"Ljava/io/PrintStream;";
        ldc 0;
        invokevirtual java/io/PrintStream.print:(I)V;
        goto l;
    }
}

```

First we get a reference to `System.out`, then we just invoke `void print(int)` with zero. Repeat until the heat death of the universe, since this method never returns.

Using `enum` instead of `class` saves 1 byte, along with using `ldc 0` instead of `iconst_0` to save 2 more bytes.

*Bonus points for not decompiling correctly in the Fernflower decompiler, no?*

# Answer
> 0 votes
**Python: (16 characters)**

```
while 1:print(0)

```

# Answer
> 0 votes
# Tamsin, 15 bytes

```
main={print 1}.

```

Try it online!

# Answer
> 0 votes
# Perl 6, 11 bytes

```
loop {.say}

```

Try it online!

# Answer
> 0 votes
# Brian & Chuck, 8 bytes

```
!{?
!{.?

```

Try it online!

Brian simply restarts Chuck and Chuck sets Brian's instruction pointer to the left end, prints it and restarts Brian.

Produces endless "!!!!!!..."

# Answer
> 0 votes
# Brain-Flak, 10 bytes

```
(()){(())}

```

Try it online!

I don't know if this counts as a valid answer because Brain-Flak prints the contents of the active stack and this code just fills the stack.

```
(())    push 1 on stack
{       while top of stack != 0
  (())  push 1 on stack
}

```

# Answer
> 0 votes
# Lua, 18 bytes

```
::a::print()goto a

```

Try it online!

Shortest I was able to came up with (beats any loop). Prints newlines forever.

# Answer
> 0 votes
# MarioLANG, 7 bytes

```
>:<
===

```

Try it online!

Infinitely prints zeroes; not much else to say about it.

# Answer
> 0 votes
## Element, 5 bytes

```
!{A`]

```

This outputs `A` to the console forever.

TIO

# Answer
> 0 votes
# AlphaBeta, 2 bytes

```
MN

```

Try it online!

Outputs infinite null bytes.

## Explanation

```
   # All registers are initialized to 0
M  # Output the number in register 3
 N # If register 3 is 0, goto the position at the position register.

```

# Answer
> 0 votes
# Brainetry `--live-output`, 55 bytes

Uses the `--live-output` flag, otherwise output to the console would be deferred to the end of the program, which never happens because we have an infinite loop going on.

```
a b c d
a b c d e f g h
a b c d e f g
a b c d e f g h i

```

This is a golfed version of this program:

```
Lets produce infinite output.
This is really simple, all it takes is:
A cell with a non zero value
and the --live-output flag also needs to be on.

```

If you want to try this, clone the linked github repo and run `python brainetry.py btry/infinite_output.btry --live-output`.

# Answer
> 0 votes
# Knight, 4 bytes

```
W1O1

```

Try It Online!

Prints `1` forever.

# Answer
> 0 votes
# Pascal, 50 B

Full `program` compatible to ISO standard 7185 “Pascal”.

```
program p(output);begin while 8=8 do writeLn end.

```

```
program p(output);begin while 0=0 do write(1)end.

```

*Some* dialects such as Free Pascal do not require and actually ignore the `program` header (the `program p(output);`). *There* you could *omit* those 18 bytes, so it’s **32 bytes** in total.

# Answer
> 0 votes
# Phooey, 4 bytes

```
=[?]

```

Try it online!

Outputs a debug dump repeatedly.

```
>>> DEBUG <<<
Tape: [>1<]
Stack:
>>> DEBUG <<<
Tape: [>1<]
Stack:
>>> DEBUG <<<
Tape: [>1<]
Stack:
>>> DEBUG <<<
Tape: [>1<]
Stack:
...

```

```
=      tape = tape == stack
       since tape and stack are 0, sets it to 1
[      While tape is not 0
   ?     Dump debug info
]      End

```

---

# Phooey (interpreter bug, eventual crash), 2 bytes

```
<?

```

Try it online!

Based on my "Raise a SIGSEGV" entry, where an interpreter bug is used to cause an infinite printing loop.

The bug is thoroughly explained in that post.

However, as one might expect, this does eventually (and quickly) segfault. If there was no memory protection, it would run infinitely.

# Answer
> 0 votes
# Motorola MC14500B Machine Code, 1.5 bytes

```
1BC

```

# Explanation

```
1   # store data in register R
 B  # output R
  C # JMP to the start of the program

```

# Answer
> 0 votes
# 2let, 7 bytes

```
aa
ag 1

```

prints "Hello World!" infinitely

# Answer
> -1 votes
**C# (72)**

```
using System; class P {static void Main(){for(;;) Console.Write('-');}}

```

**Output**

---
Tags: code-golf
---