title: Count up forever

text:
# Question
Title: Count up forever
Write a program that counts up forever, starting from one.

Rules:

* Your program must log to `STDOUT` or an acceptable alternative, if `STDOUT` is not available.
* Your program must be a full, runnable program, and not a function or snippet.
* Your program must output each number with a separating character in between (a newline, space, tab or comma), but this must be consistent for all numbers.
* You may print the numbers in decimal, in unary or in base 256 where each digit is represented by a byte value.
* Your program must count at least as far as 2128 (inclusive) without problems and without running out of memory on a reasonable desktop PC. In particular, this means if you're using unary, you cannot store a unary representation of the current number in memory.
* Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge. Languages specifically written to submit a 0-byte answer to this challenge are fair game but not particularly interesting.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.
* This is not about finding the language with the shortest solution for this (there are some where the empty program does the trick) - this is about finding the shortest solution in every language. Therefore, no answer will be marked as accepted.

### Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```
## Language Name, N bytes

```

where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:

```
## Ruby, <s>104</s> <s>101</s> 96 bytes

```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header:

```
## Perl, 43 + 2 (-p flag) = 45 bytes

```

You can also make the language name a link which will then show up in the snippet:

```
## [><>](http://esolangs.org/wiki/Fish), 121 bytes

```

```
<style>body { text-align: left !important} #answer-list { padding: 10px; width: 290px; float: left; } #language-list { padding: 10px; width: 290px; float: left; } table thead { font-weight: bold; } table td { padding: 5px; }</style><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="language-list"> <h2>Shortest Solution by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr> </thead> <tbody id="languages"> </tbody> </table> </div> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr> </thead> <tbody id="answers"> </tbody> </table> </div> <table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table><script>var QUESTION_ID = 63834; var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe"; var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk"; var OVERRIDE_USER = 39069; var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page; function answersUrl(index) { return "//api.stackexchange.com/2.2/questions/" + QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER; } function commentUrl(index, answers) { return "//api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER; } function getAnswers() { jQuery.ajax({ url: answersUrl(answer_page++), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { answers.push.apply(answers, data.items); answers_hash = []; answer_ids = []; data.items.forEach(function(a) { a.comments = []; var id = +a.share_link.match(/\d+/); answer_ids.push(id); answers_hash[id] = a; }); if (!data.has_more) more_answers = false; comment_page = 1; getComments(); } }); } function getComments() { jQuery.ajax({ url: commentUrl(comment_page++, answer_ids), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { data.items.forEach(function(c) { if (c.owner.user_id === OVERRIDE_USER) answers_hash[c.post_id].comments.push(c); }); if (data.has_more) getComments(); else if (more_answers) getAnswers(); else process(); } }); } getAnswers(); var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/; var OVERRIDE_REG = /^Override\s*header:\s*/i; function getAuthorName(a) { return a.owner.display_name; } function process() { var valid = []; answers.forEach(function(a) { var body = a.body; a.comments.forEach(function(c) { if(OVERRIDE_REG.test(c.body)) body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>'; }); var match = body.match(SCORE_REG); if (match) valid.push({ user: getAuthorName(a), size: +match[2], language: match[1], link: a.share_link, }); else console.log(body); }); valid.sort(function (a, b) { var aB = a.size, bB = b.size; return aB - bB }); var languages = {}; var place = 1; var lastSize = null; var lastPlace = 1; valid.forEach(function (a) { if (a.size != lastSize) lastPlace = place; lastSize = a.size; ++place; var answer = jQuery("#answer-template").html(); answer = answer.replace("{{PLACE}}", lastPlace + ".") .replace("{{NAME}}", a.user) .replace("{{LANGUAGE}}", a.language) .replace("{{SIZE}}", a.size) .replace("{{LINK}}", a.link); answer = jQuery(answer); jQuery("#answers").append(answer); var lang = a.language; lang = jQuery('<a>'+lang+'</a>').text(); languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang.toLowerCase(42), user: a.user, size: a.size, link: a.link}; }); var langs = []; for (var lang in languages) if (languages.hasOwnProperty(lang)) langs.push(languages[lang]); langs.sort(function (a, b) { if (a.lang_raw > b.lang_raw) return 1; if (a.lang_raw < b.lang_raw) return -1; return 0; }); for (var i = 0; i < langs.length; ++i) { var language = jQuery("#language-template").html(); var lang = langs[i]; language = language.replace("{{LANGUAGE}}", lang.lang) .replace("{{NAME}}", lang.user) .replace("{{SIZE}}", lang.size) .replace("{{LINK}}", lang.link); language = jQuery(language); jQuery("#languages").append(language); } }</script>
```

# Answer
## Labyrinth, 5 bytes

```
):
\!

```

♫ The IP in the code goes round and round ♫

Relevant instructions:

```
)       Increment top of stack (stack has infinite zeroes at bottom)
:       Duplicate top of stack
!       Output top of stack
\       Output newline

```
> 66 votes

# Answer
# \>\<\>, 8 bytes

```
01+:nao!

```

Steps:

* Push 0 on the stack
* Add 1 to the top stack element
* Duplicate top stack element
* Output the top of the stack as number
* Output a newline
* Go to step 2 by wrapping around and jumping the next instruction (step 11)

*(A less memory efficient (hence invalid) program is `llnao`.)*
> 55 votes

# Answer
# C (64-bit architecture only), 53 bytes

Relies on pointers being at least 64 bits and prints them in hex using the `%p` specifier. The program would return right when it hits 2^128.

```
char*a,*b;main(){for(;++b||++a;)printf("%p%p ",a,b);}

```
> 33 votes

# Answer
## Haskell, 21 bytes

```
main=mapM_ print[1..]

```

Arbitrary-precision integers and infinite lists make this easy :-)

Luckily `mapM_` is in the Prelude. If `Data.Traversable` was as well, we even could shrink it to 19 bytes:

```
main=for_[1..]print

```
> 27 votes

# Answer
# Gol\>\<\>, 3 bytes

```
P:N

```

Steps:

* Add 1 to the top stack element (at start it is an implicit 0)
* Duplicate top stack element
* Pop and output the top of the stack as number and a newline
* Wrap around to step 1 as we reached the end of the line
> 25 votes

# Answer
# Marbelous, ~~11450~~ 4632 bytes

Printing decimals is a pain!!

Definitely not winning with this one, but I thought I'd give it a shot. I hope it's ok that it pads the output to 40 zeros (to fit 2^128).

```
00@0..@1..@2..@3..@4..@5..@6..@7..@8..@9..@A..@B..@C..@D..@E..@F..@G..@H..@I..@J
\\++..00..00..00..00..00..00..00..00..00..00..00..00..00..00..00..00..00..00..00
..EhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhunEhun
....AddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddtAddt
..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7..&7\/
../\&8..........................................................................
....@0..........................................................................
....../\&8......................................................................
....//..@1......................................................................
........../\&8..................................................................
......////..@2..................................................................
............../\&8..............................................................
........//////..@3..............................................................
................../\&8..........................................................
..........////////..@4..........................................................
....................../\&8......................................................
............//////////..@5......................................................
........................../\&8..................................................
..............////////////..@6..................................................
............................../\&8..............................................
................//////////////..@7..............................................
................................../\&8..........................................
..................////////////////..@8..........................................
....................................../\&8......................................
....................//////////////////..@9......................................
........................................../\&8..................................
......................////////////////////..@A..................................
............................................../\&8..............................
........................//////////////////////..@B..............................
................................................../\&8..........................
..........................////////////////////////..@C..........................
....................................................../\&8......................
............................//////////////////////////..@D......................
........................................................../\&8..................
..............................////////////////////////////..@E..................
............................................................../\&8..............
................................//////////////////////////////..@F..............
................................................................../\&8..........
..................................////////////////////////////////..@G..........
....................................................................../\&8......
....................................//////////////////////////////////..@H......
........................................................................../\&8..
......................................////////////////////////////////////..@I..
............................................................................../\&8
........................................//////////////////////////////////////..@J
&9&9&9&9&9&9&9&9&9&9&9&9&9&9&9&9&9&9&9&9
Sixteenbytedecimalprintermodulewitharegi

:Sixteenbytedecimalprintermodulewitharegi
}J}J}I}I}H}H}G}G}F}F}E}E}D}D}C}C}B}B}A}A}9}9}8}8}7}7}6}6}5}5}4}4}3}3}2}2}1}1}0}00A
/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A/A%A
%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..%A..
+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O..
+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O+O..

:/A
..}0..}0..
..>>}0....
..>>>>\\..
....//..//
../\>>\\..
....>>..//
....>>\\..
....>>....
\\>>//....
..>>......
..>>......
../\......
..../\<<..
......<<..
..\\<<//..
....~~....
....++....
....\\..//
\\....>9\/
..\\..?0..
......++..
....\\....
......{0..

:%A
@0..
}0..
<A-A
{0@0

:Eg
}0}0}0}0}0}0}0}0
^7^6^5^4^3^2^1^0
~~....~~~~..~~~~
^0^0^0^0^0^0^0^0
{0{0{0{0{0{0{0{0

:Ehun
}0..}0
Eg..&0
=8&0{0
&1\/00
0100&0
&1&1{1
{1{0

:Addt
}0}1
{1{1

```
> 24 votes

# Answer
## Hexagony, ~~12~~ ~~11~~ ~~10~~ 7 bytes

*Thanks to alephalpha for fitting the code into side-length 2.*

```
10})!';

```

Unfolded:

```
 1 0
} ) !
 ' ;

```

This one is fairly simple. `10` writes a 10, i.e. a linefeed to the initial memory edge. Then `})!';` is repeatedly executed in a loop:

* `}` move to the next memory edge.
* `)` increment it.
* `!` print it as an integer.
* `'` move back to the 10.
* `;` print it as a character.

I believe that this is optimal (although by far not unique). I've let the brute force script I wrote for this answer search for 6-byte solutions under the assumption that it would have to contain at least one each of `;` and `!` and either `(` or `)`, and would not contain `?`, `,` or `@`, and it didn't find any solutions.
> 19 votes

# Answer
# bc, 10

```
for(;;)++i

```

Unusual that `bc` is shorter than `dc`.

From `man bc`:

> DESCRIPTION
>
> bc is a language that supports arbitrary precision numbers
> 17 votes

# Answer
# Pyth, 4 bytes

```
.V1b

```

### Explanation:

```
.V1    for b in range(1 to infinity):
   b      print b

```
> 14 votes

# Answer
# Java, ~~139~~ ~~138~~ ~~127~~ 123 bytes

```
class K{public static void main(String[]a){java.math.BigInteger b=null;for(b=b.ZERO;;)System.out.println(b=b.add(b.ONE));}}

```
> 12 votes

# Answer
# Mathematica, 22 bytes

```
i=0;While[Echo[++i]>0]

```

`Echo` is a new function in Mathematica 10.3.
> 10 votes

# Answer
# Python 3, ~~33~~ 25 bytes

As far as I understand, Pythons integers are arbitrary precision, and `print()` automatically produces newlines.

Thanks for @Jakub and @Sp3000 and @wnnmaw! I really don't know much python, the only think I knew was that it supports arbitrary size integers=)

```
k=1
while 1:print(k);k+=1

```
> 9 votes

# Answer
# Ruby, ~~15~~ 12 bytes

```
loop{p$.+=1}

```
* `p`, when given an integer, prints the integer as-is (courtesy of @philomory)
* `$.` is a magical variable holding the number of lines read from stdin. It is obviously initialized to 0, and also assignable :)
> 8 votes

# Answer
# Samau, 2 bytes

```
N)

```

Explanation:

```
N     push the infinite list [0 1 2 ...] onto the stack
 )    increase by 1

```

When the output of a program is a list, the outmost brackets are omitted.
> 8 votes

# Answer
# Microsoft PowerPoint (33 Slides, 512 shapes to meet minimum requirements)

Storage representation is in hexadecimal.

## Directions

* Click the blue square to advance the counter (or propagate the carry), or make an AutoHotKey Script to click it for you.
* You can view the number's digits at any time using the green buttons. (It causes unintended behavior if you click the blue buttons after viewing another digit.) This is just for a better UX. It still counts up as normal as long as you keep clicking the blue button. In other words, no user decision is required.
* If you reach the end, it displays a congratulatory message.

You can get the PPTX here. Requires PowerPoint to run.

Before you comment that Microsoft PowerPoint is not a programming language, it has been shown that PowerPoint is Turing complete (in the same sense that conventional languages such as C are Turing complete). A brief discussion is given here.
> 8 votes

# Answer
# makina, 22 bytes

```
v
>Pv
^>OC
^Uu>n0;
^O<

```

I AM REAL HUMAN YOU SHOULD TRUST ME AND DO WHAT I SAY
> 7 votes

# Answer
# Matlab, 132 bytes

```
a=0;while 1;b=a==9;n=find(cumsum(b)-(1:numel(b)),1);a(n)=a(n)+1;a(1:n-1)=0;if ~numel(n);a=[0*a,1];end;disp([a(end:-1:1)+'0','']);end

```

Ok, I think this is the *first serious* answer that accomplishes this task without a trivial builtin abitrary size integer. This program implements an arbitrary size integer as an array of integers. Each integer is always between 0 and 9, so each array element represents one decimal digit. The array size wil be increased by one as soon as we are at e.g. `999`. The memory size is no problem here, as `2^128` only requires an array of length 39.

```
a=0;
while 1
    b=a==9;
    %first number that is not maxed out
    n=find(cumsum(b)-(1:numel(b)),1);
    %increase that number, and sett all maxed out numbers to zero
    a(n)=a(n)+1;
    a(1:n-1)=0;
    if ~numel(n) %if we maxed out all entries, add another digit
        a=[0*a,1];
    end
    disp([a(end:-1:1)+'0',''])%print all digits
end

```
> 6 votes

# Answer
# Processing, ~~95~~ ~~85~~ 71 bytes

```
java.math.BigInteger i;{i=i.ZERO;}void draw(){println(i=i.add(i.ONE));}

```

I tried something with a while loop but it causes all of Processing to crash, so I'll stick with this for now.

(Thanks to @SuperJedi224 and @TWiStErRob for suggestions.)
> 6 votes

# Answer
# JavaScript (ES6), ~~99~~ ~~94~~ 67 bytes

```
for(n=[i=0];;)(n[i]=-~n[i++]%10)&&alert([...n].reverse(i=0).join``)

```

`alert` is the generally accepted `STDOUT` equivalent for JavaScript but using it means that consecutive numbers are automatically separated. I've assumed that outputting a character after the number is not necessary because of this.
> 6 votes

# Answer
## sed, ~~116~~ ~~92~~ 83 bytes

```
:
/^9*$/s/^/0/
s/.9*$/_&/
h
s/.*_//
y/0123456789/1234567890/
x
s/_.*//
G
s/\n//p
b

```

**Usage:** Sed operates on text input and it *needs* input do anything. To run the script, feed it with just one empty line:

```
$ echo | sed -f forever.sed

```

**Explanation:** To increment a number, the current number is split up into a prefix and a suffix where the suffix is of the form `[^9]9*`. Each digit in the suffix is then incremented individually, and the two parts are glued back together. If the current number consists of `9` digits only, a `0` digit is appended, which will immediately incremented to a `1`.
> 5 votes

# Answer
## Intel 8086+ Assembly, 19 bytes

```
68 00 b8 1f b9 08 00 31 ff f9 83 15 00 47 47 e2 f9 eb f1

```

Here's a breakdown:

```
68 00 b8                push   0xb800             # CGA video memory
1f                      pop    ds                 # data segment
b9 08 00           L1:  mov    cx, 8              # loop count
31 ff                   xor    di, di             # ds:di = address of number
f9                      stc                       # set carry
83 15 00           L2:  adc    word ptr [di], 0   # add with carry
47                      inc    di
47                      inc    di
e2 f9                   loop   L2
eb f1                   jmp    L1

```

It outputs the 128 bit number on the top-left 8 screen positions. Each screen position holds a 8-bit ASCII character and two 4 bit colors.

*Note: it wraps around at 2128; simply change the `8` in`mov cx, 8` to `9` to show a 144 bit number, or even `80*25` to show numbers up to 232000.*

## Running

### 1.44Mb bzip2 compressed, base64 encoded bootable floppy Image

Generate the floppy image by copy-pasting the following

```
QlpoOTFBWSZTWX9j1uwALTNvecBAAgCgAACAAgAAQAgAQAAAEABgEEggKKAAVDKGgAaZBFSMJgQa
fPsBBBFMciogikZcWgKIIprHJDS9ZFh2kUZ3QgggEEh/i7kinChIP7HrdgA=

```

into this commandline:

```
base64 -d | bunzip2 > floppy.img

```

and run with, for instance, `qemu -fda floppy.img -boot a`

### 1.8Mb bootable ISO

This is a base64 encoded bzip2 compressed ISO image. Generate the iso by pasting

```
QlpoOTFBWSZTWZxLYpUAAMN/2//fp/3WY/+oP//f4LvnjARo5AAQAGkAEBBKoijAApcDbNgWGgqa
mmyQPU0HqGCZDQB6mQ0wTQ0ZADQaAMmTaQBqekyEEwQaFA0AA0AxBoAAA9Q0GgNAGg40NDQ0A0Bi
BoDIAANNAA0AyAAABhFJNIJiPSmnpMQDJpp6nqeo0ZDQaAANB6IA0NAGj1EfIBbtMewRV0acjr8u
b8yz7cCM6gUUEbDKcCdYh4IIu9C6EIBehb8FVUgEtMIAuvACCiO7l2C0KFaFVABcpglEDCLmQqCA
LTCAQ5EgnwJLyfntUzNzcooggr6EnTje1SsFYLFNW/k+2BFABdH4c4vMy1et4ZjYii1FbDgpCcGl
mhZtl6zX+ky2GDOu3anJB0YtOv04YISUQ0JshGzAZ/3kORdb6BkTDZiYdBAoztZA1N3W0LJhITAI
2kSalUBQh60i3flrmBh7xv4TCMEHTIOM8lIurifMNJ2aXr0QUuLDvv6b9HkTQbKYVSohRPsTOGHi
isDdB+cODOsdh31Vy4bZL6mnTAVvQyMO08VoYYcRDC4nUaGGT7rpZy+J6ZxRb1b4lfdhtDmNwuzl
E3bZGU3JTdLNz1uEiRjud6oZ5kAwqwhYDok9xaVgf0m5jV4mmGcEagviVntDZOKGJeLjyY4ounyN
CWXXWpBPcwSfNOKm8yid4CuocONE1mNqbd1NtFQ9z9YLg2cSsGQV5G3EhhMXKLVC2c9qlqwLRlw4
8pp2QkMAMIhSZaSMS4hGb8Bgyrf4LMM5Su9ZnKoqELyQTaMAlqyQ3lzY7i6kjaGsHyAndc4iKVym
SEMxZGG8xOOOBmtNNiLOFECKHzEU2hJF7GERK8QuCekBUBdCCVx4SDO0x/vxSNk8gKrZg/o7UQ33
Fg0ad37mh/buZAbhiCIAeeDwUYjrZGV0GECBAr4QVYaP0PxP1TQZJjwT/EynlkfyKI6MWK/Gxf3H
V2MdlUQAWgx9z/i7kinChITiWxSo

```

into

```
base64 -d bunzip2 > cdrom.iso

```

and configure a virtual machine to boot from it.

### DOS .COM

This is a base64 encoded DOS .COM executable:

```
aAC4H7kIADH/+YMVAEdH4vnr8Q==

```

Generate a .COM file using

```
/bin/echo -n aAC4H7kIADH/+YMVAEdH4vnr8Q== | base64 -d > COUNTUP.COM

```

and run it in (Free)DOS.
> 5 votes

# Answer
## C++, ~~146~~ ~~141~~ 138 bytes

Using a standard bigint library is perhaps the *most* boring way of answering this question, but someone had to do it.

```
#include<stdio.h>
#include<boost/multiprecision/cpp_int.hpp>
int main(){for(boost::multiprecision::uint512_t i=1;;){printf("%u\n",i++);}}

```

Ungolfed:

```
#include<cstdio>
#include<boost/multiprecision/cpp_int.hpp>

int main()
{
    for(boost::multiprecision::uint512_t i=1;;)
    {
        std::printf("%u\n", i++);
    }
}

```

The reason the golfed version uses `stdio.h` and not `cstdio` is to avoid having to use the `std::` namespace.

This is my first time golfing in C++, let me know if there's any tricks to shorten this further.
> 5 votes

# Answer
## C# .NET 4.0, ~~111~~ ~~103~~ ~~102~~ 97 bytes

```
class C{static void Main(){System.Numerics.BigInteger b=1;for(;;)System.Console.WriteLine(b++);}}

```

I didn't find any C# answer here, so I just had to write one.

.NET 4.0 is required, because it's the first version that includes BigInteger. You have to reference System.Numerics.dll though.

With indentation:

```
class C
{
    static void Main()
    {
        System.Numerics.BigInteger b = 1;
        for (;;)
            System.Console.WriteLine(b++);
    }
}

```

*Thanks to sweerpotato, Kvam, Berend for saving some bytes*
> 5 votes

# Answer
## Clojure, 17 bytes

```
(map prn (range))

```

Lazy sequences and arbitrary precision integers make this easy (as for Haskell and CL). `prn` saves me a few bytes since I don't need to print a format string. `doseq` would probably be more idiomatic since here we're only dealing with side effects; `map` doesn't make a lot of sense to use since it will create a sequence of `nil` (which is the return value of each `prn` call.

Assuming I count forever, the null pointer sequence which results from this operation never gets returned.
> 5 votes

# Answer
# MarioLANG, 11 bytes

```
+<
:"
>!
=#

```

Inspired by Martin Büttner's answer in another question.
> 4 votes

# Answer
## CJam, 7 bytes

```
0{)_p}h

```

Explanation:

```
0         e# Push a zero to the stack
 {        e# Start a block
  )         e# Increment top of stack
   _        e# Duplicate top of stack
    p       e# Print top of stack
     }    e# End block
      h   e# Do-while loop that leaves the condition on the stack

```

Note: Must use Java interpreter.
> 4 votes

# Answer
## C, 89 bytes

A new approach (implementing a bitwise incrementer) in C:

```
b[999],c,i;main(){for(;;)for(i=c=0,puts(b);i++<998;)putchar(48+(c?b[i]:(b[i]=c=!b[i])));}

```

**Less golfed**

```
int b[999], c, i;
main() {
  for(;;)
    for(i=c=0, puts(b); i++ < 998;)
      putchar(48 + (c ? b[i] : (b[i] = c = !b[i])));
}

```

**Terminate**

This version has the slight flaw, that it does not terminate (which isn't a requirement at the moment). To do this you would have to add 3 characters:

```
b[129],c=1,i;main(){for(;c;)for(i=c=0,puts(b);i++<128;)putchar(48+(c?b[i]:(b[i]=c=!b[i])));}

```
> 4 votes

# Answer
# BotEngine, ~~128~~ ~~120~~ ~~112~~ 8x13=104

```
v2 2 01
>e>S SS
   e1e1
   e2 e0 12
   > > S SS P
  ^   <e0e1 R
     ^ < <lC^
^         <

```

Output is in binary.
> 4 votes

# Answer
# Acc!, ~~64~~ 65 bytes

Also works in *Acc!!*.

```
Count q while 1 {
Count x while q-x+1 {
Write 7
}
Write 9
}

```

This prints the numbers out in unary using Bell characters seperated by tabs. If I have to use a more standard character, that would make the program **66 bytes**.

The Acc! interpreter provided in the linked answer translates Acc! to Python, which does support arbritrary-precision integers.
> 4 votes

# Answer
# Foo, 6 bytes

```
(+1$i)

```

---

### Explanation

```
(    )    Loop
 +1       Add one to current element
   $i     Output current element as a decimal integer

```
> 4 votes

# Answer
## Minkolang, 4 bytes

```
1+dN

```

Try it here. (Well, actually, be careful. 3 seconds of run time was enough to get up to ~40,000.)

`1+` adds 1 to the top of stack, `d` duplicates it, and `N` outputs the top of stack as an integer with a trailing space. This loops because Minkolang is toroidal, so when the program counter goes off the right edge, it reappears on the left.
> 4 votes

# Answer
## Perl, ~~34~~ ~~32~~ ~~30~~ ~~28~~ ~~26~~ 23 bytes

```
-Mbigint -E '{say$_+=1;redo}'

```

Test with

```
perl -Mbigint -E '{say$_+=1;redo}'

```
> 4 votes

# Answer
## Marbelous, 358 bytes

```
..@F..@E..@D..@C..@B..@A..@9..@8..@7..@6..@5..@4..@3..@2..@1..@001@Z01
..AddoAddoAddoAddoAddoAddoAddoAddoAddoAddoAddoAddoAddoAddoAddoAddo/\&I
00&I00&I00&I00&I00&I00&I00&I00&I00&I00&I00&I00&I00&I00&I00&I00&I....@Z
@FHd@EHd@DHd@CHd@BHd@AHd@9Hd@8Hd@7Hd@6Hd@5Hd@4Hd@3Hd@2Hd@1Hd@0Hd
0A@N
..&I
@N/\..
:Hd
}0
Hp
}0
..
{<
#include hex_out.mbl
#include arithmetic.mbl

```

16 half adders chained together, the rightmost one performing N++ each cycle and each adder feeding its overflow (00 or 01) to the next in the chain. Output is in hex.

~~The python interpreter has a bug where output from memoized functions is lost, so you have to run this with "-m 0" to make it work right. Without that parameter you can see how fast it will run without the bug, but the output won't work right.~~

~~Note to self: fix that bug in marbelous.py~~ This bug has been fixed in the latest version of marbelous.py
> 4 votes

# Answer
## R, 52 Bytes

```
a=gmp::as.bigz(1);repeat{cat(paste(a,""));a=a+1}

```

(Note: `gmp` is an external library, so you may have to download it for this solution to work)
> 4 votes

# Answer
## Turing Machine Simulator, 536 bytes

```
a * * r a
a , * r A
A * * r A
A , * l b
b * * l b
b , * l c
b s 0 l 0
b p 1 l 1
b d 2 l 2
b f 3 l 3
b g 4 l 4
b h 5 l 5
b i 6 l 6
b j 7 l 7
b k 8 l 8
b l 9 l 9
0 * * l 0
0 _ s r a
1 * * l 1
1 _ p r a
2 * * l 2
2 _ d r a
3 * * l 3
3 _ f r a
4 * * l 4
4 _ g r a
5 * * l 5
5 _ h r a
6 * * l 6
6 _ i r a
7 * * l 7
7 _ j r a
8 * * l 8
8 _ k r a
9 * * l 9
9 _ l r a
c _ p l d
c s p l d
c p d l d
c d f l d
c f g l d
c g h l d
c h i l d
c i j l d
c j k l d
c k l l d
c l s l c
d * * l d
d _ , r A

```

Test it out here -\> link
initial input: ,\*p,
initial state: b

Explanation:
state a: move right until a comma is found then move to state A
state A: move right until a comma is found then move to state b
state b: move left until a letter or a comma is found. If a letter is found, change the letter to its corresponding digit and move to the corresponding state. If a comma is found, move to state c.
states 0-9: move left until an empty space is found then write the digit
state c: increment the number and end up on the left then move to state d
state d: place a comma then move to state A
Basically, it finds the previous number, copies it over while converting it to digits, increments it, then starts all over.

On a real turing machine this would go way over 2^128
> 4 votes

# Answer
## 05AB1E, 4 bytes

```
[¼¾,

```

**Explained**

```
[           # start infinite loop
 ¼          # increase counter
  ¾         # push counter
   ,        # print with a newline

```
> 4 votes

# Answer
## Alice, 6 bytes

```
h .\
O

```

Try it online!

Alice is a 2D language with two modes - Cardinal (up/down/left/right) for integers and Ordinal (diagonal) for strings. For this challenge we need Cardinal to count and Ordinal to print as an integer (as opposed to a byte).

We start off from the top left in Cardinal mode, with `h` incrementing the top of stack — for the first iteration, this is an implicit 0. The space that follows is a no-op, and the `.` after duplicates the top of stack.

Next we pass through the mirror `\`, reflecting us NE and switching us to Alice's Ordinal mode. In Ordinal mode the IP reflects off the code boundary rather than wrapping around, so we rebound and start moving SW.

From here we bounce twice, hit the `O` to print as integer, and bounce back to the `\`. This switches us back to Cardinal mode moving rightward, wrapping around and continuing the infinite loop.

TL;DR:

```
0123  ->  h5.3  ->  h7 9  ->  01.9  ->  ...
O         6 4       6 8       O

```
> 4 votes

# Answer
# Rust, 41 bytes

```
fn main(){for i in 1..{println!("{}",i)}}

```

Try it online!
> 4 votes

# Answer
## Burlesque, 9 bytes

```
1R@2SH[-Q

```

If you don't care what the first character is go with `1R@`.

**Explanation:**

`R@` is the RangeInf built-in and creates a Block with numbers `[N..Infinity]` so `1R@` generates a Block `{1 2 3 4 5....}`. However, if we display this we'll have a `{` at the start of our output which we don't want. `SH` converts a value to a display value (called Pretty) and then back to a String using the display format. `2` is the Format `With Spaces` so `2SH` produces `[1 2 3 4 5...]`. Now we use `[-` which is the Tail built-in which removes the first character in that string. `Q` converts our string to a display value. Burlesque generally prints things as you input them, so when it prints a String there it will be surrounded by quotes. If one doesn't want that we have to convert it to a display value (called Pretty).

```
blsq ) "hi"
"hi"
blsq ) "hi"Q
hi
blsq ) 5ro
{1 2 3 4 5}
blsq ) 5ro2SH
"[1 2 3 4 5]"
blsq ) 5ro2SH[-
"1 2 3 4 5]"
blsq ) 5ro2SH[-Q
1 2 3 4 5]

```
> 3 votes

# Answer
# C, 93

Count up to `10^97.` Add 3 bytes to count up to `10^997` (and so on).

```
char*p,d[99],*q=d+97;main(){while(p-d)*q>56?(*q--=48):(*q||(*(p=q)=48),++*q,puts(p),q=d+97);}

```

**Less golfed**

```
char*p,d[99],*q=d+97;

main()
{
  while(p!=d)
  {
    if(*q > '8') {
      *q = '0';
      --q;
    }
    else {
      if (!*q) {
        *q = '0';
        p = q;
      }
      ++*q;
      puts(p);
      q = d + 97;
    }
  }
}

```
> 3 votes

# Answer
# dc, 12 bytes

Uses an "anonymous" recursive macro, should be able to run for ever:

```
z[r1+prdx]dx

```
> 3 votes

# Answer
## Seriously, 4 bytes

```
1W■u

```

Explanation:

```
1    puts 1 on the stack
W    begins a while loop that executes while the (peeked) value on top of the stack is truthy
  ■    output entire stack without popping
  u    increment value on top of stack
<EOF> implicit end of while loop block

```

No online interpreter link because it doesn't do so well with infinite loops.
> 3 votes

# Answer
## Powershell, ~~43~~ 29 bytes

```
[Numerics.BigInteger]$i=1;for(){$i;$i=$i+1}

```

Relies on .Net 4.0 and up for `System.Numerics.BigInteger`

V2

```
[BigInt]$i=0;for(){($i=$i+1)}

```

Thanks to TimmyD for the additional tips for use of parens to a automatically produce output and `[bigint]` for type assignment.
> 3 votes

# Answer
## Scala, ~~41~~ ~~39~~ 35 bytes

```
Stream.iterate(BigInt(0)){_+1}print

```

Other versions (I left all solutions there because they're significantly different):

```
def r(n:BigInt){println(n);r(n+1)};r(0)   // 39
var i=BigInt(0);while(1>0)println{i+=1;i} // 41

```

*This is my first time writing Scala code.*

Original idea based on SuperJedi224's Java answer.

`{i=>i+1}` can be shortened to `{_+1}`.
`foreach println` was replaced with `print` because the problem description allows any separator.
`Iterator.iterate` and `Stream.iterate`, though completely different, do the same thing.

Other tries

```
Stream.from(0).print() // overflows at Integer.MAX_VALUE
BigInt(0).to(10)foreach println // 10 should be BigInt.MAX_VALUE (=Infinity), which doesn't exist
def from(start:BigInt):Stream[BigInt]=Stream.cons(start,from(start+1));from(0).print // too long

```
> 3 votes

# Answer
# c + GMP library, 90

Score includes +4 for passing `-lgmp` to the compiler. You'll need GMP installed to build and run this.

Here's how we do arbitrary precision in c:

```
#include<gmp.h>
main(){mpz_t i;for(mpz_init(i);mpz_add_ui(i,i,1),gmp_printf("%Zd\n",i););}

```

Compile with:

```
cc forever.c -o forever -lgmp

```

Try it online!
> 3 votes

# Answer
# PARI/GP, 23 bytes

```
i=0;until(print(i+=1),)

```

---

**Sample Usage**

```
$ gp -qf < countup.gp

```
> 3 votes

# Answer
# Racket, 40 bytes

```
(sequence-for-each println(in-naturals))

```

Racket has arbitrary-precision numbers, so this will continue to count up forever.
> 3 votes

# Answer
# C, 95 bytes

```
int a,c[50]={-38};main(){for(a=49;++c[a]>9;c[a--]=0);for(a=0;a<50;++a)putchar(c[a]+48);main();}

```

Prints:

```
00000000000000000000000000000000000000000000000001
00000000000000000000000000000000000000000000000002
...

```
> 3 votes

# Answer
## Perl 6, 13 bytes

```
.say for 1..*

```
> 3 votes

# Answer
# 8086 machine code + DOS, 34 bytes

Hexdump:

```
30 0D 0A 24 FE C6 BB 00 01 B4 09 CD 21 FE 07 80
3F 3A 75 F2 C6 07 30 4B 3B DA 73 F1 C6 07 30 4A
EB EB

```

In assembly language:

```
    .MODEL TINY

    .CODE
    org 100h

MAIN PROC

    db '0',13,10,'$' ; output buffer
    inc dh ; assign dx=0x100 - address of the output buffer

increase_num:
    mov bx, 100h
    mov ah, 9
    int 21h ; print the number

increase_digit:
    inc byte ptr [bx]
    cmp byte ptr [bx], '0'+10
    jne increase_num
    mov byte ptr [bx], '0'
    dec bx
    cmp bx, dx
    jae increase_digit
    mov byte ptr [bx], '0'
    dec dx
    jmp increase_digit

MAIN ENDP
END MAIN

```

Some explanations:

Output buffer is at offset 0x100; it contains 4 bytes at first: `'0'`, a newline sequence `0d 0a`, and `'$'`, which is an end-of-output-buffer byte that DOS uses. These 4 bytes are executed as nonsensical code:

```
xor [di],cl
or ah,[si]

```

This destroys the program exit instruction at offset 0, but this is OK because the program will not exit!

The instruction `inc dh` generates the value 0x100 in `dx`, which is the address of the output buffer. The output buffer grows down, decreasing the value of `dx` with each power of 10.

The number is stored as an ASCII string. The increment code starts from the last digit, increases it and checks whether it went out of range 0...9. If yes, it sets the digit to 0 and goes to the next digit (`dec bx`). If all digits are set to 0, it adds (`dec dx`) another 0 digit, and immediately increases it to 1.
> 3 votes

# Answer
# , 7 bytes

```
1{.o)}w
```

Explanation:

```
1       Pushes 1 to the stack
 {   }w While the top of the stack is not 0
  .o)   Output the top of the stack and increment it

```

Does not work on online IDE, but does in REPL and file.
> 3 votes

# Answer
## Mathematica, 22 bytes

```
For[i=1,1>0,Print@i++]

```
> 3 votes

# Answer
## Brainfuck, 44 bytes

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

```

I'm surprised there are no brainfuck submissions, so here's my attempt (and my first brainfuck program). I interpreted the constraint on number formatting as 'whatever is convenient for your language', so the output here is as a binary string of `00` and `01`, with `FF` as separators. The beginning of the output:

```
0000000: 01 ff 01 00 ff 01 01 ff 01 00 00 ff 01 00 01 ff  ................
0000010: 01 01 00 ff 01 01 01 ff 01 00 00 00 ff 01 00 00  ................

```

The standard 30000 byte BF implementation can go as high as `2^15000` before reaching undefined behavior. Here is another version which produces a more readable output consisting of "0" and "1" with newlines as separators (currently 105 chars, although this can probably be golfed more):

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

```

Output:

```
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111

```
> 3 votes

# Answer
# WhoScript, 28 27 bytes

```
1#1;v;e;pw #;#a;pw;#1;+;i;d

```

Ungolfed/Explanation:

```
# 1                        @ push 1 to the stack
time_vortex                @ begin an infinite loop
  duplicate                @ duplicates the top of the stack
  psychic_paper write #    @ prints the top of the stack as a number
  # a                      @ pushes 10 (0xA) to the stack
  psychic_paper write      @ prints the character whose ASCII code matches the top of the stack
  # 1                      @ pushes another 1 to the stack
  +                        @ adds the top two stack values (as a floating point number)
  integer                  @ converts the top number of the stack to an integer
paradox                    @ go back to the 'time_vortex' line

```

Shaved off a byte by using 0xA instead of 0x20
> 3 votes

# Answer
## Pyth, 4 bytes

```
.V1b

```

`.V` begins an infinite loop which defines incremented `b`, starting with `1`. The body of the loop implicitly prints `b` on the next line.
> 3 votes

# Answer
# Brachylog, 6 bytes

```
#>=@w\

```

Try it online!

### Explanation

```
#>         Constrain a number in [1,∞)
  =        Assign a value to the number in that interval
   @w      Write the number followed by a linebreak
     \     False ; try another value assignement in the interval

```
> 3 votes

# Answer
# Fuzzy Octo Guacamole, 4 bytes

```
(+X)

```

Explanation:

```
(+X)
(  )    # Infinite loop.
 +      # Increment ToS, which is 0 by default.
  X     # Print ToS.
        # Implicit output applies to the end of a loop.

```
> 3 votes

# Answer
# Sesos, 2 bytes

Hexdump:

```
0000000: 0c3a                                              .:

```

Try it online!

Assembly:

```
set numout ;output one number per line instead of character
nop        ;set entry marker (start of loop)
add 1
put
           ;(implicit jnz) set exit marker (end of loop, jump if not zero)

```
> 3 votes

# Answer
# Chip, 2214 bytes

**Noncompeting:** this uses language features that post-date the challenge. For a competing entry that is too inefficient to run, see the edit history.

2211 bytes for the code, plus 3 bytes for the `-w` flag.

```
o z*
`K\' ,--K   ,--K   ,--K   ,--K   ,--K   ,--K   ,--K8  ,--K   ,--K   ,--K   ,--K   ,--K   ,--K   ,--K   ,--K
o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o
o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o
o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o
o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o
o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o
o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o
o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o
o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o | o#-o,' o#-o
 `---'  `---'  `---'  `---'  `---'  `---'  `---'  `---'  `---'  `---'  `---'  `---'  `---'  `---'  `--'
=
o-----)-------------------------------------------------------------------------------------------------.
`z--z------z------z------z------z------z------z------z------z------z------z------z------z------z------z-K----.
o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a o-zo/a
oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b oz-o/b
o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c o-zo/c
oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d oz-o/d
o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e o-zo/e
oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f oz-o/f
o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g o-zo/g
oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h oz-o/h

```

This solution gives output in 128 bits / 16 bytes, big endian. It has two main sections, one for incrementing, and the other for timing, storage, and output. There is likely a smaller implementation out there, but I haven't yet conceived of it.

**Try it online for the 128-bit version**.
**Try it online for the 16-bit version**, much faster than the 128 bit version.

Notes about the TIO: The `-v` flag is included, which shows the actual incoming/outgoing binary on stderr. In the TIO, we also provide a `-cN` flag, which cuts off the program after N bytes have been produced.

### Explanation

Chip is a (mostly) 2D language that operates on individual bits, which is why it needs a lot of space for 128-bit support. I won't get into the specific details (because we'd be here all day), but here's the gist of what's going on:

* Layers:
```
=
```
This is a layer divider. Lines above form the first layer, lines below form the second. Wherever there are `o`'s on both layers, a connection is formed.
* Incrementing:
```
 K   ,--
o#-o |
o#-o |
o#-o |
o#-o |
o#-o |
o#-o |
o#-o |
o#-o |
 `---'
```
Each `#` is a half-adder, and each column of `#` serves to increment the eight inputs on the left to the eight outputs on the right. The `K` at the top is a caching element to help with call stack efficiency. The tail is a wire to bring the carry back up to the next incrementor. There are sixteen such incrementors, for the sixteen bytes required to produce 128 bits. The `8` seen near the eighth incrementor is used for cache priming. This element is always the first element polled each cycle, and so it primes all caches to it's left. This prevents a stack overflow when we eventually compute the values to the right.
* Storage:
```
o-zo
oz-o
o-zo
oz-o
o-zo
oz-o
o-zo
oz-o
```
Each `z` reads a signal in on its top/right, and outputs that signal to the bottom/left. Therefore, these columns act as registers to hold the current state for the next cycle to use. The `z`'s are offset from each other to prevent cross-talk. Again, sixteen such columns, one per byte.
* Output:
```
o/a
o/b
o/c
o/d
o/e
o/f
o/g
o/h
```
The letters `a` through `h` correspond to each of the bits of the byte that will be output, with `a` being the least signficant bit. The columns of `/`'s are switches that interact with the timing circuit to determine which byte is due to be output. Once more, sixteen columns, one per byte.
* Timing:
```
o z*
`v\'
```

```
o-------------
`z--z------z--
```
The timing circuit consists of two parts. The portion on the first layer produces a high signal on the first clock tick only (to get it all started) and connects the rest of the timing circuit to the incrementors (increments by 1 only every 16th tick, increments by 0 otherwise). The portion on the second layer controls the actual sequencing. The pattern is to increment the value and output the highest byte, then output each successive byte without incrementing anything. When all bytes have been printed, the cycle repeats. (There is a cache element `K` and an or-gate `)` that acts as a diode; these are again for efficiency only.)
> 3 votes

# Answer
## ArnoldC, 157 bytes

```
IT'S SHOWTIME
HEY CHRISTMAS TREE n
YOU SET US UP 0
STICK AROUND 1
GET TO THE CHOPPER n
GET UP 1
ENOUGH TALK
TALK TO THE HAND n
CHILL
YOU HAVE BEEN TERMINATED

```

First time trying to use ArnoldC so any improvements are welcome. I ran it here and it seemed to work even though the output stops around 1700. I believe this is a limitation of that test though, not the code.
> 3 votes

# Answer
## cQuents, 1 byte

```
$

```

Try it online!

## Explanation

```
:    Implicit mode : (infinitely print the sequence if given no input)
 $   Each item in the sequence equals the current (1-based) index

```
> 3 votes

# Answer
# Brainfuck, 1055 bytes

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

```

Too bad that Brainfuck has limited memory cell size. Actually, printing decimals and conditional statements are pain in this language. Ungolfed (or called so):

```
+>+<[

COUNTER=0

>[>[-]+<-]>[<+

>>>>>>>>>>[-]

LOOP START
    INCREMENTING <<<<<<<<<-]>>>>>>>>>>>[<<<<<<<<<<<<+>>>>>>>>>>>>-]<<<<<<<<<<<<[>[-]+<-]>[<+>>>>>>>>>[-]>[<+<<<<<<<+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>+>[-]<[>+<-]
    CHECKING CELL [-]>[<+<<<<<<<+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>>>[-]<<[<<<<<<+>>>>>>-]->>[<<<<<<<<-<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>[>>>>>>+<<<<<<[-]]<->>>>>>>[<<<<<<<->>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>>>[>>>>+<<<<<<<<<<<<<->>>>>>>>>[-]]<<<<<<<<-]<[>[-]+<-]>[<+>>>>>>>>>>>>>>+<<<<<<<<<<<<<<->-]>>>>>>>>>>>>  [<<<<<<<<<<<<<+>>>>>>>>>>>>>-]

    PRINTING
                <<<<<<<<<<<<<[>[-]+<-]>[<+

                PRINT INTEGER

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

                PRINT SPACE

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

LOOP END

CODE THAT GETS EXECUTED AT THE END (LEAVING LOOP):

>>>>>>>>>>+<<<<<<<<<<<<->-]>>>>>>>>>>>>>[<<<<<<<<<<<<<<+>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<[>[-]+<-]>[<+<->>-]<<]

```

If we would remove last piece of code it would stick two '1' at the end.
> 3 votes

# Answer
## Retina, 13 bytes

```
+\`^.*
$.(*__

```

Try it online!

### Explanation

Retina 1.0 has a new feature which lets us solve this with an algorithm that conceptually uses a unary representation of the number, but still won't run out of memory. You can test this by initialising the string to a really high number, in that case the program will count from there.

So incrementing decimal numbers isn't really something Retina does, because it only works with strings. Leaky Nun has shown a way to increment decimals, but it's comparably complicated.

What Retina *can* do with decimal integers is a) repeat a character or string **n** times and b) measure the length of a string. So the idea is to take the last integer **n**, generate a string with **n+1** characters, and measure its length, and use this as our new result. That's what the code does:

* `^.*` match the current string. We need to use `.*` instead of `.+` because the string is initially empty (the program's input), and `^` because `.*` would otherwise yield two matches on subsequent iterations.
* We substitute the match with `$.(*__`. There is some implicit syntax going on here. The `)` is closed implicitly and `*` has an implicit left-hand operand of `$&`, so this substitution is really short for `$.($&*__)`. `$&*_` generates the string of **n** underscores (when `$&` is empty, i.e. on the first iteration, it is treated as zero). The second `_` appends another underscore to that, generating a string of **n+1** characters. `$.(…)` measures the length of that string, so we end up with the next integer.
* `\` tells Retina to print the result of this substitution with a trailing linefeed.
* `+` runs the entire thing in an infinite loop (`+`-loops *can* terminate, but this one won't).

So why does this work for large integers without running out of memory? Retina's `$.(…)` computation is lazy! Whenever possible, its string argument isn't actually fully evaluated, but its length is computed directly instead. And it knows that a string formed with `n*s` is `n*len(s)` characters long. This feature gives us the convenience of a unary approach without the memory requirements. The length computation also uses an arbitrary-precision integer type, so that we can go well beyond 2128.
> 3 votes

# Answer
# Brainetry `-w 0`, 63 bytes

Golfed version:

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

```

We use `-w 0` otherwise we can only count up to `255`. If we add the `--numeric-io` flag we can also get the output as actual integers instead of codepoints.

The golfed version was adapted from the program at the end of this answer. To try this online you can

* head over to this replit link, copy&paste the code into the `btry/replit.btry` file and hit the green "Run" button;
* clone the github repo and from your terminal run `./brainetry btry/ppcg/infinite_count.btry -w 0 --numeric-io`.

Original program:

```
This program runs forever.
Not only it runs forever but it also
prints all natural numbers starting from one.
What a simple task.
I did it in just five lines of code.

```
> 3 votes

# Answer
# Rust, 99 69 bytes

```
fn main(){for i in 0..=!0u128{print!("{i}
")}print!("{}6",!0u128/10)}

```

Try it on the Rust Playground!

45 bytes if it weren't for that darn inclusive. Also, be warned, the size of the output may cause the rust playground to crash.

Edit: saved 30 bytes with some help from @The Fifth Marshal, and it now prints out 2^128-1
> 3 votes

# Answer
# Stax, 3 bytes

```
VIm

```

Run and debug it

the other Stax answer is invalid since it starts from zero. This is shorter, anyway.
> 3 votes

# Answer
# Dash, 12 bytes

```
yes|sed -n =

```

Or, alternatively:

```
yes|sed =\;d

```

Try it online!
> 3 votes

# Answer
# Add++, ~~11~~ 7 bytes

```
Dx,+1,O

```

Try it online!

-4 Thanks to @cairdcoinheringaahing
> 3 votes

# Answer
# Desmoslang Assembly, 3 Bytes

```
1O+

```

Explanation: Command gets 1 added to it, so it is 1. That is outputted, a plus is added, and it gos to the start because that is the default *to* value.
> 3 votes

# Answer
# Rockstar, 30 bytes

```
X's 1
while X
say X
let X be+1

```

Try it (Code will need to be pasted in)
> 3 votes

# Answer
## Linux X86\_64, ~~55~~ ~~54~~ 47 bytes

newer version actually completes the challenge, using 136-bit integers :)

another improvement was suggested by ceilingcat; using `pushq` and `popq` instead of `mov` to set registers

register uses:
`%rax`: syscall number (1), `%ah` is always zero
`%rdx`: byte count (=18)
`%rcx`: clobbered by syscall
`%bl`: highest 8 bits of number
`%rsp`: pointer to top of string at the start of program, becomes middle 64 bits of number
`%rbp`: lowest 64 bits of number
`%rsi`: pointer to bottom of output string
`%rdi`: file descriptor (1)

0000000000000000 <_start>:
   0:   6a 01                   push   $0x1
   2:   5f                      pop    %rdi
   3:   6a 12                   push   $0x12
   5:   5a                      pop    %rdx
   6:   6a 0a                   push   $0xa
   8:   48 89 e6                mov    %rsp,%rsi
   b:   48 83 ee 09             sub    $0x9,%rsi
   f:   31 db                   xor    %ebx,%ebx
  11:   31 ed                   xor    %ebp,%ebp
  13:   31 e4                   xor    %esp,%esp

0000000000000015 <loop>:
  15:   88 1e                   mov    %bl,(%rsi)
  17:   48 0f 38 f1 66 01       movbe  %rsp,0x1(%rsi)
  1d:   48 0f 38 f1 6e 09       movbe  %rbp,0x9(%rsi)
  23:   89 f8                   mov    %edi,%eax
  25:   0f 05                   syscall
  27:   48 01 fd                add    %rdi,%rbp
  2a:   48 11 dc                adc    %rbx,%rsp
  2d:   10 e3                   adc    %ah,%bl
  2f:   eb e4                   jmp    15 <loop>
```
</code></pre>
> 3 votes

# Answer
# Python 2 VM Opcodes, 14 bytes?

```
LOAD_CONST               0
LOAD_CONST               1
INPLACE_ADD
DUP_TOP
PRINT_ITEM
JUMP_ABSOLUTE            2

```

I'm not sure how to score this, the compiled code is 12 bytes of vm code but there are also the constants, which would be unscored. Each constant can fit in a single bit but I'll count them as 1 byte each for now.

The compiled .pyc file is 106 bytes long(!) and the raw text is 111 bytes long.

I will probably just write a short script that just takes python opcodes and runs them properly (A bit like Pyth but much more low level).

Overall, it's a very simple program. It loads `0` and `1` onto the stack and adds them. This removes both from the stack and leaves it with the result. It then duplicates the stack and prints the value of the first item, removing it from the stack. It then goes to line 2.

.pyc file (hexdump)

```
03 F3 0D 0A DB 5B 47 56 63 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 73 0C 00 00 00 64 01 00 64 02 00 37 04 47 71 03 00 28 03 00 00 00 4E 69 00 00 00 00 69 01 00 00 00 28 00 00 00 00 28 00 00 00 00 28 00 00 00 00 28 00 00 00 00 74 09 00 00 00 70 79 6B 65 5F 63 6F 64 65 52 00 00 00 00 01 00 00 00 74 00 00 00 00

```
> 2 votes

# Answer
# Befunge, 4 bytes

```
1+:.

```

This just requires an interpreter with arbitrary precision integers.
> 2 votes

# Answer
# Rotor, 7 bytes

```
1{1+}|

```

There's an unprintable again, hexdump:

```
0000000: 317b 1b31 2b7d 7c                      1{.1+}|

```

ew 7 bytes
> 2 votes

# Answer
## Kotlin, 102 bytes

```
import java.math.BigInteger.*fun main(a:Array<String>){var i=ZERO;while(1>0){i=i.add(ONE);println(i)}}

```

Based on SuperJedi224's Java answer.
> 2 votes

# Answer
## Ceylon (on JVM), ~~92~~ ~~87~~ 78 bytes

(The Big integer type `Whole` which is used here does only exist on the JVM, not when compiling for JavaScript.)

*This is the third improvement (78 bytes):*

`import ceylon.math.whole{o=one}shared void run(){loop(o)(o.plus).each(print);}`

The `loop` function is a functional version of the while-statement – it creates a stream from a starting value (one) and a function (`one.plus`), applying the function to the previous value until it returns `finished` (which our function never does, so it becomes an infinite stream). On each element, `print(...)` is applied.

An Integer version which goes only until just under 2^63 (on JVM) or 2^31 (on JS), then will wrap around to negatives (JVM) or stall (for JS), for 48 bytes:

`shared void run(){loop(1)(1.plus).each(print);}`

---

*Second version (87):*

`import ceylon.math.whole{o=one}shared void run(){{o}.cycled.scan(o)(plus).each(print);}`

That builds first an infinite stream of ones, and then creates a scanning stream, which calculates the partial sums (which then are each printed).

---

*Original version (92):*

A straight-forward `n++`-loop, with a big integer type (called `Whole` in Ceylon, but the type name is not actually used in this program, just the name of the 1):

`import ceylon.math.whole{o=one}shared void run(){variable value n=o;while(0<1){print(n++);}}`

---

This one is shorter (83), counting from 1 to 2^65536, but it doesn't actually work:

`import ceylon.math.whole{o=one,t=two}shared void run(){(o..t^t^t^t^t).each(print);}`

The problem is that the range notation `x..y` will call `span(x,y)`, which will call `x.offset(y)` to get the offset between them, and this method is defined to return an Integer – which will overflow here, as the difference is much too large to fit into an Integer (which was the whole point of using Whole here).
> 2 votes

# Answer
# GolfScript, 9 bytes

```
1{.p).}do

```

---

```
1      # push 1
{      # loop
  .p   # duplicate, output
  ).   # increment, duplicate
}do    # while non-zero

```
> 2 votes

# Answer
## Win32 x86 Machine Code (PE32 Executable), 933 bytes

This implements a virtual datatype using a lookup table (aka array). The challenge requests support for 2^128 which is 39 decimal digits. By accident, this solution supports 38+N digit numbers, where N is the width of `word` (i.e. two bytes). After that, the behavior is undefined. You might notice a whole lot of *too simple* or *too redundant* code in the assembly below, but this is intended, because the compression algorithm optimizes this.

For example,

```
mov EAX, 0
mov dword [@@DATA+164], EAX

```

is two bytes shorter than

```
mov dword [@@DATA+164], 0

```

Also: I though of using the C runtime library (MSVCRT) to convert numbers to strings, but this is a DIY approach, so this solution contains it's own method of converting numbers to strings. Without this, the byte count would be 800-ish. Keep in mind that the PE header and decompression take up about 697 bytes :). Also, this is Win32 code (fully debugged, shouldn't produce any errors and spawns a clean console context to run in), it is not "just using Interrupts", so this contains it's own string printing method.

I've used MEW11SE to crunch the executable, because MEW's LZMA-E9 routine beats UPX, mpress, kkrunchy etc. 9.9 out of 10 times by *far*. I *could* have used nasm and crinkler, but I hate both of them. The assembly below is fasm.

Here's a binary (compressed) \- Here's another binary (uncompressed)

<sub>**Disclaimer:** The compressed binary will probably set your PC on fire if you happen to have an AV installed.</sub>

**Assembly**

```
; minxomat

; Link as CUI subsystem
format PE CONSOLE
section ".code" code readable executable

; Convert single digit unsigned word to null-terminated char
makestr:
  push EBP
  mov EBP, ESP
  sub ESP, 12
  mov EAX, @@TEXT+0
  mov dword [EBP-4], EAX
  mov EAX, @@TEXT+3
  mov dword [EBP-8], EAX
  mov EAX, 0
  mov dword [EBP-12], EAX
  mov EAX, dword [EBP+8]
  add EAX, dword [EBP-8]
  mov AL, byte [EAX+0]
  mov EBX, dword [EBP-12]
  add EBX, dword [EBP-4]
  mov byte [EBX+0], AL
  mov AL, 0
  push EAX
  mov EAX, dword [EBP-12]
  add EAX, 1
  add EAX, dword [EBP-4]
  pop EBX
  mov byte [EAX+0], BL
  mov EAX, dword [EBP-4]
  mov ESP, EBP
  pop EBP
ret 4

; Ouput null-term'ed string at this pointer to console
printme:
  push EBP
  mov EBP, ESP
  sub ESP, 4
  mov EAX, 0
  mov dword [EBP-4], EAX

  addone:
    mov EAX, dword [EBP-4]
    add EAX, dword [EBP+8]
    mov AL, byte [EAX+0]
    cmp AL, 0
    je fwd
    inc dword [EBP-4]
    jmp addone

  fwd:
    xor EAX, EAX
    push EAX
    lea EAX, [EBP-4]
    push EAX
    mov EAX, dword [EBP-4]
    push EAX
    mov EAX, dword [EBP+8]
    push EAX
    mov EAX, 4294967285
    push EAX
    call [@10024]
    push EAX
    call [@10025]
    mov ESP, EBP
    pop EBP
ret 4

; Entry point.
main:
  ; Print initial zero
  push EBP
  mov EBP, ESP
  mov EAX, @@TEXT+14
  push EAX
  call printme

  @10007:
    mov EAX, 1
    mov dword [@@DATA+160], EAX
    mov dword [@@DATA+164], EAX
    mov EAX, 38
    mov dword [@@DATA+156], EAX

  @10008:
    mov EAX, dword [@@DATA+156]
    cmp EAX, 0
    jle @10016

  @10009:
    mov EAX, dword [@@DATA+156]
    shl EAX, 2
    mov EAX, dword [@@DATA+EAX+0]
    mov EBX, dword [@@DATA+160]
    add EAX, EBX
    mov EBX, dword [@@DATA+156]
    shl EBX, 2
    mov dword [@@DATA+EBX+0], EAX
    mov EAX, dword [@@DATA+156]
    shl EAX, 2
    mov EAX, dword [@@DATA+EAX+0]
    cmp EAX, 9
    jle @10011

  @10010:
    mov EAX, 0
    mov EBX, dword [@@DATA+156]
    shl EBX, 2
    mov dword [@@DATA+EBX+0], EAX
    mov EAX, 1
    mov dword [@@DATA+160], EAX
    jmp @10014

  @10011:
    mov EAX, 0
    mov dword [@@DATA+160], EAX

  @10014:
    dec dword [@@DATA+156]
    jmp @10008

  @10016:
    mov EAX, dword [@@DATA+156]
    cmp EAX, 39
    jge @10022

  @10017:
    mov EAX, dword [@@DATA+156]
    shl EAX, 2
    mov EAX, dword [@@DATA+EAX+0]
    cmp EAX, 0
    jg @10019

  @10018:
    mov EAX, dword [@@DATA+164]
    cmp EAX, 0
    jne @10021

  @10019:
    mov EAX, dword [@@DATA+156]
    shl EAX, 2
    mov EAX, dword [@@DATA+EAX+0]
    push EAX
    call makestr
    push EAX
    call printme
    mov EAX, 0
    mov dword [@@DATA+164], EAX

  @10021:
    inc dword [@@DATA+156]
    jmp @10016

  @10022:
    mov EAX, @@TEXT+17
    push EAX
    call printme
    jmp @10007

section ".data" data readable writeable

@@TEXT db "00", 0
       db "0123456789", 0
       db "0", 10, 0
       db 10, 0

@@DATA rb 168

section ".idata" import data readable writeable

dd 0, 0, 0, RVA @10026, RVA @10024
dd 0, 0, 0, 0, 0

@10024 dd RVA @10027
@10025 dd RVA @10028
       dd 0

@10026: db "KERNEL32.DLL", 0

@10027: dw 0
        db "GetStdHandle", 0
@10028: dw 0
        db "WriteFile", 0

section ".reloc" fixups data readable discardable
entry main

```

**Hexdump**

```
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  4D 5A 6B 65 72 6E 65 6C 33 32 2E 64 6C 6C 00 00  MZkernel32.dll..
00000010  50 45 00 00 4C 01 02 00 00 00 00 00 00 00 00 00  PE..L...........
00000020  00 00 00 00 E0 00 0F 01 0B 01 00 00 00 02 00 00  ....à...........
00000030  00 00 00 00 00 00 00 00 95 51 00 00 10 00 00 00  ........•Q......
00000040  00 10 00 00 00 00 40 00 00 10 00 00 00 02 00 00  ......@.........
00000050  04 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00  ................
00000060  00 60 00 00 00 02 00 00 00 00 00 00 03 00 00 00  .`..............
00000070  00 10 00 00 00 10 00 00 00 00 01 00 00 00 00 00  ................
00000080  00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00  ................
00000090  91 51 00 00 14 00 00 00 00 00 00 00 00 00 00 00  ‘Q..............
000000A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000E0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000100  00 00 00 00 00 00 00 00 4D 45 57 00 46 12 D2 C3  ........MEW.F.ÒÃ
00000110  00 40 00 00 00 10 00 00 00 00 00 00 00 00 00 00  .@..............
00000120  00 00 00 00 00 00 00 00 00 00 00 00 E0 00 00 C0  ............à..À
00000130  02 D2 75 DB 8A 16 EB D4 00 10 00 00 00 50 00 00  .ÒuÛŠ.ëÔ.....P..
00000140  A5 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00  ¥...............
00000150  00 00 00 00 E0 00 00 C0 BE 1C 50 40 00 8B DE AD  ....à..À¾.P@.‹Þ.
00000160  AD 50 AD 97 B2 80 A4 B6 80 FF 13 73 F9 33 C9 FF  .P.—²€¤¶€ÿ.sù3Éÿ
00000170  13 73 16 33 C0 FF 13 73 21 B6 80 41 B0 10 FF 13  .s.3Àÿ.s!¶€A°.ÿ.
00000180  12 C0 73 FA 75 3E AA EB E0 E8 72 4E 00 00 02 F6  .Àsúu>ªëàèrN...ö
00000190  83 D9 01 75 0E FF 53 FC EB 26 AC D1 E8 74 2F 13  ƒÙ.u.ÿSüë&¬Ñèt/.
000001A0  C9 EB 1A 91 48 C1 E0 08 AC FF 53 FC 3D 00 7D 00  Éë.‘HÁà.¬ÿSü=.}.
000001B0  00 73 0A 80 FC 05 73 06 83 F8 7F 77 02 41 41 95  .s.€ü.s.ƒø.w.AA•
000001C0  8B C5 B6 00 56 8B F7 2B F0 F3 A4 5E EB 9B AD 85  ‹Å¶.V‹÷+ðó¤^ë›.…
000001D0  C0 75 90 AD 96 AD 97 56 AC 3C 00 75 FB FF 53 F0  Àu..–.—V¬<.uûÿSð
000001E0  95 56 AD 0F C8 40 59 74 EC 79 07 AC 3C 00 75 FB  •V..È@Ytìy.¬<.uû
000001F0  91 40 50 55 FF 53 F4 AB 75 E7 C3 00 00 00 00 00  ‘@PUÿSô«uçÃ.....
00000200  33 C9 41 FF 13 13 C9 FF 13 72 F8 C3 66 51 00 00  3ÉAÿ..Éÿ.røÃfQ..
00000210  73 51 00 00 00 00 00 00 00 50 40 00 30 01 40 00  sQ.......P@.0.@.
00000220  8D 10 40 00 00 10 40 00 55 03 89 E5 83 EC 0C B8  ..@...@.U.‰åƒì.¸
00000230  81 20 40 C3 D1 45 FC E1 03 53 08 F8 70 20 E1 11  . @ÃÑEüá.S.øp á.
00000240  F4 8B EC 08 03 CE 1C 8A 1E 1E 5D FC 73 3E FC 88  ô‹ì..Î.Š..]üs>üˆ
00000250  38 B0 37 50 26 B1 83 C0 01 BF 2C 3F 5B B7 18 18  8°7P&±ƒÀ.¿,?[·..
00000260  60 89 EC 5D C2 70 04 AB 46 BD 33 36 FC 66 2F 40  `‰ì]Âp.«F½36üf/@
00000270  08 6C 70 3C 18 74 05 FF 18 EB EF 0D 31 C0 50 8D  .lp<.t.ÿ.ëï.1ÀP.
00000280  10 A2 76 04 7C 08 1B B8 F5 FF 02 F7 41 15 28 30  .¢v.|..¸õÿ.÷A.(0
00000290  B2 DA 0F 2C 28 47 E2 B8 0E A1 82 50 E8 AB BD 45  ²Ú.,(Gâ¸.¡‚Pè«½E
000002A0  B1 01 9F A3 B3 BA 21 B7 B7 0B F5 26 08 0F AF 94  ±.Ÿ£³º!··.õ&..¯”
000002B0  A1 05 1C 83 F8 0A 7E 6A 0A 80 C1 E0 02 8B 80 13  ¡..ƒø.~j.€Áà.‹€.
000002C0  DD 13 94 1D 2D 1A 01 D8 10 20 17 E3 02 89 83 84  Ý.”.-..Ø. .ã.‰ƒ„
000002D0  8D 25 31 70 09 7E DE 9A AA 36 27 85 6F 0D EB 0A  .%1p.~Þšª6'…o.ë.
000002E0  40 18 0C FF 50 0D 25 EB 53 8C 74 0A 27 7D 49 4F  @..ÿP.%ëSŒt.'}IO
000002F0  F3 80 7F 0A A1 52 B7 0A 15 75 24 1D A4 04 C8 9D  ó€..¡R·..u$.¤.È.
00000300  FE 19 0C DD 14 22 53 B7 11 05 0C AD 2A B8 11 23  þ..Ý."S·....*¸.#
00000310  44 C0 E9 55 10 F0 80 00 00 20 40 00 30 E3 C3 98  DÀéU.ð€.. @.0ãÃ˜
00000320  31 32 33 03 34 35 36 37 38 39 38 16 0A 72 C0 00  123.4567898..rÀ.
00000330  D1 4F 40 00 28 38 30 40 07 4B 45 52 4E 30 4C 33  ÑO@.(80@.KERN0L3
00000340  32 2E 75 44 ED C0 80 47 1C 65 74 53 83 64 48 61  2.uDíÀ€G.etSƒdHa
00000350  6E A3 6C D6 1C 1F 57 72 69 FB BA 46 51 0B 80 00  n£lÖ..WriûºFQ.€.
00000360  00 00 00 00 D1 4F 40 00 4C 6F 61 64 4C 69 62 72  ....ÑO@.LoadLibr
00000370  61 72 79 41 00 47 65 74 50 72 6F 63 41 64 64 72  aryA.GetProcAddr
00000380  65 73 73 00 00 00 00 00 00 00 00 00 00 00 00 00  ess.............
00000390  00 0C 50 00 00 E9 BE AF FF FF 00 00 00 02 00 00  ..P..é¾¯ÿÿ......
000003A0  00 0C 50 00 00                                   ..P..

```
> 2 votes

# Answer
# C + gcc extensions, 77 bytes

```
char c[]={[0 ...49]=48};main(a){for(;;puts(c))for(a=49;++c[a]>57;c[a--]=48);}

```
> 2 votes

# Answer
# Prolog (SWI), 35 bytes

```
p:-between(1,inf,N),writeln(N),1=2.

```

**Edit:** Saved 6 bytes thanks to @Fatalize
> 2 votes

# Answer
## Common Lisp, 30 bytes

```
(do((i 0))(())(print(incf i)))

```

or

```
(do((x 0(1+ x)))(())(print x))

```

This should get to 2<sup>128</sup> without a problem, since Common Lisp has bignums. E.g.:

```
CL-USER> (print (expt 2 128))
; 340282366920938463463374607431768211456

```
> 2 votes

# Answer
# JacobFck, 10 Bytes

This is so short!

```
^1:m^1+>_m

```

See expanded and commented here.
> 2 votes

# Answer
## JavaScript, 80 bytes

```
r=t=>{t=a.pop()||0;if(++t>9){r();t=0}a.push(t)};for(a=[1];;r())alert(a.join(''))

```

To test at 2^128 in console, for 1000 cycles;

```
r=t=>{t=a.pop()||0;if(++t>9){r();t=0}a.push(t)};for(x=1,a=[3,4,0,2,8,2,3,6,6,9,2,0,9,3,8,4,6,3,4,6,3,3,7,4,6,0,7,4,3,1,7,6,8,2,1,1,4,5,6];x<=1000;r(),x++)console.log(a.join(''))

```

And to test all 9s for 2 cycles;

```
r=t=>{t=a.pop()||0;if(++t>9){r();t=0}a.push(t)};for(x=1,a=[9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9];x<=2;r(),x++)console.log(a.join(''))

```

My original idea was to actually use objects, but the array idea turned out to be super small. Mine should be the smallest JavaScript one at the moment

Object Oriented: 107 bytes

```
function d(p){var x=0,s="";this.o=q=>{return++x>9&&(x=0,p=p||new d,s=p.o()),s+x}}for(c=new d;;)alert(c.o())

```
> 2 votes

# Answer
## Aubergine, 61 bytes

```
=A1+i1
=bi-b1-b1:Ba+b1=oB+A1=aA-a1-ii               =oB-a1-ii

```

Try It Online! but be sure to hit Kill quickly so as to not crash your browser!

Prints in unary, one number per line. The Python interpreter, at least, will ensure it runs forever. (Make sure it is EXACTLY 61 bytes if you run it: adjust the number of spaces in the middle if it is not.)

How it works:

```
=A1                      SET MEM[0]=1 (this will be the counter).
   +i1                   JUMP 1 byte forward. (Skips the newline.)
   =bi-b1-b1             SET b=5 (points to the '1'=49 on the prev line)
   :Ba                   JUMP to 49 if a>0 (Will land on the other side of the spaces)
   +b1                   SET b=6 (now points to the newline)
   =oB                   OUTPUT what b points to (the newline)
   +A1                   INC MEM[0]
   =aA                   COPY MEM[0] INTO a (but we haven't printed the prev num yet!)
   -a1                   DEC a (Now a=the prev num)
   -ii                   JUMP to the beginning
                        (The sixth instruction jumps here when a>0:)
      =oB                OUTPUT contents of b ('1')
      -a1                DEC a
      -ii                JUMP to the beginning

```
> 2 votes

# Answer
# awk , 65 bytes

```
BEGIN{for(;;){for(;++$++i>9;)$i=0;for(i=NF+1;i;)printf--i?$i:RS}}

```

Counts up "forever" using the fields as an array. I made sure this works with the standard Ubuntu awk (mawk).
> 2 votes

# Answer
# GNU sed, 36

(score includes +1 for requiring the `-r` flag)

```
:=
p
s/$/1/
:
s/(^|_)1{10}/1_/
t
b=

```

This counts in unary-coded decimal, and must be primed with the starting number in UCD (e.g. 1) on stdin:

```
$ ./63834.sed <<<1 | head -n 30
1
11
111
1111
11111
111111
1111111
11111111
111111111
1_
1_1
1_11
1_111
1_1111
1_11111
1_111111
1_1111111
1_11111111
1_111111111
11_
11_1
11_11
11_111
11_1111
11_11111
11_111111
11_1111111
11_11111111
11_111111111
111_

```

Here's a version that takes input and output in decimal (now using `x` as the digit and `0` as separator):

```
#!/bin/sed -rf

s/[1-9]/0&/g
s/[5-9]/4&/g
y/8/4/
s/9/4&/g
s/4/22/g
s/[37]/2x/g
s/[26]/xx/g
s/[1-9]/x/g

:=
h
s/0x/-x/g
s/xx/2/g
y/x/1/
s/22/4/g
s/44/8/g
s/81/9/g
s/42/6/g
s/21/3/g
s/61/7/g
s/41/5/g
s/-//g
p

g
s/$/x/
:
s/(^|0)x{10}/x0/
t
b=

```

This is the same code, but with UCD/decimal conversion going on. This makes it easier to make it start at 2^128:

```
$ bc <<<'2 ^ 128' | ./63834.sed | head -n 10
340282366920938463463374607431768211456
340282366920938463463374607431768211457
340282366920938463463374607431768211458
340282366920938463463374607431768211459
340282366920938463463374607431768211460
340282366920938463463374607431768211461
340282366920938463463374607431768211462
340282366920938463463374607431768211463
340282366920938463463374607431768211464
340282366920938463463374607431768211465

```
> 2 votes

# Answer
# GNU coreutils, 16 bytes

```
seq `bc<<<2^225`

```

GNU `seq` happily handles values over 2^128. 2^225 is the largest value `bc` will print without wrapping (it assumes 80-character width), so that's what I've used here.

Here's the proof that we can handle values higher than 2^227 (`dc` wraps one char later than `bc`):

```
$ seq `dc -e2d227^p` `dc -e2d227^10+p`
215679573337205118357336120696157045389097155380324579848828881993728
215679573337205118357336120696157045389097155380324579848828881993729
215679573337205118357336120696157045389097155380324579848828881993730
215679573337205118357336120696157045389097155380324579848828881993731
215679573337205118357336120696157045389097155380324579848828881993732
215679573337205118357336120696157045389097155380324579848828881993733
215679573337205118357336120696157045389097155380324579848828881993734
215679573337205118357336120696157045389097155380324579848828881993735
215679573337205118357336120696157045389097155380324579848828881993736
215679573337205118357336120696157045389097155380324579848828881993737
215679573337205118357336120696157045389097155380324579848828881993738

```
> 2 votes

# Answer
# Bash, ~~31~~, ~~47~~ 46 bytes

```
for((i=0;;i=`echo "$i+1"|bc`));do echo $i;done

```

I'm a bash novice but I've been wanting to use bash in code golf for a while. There must be a better way than this though, I'm sure it can be beaten!

I believe this fixes the issues.

```
> a=$((2**128))    # Too big
> echo $a
0

> a=$(echo "2^128"|bc)    # Works!
> echo $a
340282366920938463463374607431768211456

```

So all expressions are piped through bc to make sure it can handle them. It returns a string representation to the variable, which can then be printed. Open to golfing, maybe I can use bc better or maybe I can do code substitution better.
> 2 votes

# Answer
## F#, ~~50~~ ~~49~~ 36 bytes

```
let rec(!)d=printfn"%O"d;!(d+1I)
!1I

```

BigIntegers made this pretty easy, although I didn't know I could access them this easily in F#. =)

Update: It's even easier! You don't have to use `bigint 1` when you can use `1I`! =D

Without using BigInteger, I was able to get it down to 153 bytes. Note that this uses a base 256 representation, with a space between the digits and a newline between the numbers:

```
let rec i=function|255::[]->0::[1]|255::r->0::(i r)|n::r->(n+1)::r
let rec f d=printfn"%s"(List.rev d|>Seq.fold(fun s c->s+" "+(string c))"");f(i d)
f[0]

```

The function revolves around treating a list of byte-sized integers as a big number. The recursive function `i` increments that number (carrying changes up the digits by calling itself if needed), while the recursive function `f` prints the list as a number, increments the list, then calls itself.

Overall, a pretty fun problem. Thanks! =)

Saved a byte thanks to a trick I saw @Lynn do: name your functions with a character to call them more concisely. Thanks! =)
> 2 votes

# Answer
# Retina, 73 bytes

No unary! Taken mostly from this SO answer. As noted by Martin, this code doesn't work in the newest version of Retina. Change `(;`(\d+)` to `{;`(\d+)` for it to work.

```
:`^$
1
(;`(\d+)
0$1~01234567890
:`^0(?!9*~)|(\d)(?=9*~\d*?\1(\d))|~\d*
$2

```

**Try it online**

It is much shorter if it was able use unary.
> 2 votes

# Answer
## Hoon, 25 bytes

```
$:|=(a/@ ~&(a $(a +(a))))

```

Just repeatedly prints the sample of the gate, and recurses with a = a+1. Hoon's native number is a bignum backed by gmp, so it should be able to count up to 2^128 just fine. Simply paste that code into the Hoon repl (:dojo) in Urbit to run it.

It does abuse the feature of Hoon that gates are instantiated with a default sample, though. Pulling the $ arm for the gate runs it immediately, with the sample set to that default instead of having to call it with (f 0). It's actually smaller to do it this way instead of `=+(a=0 |-(~&(a $(a +(a)))))`
> 2 votes

# Answer
## Jelly, 3 bytes

```
Ṅ‘ß

```

Try it online! Be careful though, since this is a *long* output after all!

```
Ṅ            Print with newline
‘            Increment
ß            Call current link (function) again

```

Since there are no input arguments, the initial argument is taken to be 0.

---

Previous version:

```
Ṅ‘$ÐL

```

Try it online!

```
Ṅ            Print with newline
‘            Increment
$            Combine previous two
ÐL           Loop until

```
> 2 votes

# Answer
## Perl, ~~20~~ 19 bytes

```
perl -E 's//0/;say while++$_'

```

Magic string increment makes this work without bigint
> 2 votes

# Answer
# Retina, 20 bytes

```
<empty line>
39$*0
+:T`9d`d`.9*$

```

Can count to `10**39-1`.

Try it online!

### Without leading zeroes (can count beyond 10\**39): 23 bytes

```
+:(T`9d`d`.9*$
^0*$
1$&

```

Try it online!

### 13 bytes if pre-initialized with input as 39 "0"s:

```
+:T`9d`d`.9*$

```

Try it online!
> 2 votes

# Answer
# UGL, 14 bytes

```
cul$oucuuu$*O:

```

Try it online!

## How it works:

```
cul$oucuuu$*O:
cu              #i=1
  l          :  #while i:
   $o           #    print(i)
     u          #    i++
      cuuu$*O   #    print(chr(9))

```
> 2 votes

# Answer
# Oracle SQL, 42 Bytes

```
select level from t connect by level=level

```
> 2 votes

# Answer
# Braingolf, 10 bytes

```
1[!_2+# @]

```

Try it online!
> 2 votes

# Answer
# APL (Dyalog), 9 bytes

```
{∇1+⎕←⍵}1

```

Try it online!
> 2 votes

# Answer
# Aceto, 5 bytes

```
IkpnO

```

### Explanation:

Aceto follows a Hilbert Curve on a square program. If the program is not square, spaces are added to the top and right. (spaces do nothing) I

```
I - pops a value, increments it, and pushes it back on
k - makes the stack 'sticky', meaning that when popping a number, instead of removing the value it copies it
p - prints the top value
n - prints a newline
O - Returns the program back to the beginning

```

Also, can anyone explain to me why 'k' is needed? Shouldn't 'I' do the job just fine? When I omit 'k', it prints out lines and lines of '1's.

Try it online!
> 2 votes

# Answer
# Alumin, 6 bytes

```
hqhanp

```

Alumin is a new language, made by @Conor O'Brien.

Explanation:

```
hqhanp
h      # Push 1
 q   p # Begin/end loop
  ha   # Push 1, add top two stack elements together (increments top)
    n  # Prints the top of stack as a number

```
> 2 votes

# Answer
## Wumpus, 5 bytes

```
)=O
N

```

Try it online!

### Explanation

The program runs `)=ON` in an infinite loop (see the "cat" answer for why that is).

```
)   Increment the top of the stack. Initially, this turns an implicit zero
    into an explicit one.
=   Duplicate.
O   Print as a decimal integer.
N   Print a linefeed.

```
> 2 votes

# Answer
# Brachylog, 4 bytes

```
ℕ₁ẉᶠ

```

## Explanation

```
ℕ₁      --  Get a integer which is at least 1
  ẉᶠ    --      and print all possible values (ordered from 1 to inf)

```

Try it online!
> 2 votes

# Answer
# Deoxyribose, ~~35~~ 29 bytes

`ATGCCAGAAAAACATAACGGTTTAAATCC`

**Explanation:**

```
ATG
CCA     (*) Divide (null/null yields 1)
  GAA     Dupe
  AAA     Pop
  CAT     Push
    AAC     1
  GGT     Move
  TTA     Plus
AAT     Loop
  CC      *

```

I feel like this can get shorter.

**Edit:** Saved 6 bytes by making creative use of division of two empty stacks.
> 2 votes

# Answer
# JavaScript (ES6), ~~22~~ 21 bytes

```
for(i=0n;;)alert(++i)

```

This uses BigInts, which can go to high integers without losing accuracy. Per earlier submissions, I'm assuming that using `alert`, with its automatic separation between popups, means that outputting an extra character is not necessary.
> 2 votes

# Answer
# 05AB1E, 3 bytes

```
∞€,

```

Try it online!

tio.run truncates the input, but in theory this would count forever. Also on tio.run, there's a `[` at the beginning which I don't know how to get rid of.

## Explanation

```
∞    # push infinite list ([1, 2, …, ∞])
 €   # pop a; apply next command for each in a
  ,  # pop a; print(a) (with newline)

```
> 2 votes

# Answer
# CJam, 7 bytes

```
X{_p)}h

```

Really feels like there should be a way to take off one or two bytes, but oh well.

```
X           Initialize the stack with 1
 {          Begin loop
  _p        Duplicate top of stack and print
    )       Add 1
     }h     Loop while top of stack is truthy (non-consuming)

```
> 2 votes

# Answer
# Arn, 4 bytes

```
ëçJx

```

# Explanation

Unpacked: `[1{+1` A sequence in arn is defined within `[..]`. A sequence is made up of hard-coded digits, a block determining how future entries are calculated, and (possibly) an array pointing towards the length of the sequence.

In this case, it is simply defining a sequence where the first entry is `1`, and every future entry is `1` higher. Because of Arn's implied closings, the final `}]` can be removed. Arn uses BigInts.
> 2 votes

# Answer
# ABC, 4 bytes

```
acal

```

`a` increments the accumulator at start, `c` outputs it, then `a` increments again, and `l` loops to beginning.

Try it online!
> 2 votes

# Answer
# Charcoal, ~~16~~ 14 bytes

```
≔¹ξＷ¹«ＰＩξ≦⊕ξＲ⁰

```

Try it online! Link is to verbose version of code.

-2 bytes thanks to Neil in the chat

I think the The output with trailing separator is valid.

## Explanation:

```
≔¹ξ

```

Assign 1 to X

```
Ｗ¹«

```

Start Infinite Loop

```
ＰＩξ

```

Print X, In decimal to avoid memory error

```
≦⊕ξ

```

Increment X

```
Ｒ⁰

```

Refresh
> 2 votes

# Answer
# Seed, 10 bytes

```
4 28895602

```

Try it online!
> 2 votes

# Answer
# Unix coreutils `jot`, 7 bytes

```
jot 0 1

```

Try it online!
> 2 votes

# Answer
# (,), ~~23~~ 21 Chars or 4.16 Bytes

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

```

TIO
> 2 votes

# Answer
# PHP, 31 bytes

```
<?for(;;)echo$i=bcadd($i,1),~õ;

```

I assume default settings, as they are without an .ini (you may disable your local .ini with the `-n` option).

---

**Sample Usage**

```
$ php -n countup.php

```
> 1 votes

# Answer
# Julia, 35 bytes

```
i=big(0);while 1>0 println(i+=1)end

```

This uses Julia's GMP-based arbitrary precision integers.
> 1 votes

# Answer
## VB.NET, ~~113~~ 99 bytes

Well, pretty straightforward for .NET Framework 4. Needs a reference to `System.Numeric.dll`:

```
Module m
Sub Main
Dim i As Numerics.BigInteger
do
i+=1
Console.WriteLine(i)
loop
end sub
End Module

```

Not exactly original, but hey, even not that much longer than the C# answer ;-)

Thanks Berend for making me dig a little deeper into the compilation process, saving 14 bytes in the process.
> 1 votes

# Answer
# C++, 104 bytes

```
#include<cstdio>
int a,c[50]={-38};int main(){for(a=49;++c[a]>9;c[a--]=0);for(b:c)putchar(b+48);main();}

```

A translation of my C answer. This uses a terse range-based for loop, which is a C++1z feature briefly added to some compilers but later voted out of C++17. `clang++ 3.5.2` compiles my code fine, but I'm not sure if it counts as "C++". I can change it to `for(int b:c)` if it's deemed invalid.
> 1 votes

# Answer
# Go, ~~104~~ ~~99~~ 95 bytes

```
package main
import."math/big"
func main(){a:=&Int{}
for{println(a.Add(a,NewInt(1)).String())}}

```

Not terribly golfed yet, I might take the time to refine it later.

Note that this will not run on the playground since it runs forever.
> 1 votes

# Answer
# Python 2, 24 bytes

Same method as the Python 3 answer.

```
i=1
while 1:print i;i+=1

```
> 1 votes

# Answer
## Matlab, 95 bytes

```
   for n=1:128;sym(sym(2^n)-1),for i=1:n sym(2^n+sym(sum(power(2,nchoosek(1:n,i)-1),2)-1)),end,end

```

---

* This program can count over 2^128 just try with these parameters if you have doubts.

```
for n=200:200;sym(sym(2^n)-1),for i=1:n sym(2^n+sym(sum(power(2,nchoosek(1:n,i)-1),2)-1)),end,end

```
* This can be golfed more if I could figure out a way to combine two loops in one single executive loop, thats because the code skips one integer per 2^k the case of one loop.
> 1 votes

# Answer
## UberGenes, ~~33~~ 30 bytes

I'm giving two versions here, just to demonstrate the lang. Integers and memory in UberGenes are bounded only by computer memory, so both versions meet the "forever" requirement. This first one is for score:

```
=ii+a1=pa=q5=bi-p1=oQ:bp=oI=i0

```

It prints numbers in unary separated by '=' characters. Explanation (indents indicate a loop start):

```
=ii                                  NOP
   +a1                               INC a (initially 0)
   =pa                               COPY a INTO p
   =q5                               SET q=5 so it points to '1'
   =bi                               SET b to this location (15)
      -p1                            DEC p
      =oQ                            OUTPUT '1'
      :bp                            JUMP to b's location while p>0
   =oI                               OUTPUT the contents of this location ('=')
   =i0                               JUMP to the beginning of main loop.

```

The second version is more interesting (66 bytes):

```
=ii+a1=l0-l2=pa=z8*z6=t5*t2=bi=qp%qt+qz=Lq-l1/pt:bp=bi=oL+l1:bL=i0

```

It prints the numbers in decimal separated by NULLs.

How it works (indents indicate a loop start):

```
=ii                                  NOP
   +a1                               INC a (initially 0)
   =l0-l2                            SET l=-2
   =pa                               COPY a INTO p
   =z8*z6                            SET z=48 ('0')
   =t5*t2                            SET t=10
   =bi                               SET b to this location (27)
      =qp                            COPY p INTO q
      %qt                            MOD q BY 10
      +qz                            ADD 48 to q (turn it into character)
      =Lq                            PUT q AT MEM[l]
      -l1                            DEC l
      /pt                            DIVIDE p by 10
      :bp                            JUMP back to b's location if p>0
   =bi                               SET b to this location (51)
      =oL                            OUTPUT the character in MEM[l]
      +l1                            INC l
      :bL                            JUMP back to b's location if MEM[l]>0
   =i0                               JUMP back to beginning of main loop

```
> 1 votes

# Answer
# Mouse-2002, 17 bytes

```
aa:(a.!"!"a.b+a:)

```

It seems there's a flaw in the interpreter which messes up using the stack for while loops, I dunno, so we use a variable instead.
> 1 votes

# Answer
# Forth, ~~67~~ 71 bytes

Forth doesn't have a builtin word for exponentiation, so we need to define one, because loops in Forth, which are frowned upon, need clearly defined bounds.

According to the language's original spec, this will segfault or run out of memory when it gets to 32,767 but that's not the case for mighty `gforth`! Instead, this runs out of memory whenever it's unable to continue storing numbers, as the stack's allocation is not dynamic like the heap's is, and `do`'s operands (the limit and index) are put on the heap, not the stack, else they would interfere with the stack.

Essentially, it will stop at the same point every other answer here will.

The loop construct normally looks like `10 0 do` ... `loop` where 10 is the *limit* and 0 is the *index*, i.e starting point.

In this example, we need to add one to the upper bound before counting there.

Edit: apparently `do` is a "compile-only" word, and it can only be found inside macro definitions.

```
: p over swap 1 ?do over * loop nip ;
: c 2 128 p 1 + 0 do i . loop ;
c

```
> 1 votes

# Answer
# , 9 bytes

```
0C:' gghX

```

Simple three-link program. `0C` initializes the stack with a 0 and moves to the next link, `:` duplicates the current value `'` pushes a space for a separator, `gg` prints twice, and `h` increments it. `X` is an unconditional wrap-around, so we go to the beginning of the link. Try it here!
> 1 votes

# Answer
# D, ~~56~~ 57 bytes

```
import std.stdio;void main(){for(real i;;writeln(i++)){}}

```

~~Pretty straightforward.~~ D != Python.

The shortest while-loop version I can think of is longer, at 59 bytes:

```
import std.stdio;void main(){real i;while(++i){writeln(i);}}

```
> 1 votes

# Answer
# ForceLang, 35 bytes

```
label l
io.writeln set a 1+a
goto l

```

ForceLang uses BigRationals as the default number type.

Also, in the latest revision, `1+nil` yields 1, which is what allows this version to work (previously it would have yielded the string `"1<nil>"`.)

`nil+1`, however, still triggers a null pointer exception.
> 1 votes

# Answer
# APL (Dyalog APL), ~~13~~ ~~14~~ 10 bytes

```
{1+⎕←⍵}⍣≡0

```

Try it online!
> 1 votes

# Answer
# Molecule, 7 bytes (6 chars)

```
0(1+~)

```

Explanation:

```
0(1+~)
0      add 0 to stack
 (     begin while statement
  1+   add one
    ~  print
     ) goto the beginning of while statement.

```
> 1 votes

# Answer
# Perl 6, 13 bytes

```
.say for 0..*

```

Perl 6 has lazy/infinite arrays, so I'm abusing that to create an infinite range. This will never run out of memory.

Note: as explained in the Perl 6 docs, `(0..*)>>.say` would print out of order.
> 1 votes

# Answer
## AutoHotKey, 34 bytes

*Golfed and Ungolfed is the same.*

### Golfed:

```
c:=0
Loop {
    c:=c+1
    tooltip %c%
}

```

### Ungolfed:

```
c:=0
Loop {
    c:=c+1
    tooltip %c%
}

```
> 1 votes

# Answer
# JavaScript (ES6), ~~74~~ 69 chars

Output is binary.

```
for(r="1";;r=r.replace(/(?:(^1)|.)(?=1*$)/g,(m,f)=>f?10:m^1))alert(r)

```
> 1 votes

# Answer
## Pyke, ~~5~~ 3 bytes

```
ohr

```

Try it here!
> 1 votes

# Answer
# Node.js + Big.js, 63 bytes

Use `npm install big.js` before running.

```
c=new require("big.js")(0);while(1)console.log(c+""),c=c.add(1)

```

Simple enough, and has arbitrary precision. Each number is seperated by newlines.
> 1 votes

# Answer
# Tellurium, 6 bytes

```
[i|+^]

```

Pretty simple.

The program adds one to the selected cell (`+`), and then outputs it (`^`). Using `i` as a loop's value makes it run the code forever.
> 1 votes

# Answer
## Lua, 27 Bytes

```
i=1::a::i=i+1print(i)goto a

```
> 1 votes

# Answer
# Befunge - 4 bytes

I’m surprised there isn’t already a Befunge answer on here.

```
1+:.

```
> 1 votes

# Answer
# Billiards, 15 bytes/11 characters

Inspired by PhiNotPi's Challenge

```
1/\
 ↥↑
\^/

```

Explanation: `1` summons a ball with value `1`. It falls onto the `\`, which deflects it into the `^`.

Then, it levitates from the `^`, goes to the  which prints its value. Then it deflects off the `/`, and then hits the `\` and begins falling again. It hits the  which increments its value, and then hits the `/` and deflects back into the `^`.

Bonus: Replace `1` with `a` to output the starting point.

Bonus: Add `b` to the end of the first row and `<` to the end of the last row to specify the ending point.
> 1 votes

# Answer
# SmileBASIC, 87 bytes

```
S$="0"*#Y@L
I S$,127?S$GOTO@L
DEF I S,P
IF"0"<S[P]THEN S[P]="0"I S,P-1 ELSE S[P]="1
END

```

Uses a recursive function to increment a binary string.
> 1 votes

# Answer
# Swift - 32 bytes

```
for i in 0...Int64.max{print(i)}

```

# Swift - 33 bytes

```
var i=0;while true{print(i);i+=1}

```

Cannot provide a testing link, because on the online environments this produces a buffer overflow. However, you can test it in Xcode / Swift Playgrounds or if you have an apple computer, you can run it in the Terminal, after typing the 'swift' command and pasting the code in.
> 1 votes

# Answer
# Whitespace, 40 bytes

```

```

Try it online!

Outputs numbers separated by newlines. Whitespace numbers are integers of arbitrary length however certain interpreters may impose their own limits due to the implementation language. As a counterexample, whitespace.pl theoretically should be able to output forever as Perl supports arbitrary length integers.

# Explanation

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

```
sssn     # push 0 - stack: [0]
nssn     # label ''
ssstn    # push 1 - stack: [<n-1>, 1]
tsss     # pop and add the top two items, push result - stack: [<n>]
sns      # duplicate the top item - stack: [<n>, <n>]
tnst     # pop, print as num - stack: [<n>]
ssststsn # push 10 - stack: [<n>, 10]
tnss     # pop, print as char (LF) - stack: [<n>]
nsnn     # jump to label ''

```
> 1 votes

# Answer
# Triangular, ~~15~~ ~~10~~ 9 bytes

<sup>-5 thanks to caird</sup>

```
\#iA.,/%<

```

Try it online!

Formatted:

```
   \
  # i
 A . ,
/ % < ÿ

```

Redirects/bounces only:

```
   \
  . .
 . . ,
/ . <

```

So the code `i%A#` is repeated infinitely.

* `i` \- increment top of stack
* `%` \- print top of stack as integer
* `A` \- push 10
* `#` \- print top of stack as ASCII and pop
> 1 votes

# Answer
# Jelly, 3 bytes

```
‘Ṅß

```

Try it online!

```
‘Ṅß
‘      Increment
 Ṅ     Print w/ linefeed
  ß    Call this link again

```
> 1 votes

# Answer
# TI-BASIC (Z80), 152 bytes

Hex dump:

```
2a31323334353637383904aa003f2a3004aa013fd1313fdeaa013fbb2baa0104413f3104463fd1416c3040463fbb0caa012b412b31116a2a3904463f41713104413fd43fce463fcf3f2a313fd03fbb0caa002b3170bb2abb0caa012b4170312b3111112b313fce413fbb0caa012b312b411170723fd43fd3492b312bbb2baa0111714171b8463f72702a303fd43f7204aa013fd4

```

Token rendering:

```
"123456789→Str1
"0→Str2
While 1
Disp Str2
length(Str2→A
1→F
While A>0 and F
sub(Str2,A,1)="9→F
A-1→A
End
If F
Then
"1
Else
sub(Str1,1+expr(sub(Str2,A+1,1)),1
If A
sub(Str2,1,A)+Ans
End
For(I,1,length(Str2)-A-not(F
Ans+"0
End
Ans→Str2
End

```

Implements incrementing on string-based decimal arbitrary-precision nonnegative integers. I haven't put much effort into golfing this, since just working with strings in this language is already hard enough.

The program should work on the whole TI-83 through -84 series (tested on the TI-84 Plus SE).

## Encoding

TI-BASIC code, like all text on the TI-8X, uses its own token-based encoding (see these token tables provided by a third party).

## Output

Output is in decimal through `Disp`, which essentially prints a string on its own line. On the TI-83 through TI-84 Plus SE calculators, once the numbers get large enough that they no longer fit on the display they'll appear truncated with ellipses in the last column. This is by far the TI-BASIC output method closest to standard out.
> 1 votes

# Answer
# Husk, 1 byte

```
N

```

Try it online!
> 1 votes

# Answer
# brainfuck, 31 bytes

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

```

Try it online!

Prints the binary value of each number with char code 1 as 1, null byte as 0 and ÿ as the separator.

The output is the exact same as the previous brainfuck answer, however this can go as high as 2^29998 in the 300000 available brainfuck cells and is 13 bytes shorter.
> 1 votes

# Answer
# AutoHotkey, 27 bytes

**Based on Michelfrancis' answer: https://codegolf.stackexchange.com/a/78480/72779.**

(Should I post this as a reply instead? Pretty new to this, but I don't have enough reputation to reply to other answers anyway.)

```
c=0         ; Colon-equal operator not required.       Saves one byte.
Loop{       ; Removed space between Loop and {.        Saves one byte.
c++         ; Shorter incremeting method, removed tab. Saves four bytes.
tooltip %c% ; Removed tab.                             Saves one byte.
}

```
> 1 votes

# Answer
# Pyt, 6 bytes

```
0`⁺ĐƤł

```

Try it online!

```
0   pushes zero
`   starts a while non-zero loop (but isn't checked until close loop)
⁺   increments x
Đ   Duplicates x
Ƥ   Prints with a separating newline
ł   go back to ` and loop till top is zero
```
> 1 votes

# Answer
# Stax, 4 bytes

```
0W^Q

```

Run and debug it online

Added for completeness.

## Explanation

```
0        Pushes 0
 W       Loop forever
  ^      Increment
   Q     Peek and print with newline

```
> 1 votes

# Answer
# Flobnar, 15 bytes

```
 \@
+_
<.9,!
>:

```

Try it online!

Uses the `-d` flag in order to output in decimal. The separator between numbers is the tab character
> 1 votes

# Answer
# Pip, 6 bytes

```
W1P++i

```

Try it online!

Straightforward; in pseudocode, this is

```
while(1)
 print(++i)

```

where `i` is preinitialized to `0`.
> 1 votes

# Answer
# Alchemist, 19 bytes

```
0a->Out__+Out_" "+_

```

Try it online!

Prints numbers separated by spaces.

### Explanation:

```
0a->                 # While there are no a atoms (i.e. always)
    Out__            # Output the number of _ atoms
         +Out_" "    # Print a space
                 +_  # Add an _ atom to the environment

```
> 1 votes

# Answer
# Runic Enchantments, 446 bytes

```
\DB͍R"000000000000000000000000000000000000001"$
.{ww;'''''''''''''''''''''''''''''''''''''''
.10{BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
a+'0000000000000000000000000000000000000000
kk0~111111111111111111111111111111111111111
$:{~+++++++++++++++++++++++++++++++++++++++
1'~}567890123456789012345678901234567890123
J://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.=? 000001111111112222222222333333333344444
/\/v\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

```

Try it online!

This one took me a while. Runic is *not* set up to handle arbitrarily large values. The C# interpreter is limited by the fixed bit width of the value types involved, none of which are 128 bits wide and no language commands result in a `BigInt` being pushed to the stack.

So, instead, I used a string. But decomposing a string into that many characters (and then concatenating them back together again) is a nightmare (especially with that many digits as the instruction pointer starts to fizzle when its stack is too big--there are limited workarounds to that, but this setup works for *actually arbitrarily large* values, provided that the program is made bigger to accommodate; question specification only required up to 2<sup>128</sup> which requires 39 digits; each additional power of 10 adds 10 bytes), so instead the storage is done *inside the source code* and updated with reflection. I also saw no clarification on whether or not leading 0s were allowed or not, but having them made things much easier.

<sub>*Image depicts fewer decimal digits for brevity as well as the Red/Yellow/Purple sections offset by 1, due to an old version of the code.*</sub>

* Cyan: Entry point and output. Reads a string value, pushes it to output, prints a newline, increases mana by 1 (reflection costs 1 mana; image is missing this command), and then enters the blue section via torodial edge wrapping.
* Blue: Read character from the string, edge wrap to Green.
* Green: push `x` position of the read character (in a consistent format, largely for convenience of the programmer), push `1,1` and Branch to position `1,1` (Red).
* Red: rotate character to top of stack, add 1, convert to character, duplicate, compare with `:` (`'9'+1` equals `:`). If true, go to Yellow. Else go to Purple.
* Yellow: Toss out the Branch return coordinates, push a `0` (y coordinate for the write command), write the value, proceed to Cyan.
* Purple: Toss out the top of the stack (the `:`), push a `0` (y coordinate for the write command), push a `'0'` character, write the `0`, return to Branch entry (Salmon) using the modified form,  which does not push return coordinates (so two giant rows of `~` aren't needed).
* Salmon (was supposed to be Orange): Repeat steps Blue and Green on the next power of 10.

If it ever fills the entire string with `9`s, the next loop would replace it all with 0s and hit the terminator `;`. As the online interpreter has a built-in arbitrary maximum execution limit (not including TIO's external limits), this will never *actually* occur, but that's an implementation detail and not imposed by the language specification.
> 1 votes

# Answer
# MathGolf, ~~5~~ 4 bytes

```
Åîo▲

```

Try it online.

Thanks to *@maxb* for explaining how to do an infinite loop in MathGolf.

**Explanation:**

```
   ▲    # Do-while true by popping the value,
Å       # with two commands within the loop-body:
 î      #  Push the 1-indexed loop-index
  o     #  Print it with a trailing newline without popping

```

Note that just like in Python, a positive integer is considered truthy, which is why we print the loop-index without popping so the `while(true)` can continue.
> 1 votes

# Answer
# Tamsin, ~~27~~ 26 bytes

```
main=''->T&{print a+T->T}.

```

Prints in Unary.

Try it online!
> 1 votes

# Answer
# tinylisp, 33 bytes

```
(d f(q(l(f(a(h l)1)(disp(h l
(f 1

```

Try it online!

This is a golf of DLosc's answer, but different enough I thought it would deserve its own answer.

The interpreter fills out `)`s at the end of a line.

`(d f (q vars body))` define `f` to be `(q vars body)`, this form indicates to tinylisp `f` is a function taking as arguments `vars` returning `body`. `vars` is `l` in case, so all the arguments to `f` get put into a list and passed to `l` (had `v` been parenthesised, like `(n)` in DLosc's answer, `f` would be defined to only take 1 argument `n`).

The complete body is `(f(a(h l)1)(disp(h l)))` (3 trailing `)`s filled by tinylisp). This calls the function `f` with the arguments `(a(h l)1)` and `(disp(h l))`, which when called will let `f` see them through `l` as a list containing both of these arguments. `(a(h l)1)` adds `1` to `(h l)`, the head of `l`. This is the counter. The second argument is `(disp(h l))` which displays `(h l)` the head of `l` (the counter), and returns `()`. This second argument never gets used but using `disp` here allows the `f` to print every cycle.

The loop is started by `(f 1)` which calls `f` with `l` as the list of all the arguments, i.e. `(1)`, the head of which is the counter.
> 1 votes

# Answer
# Python 3, 53 bytes

```
import itertools
for i in itertools.count(1):print(i)

```

Try it online!

## Explanation

I prefer to avoid while loops in my code, therefore I decided to write the program.

```
import itertools                     # Pretty simple, import something
for i in itertools.count(1):         # Foreach in the infinite list from 1 to ∞
                            print(i) #     Print the current item

```
> 1 votes

# Answer
# Python 3, 24 bytes

```
i=1
while[print(i)]:i+=1

```

Try it online!

`[print(i)]` is a list containing 1 element, which is always truthy. Thus the loop is repeated infinitely.
> 1 votes

# Answer
# 05AB1E, 1 byte

Try it online!

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

```
> 1 votes

# Answer
# Elixir, 40 bytes

```
f=fn f,i->IO.puts i;f.(f,i+1)end
f.(f,1)

```

Try it online!

Strangely enough, up to this point the leaderboard snippet doesn't list any answers in languages starting with `E`. Let's fix this!

Anyway, Elixir isn't a very convenient choice for this task, as to my knowledge it doesn't have a truly concise way of creating infinite loops/enums, named lambdas can't be recursive, while normal named functions can only be declared within a module. Therefore, we resort to a trick, where we create a named lambda, and pass it to itself as one of the arguments. Hacky, but still shorter than using a conventional way of creating an endless iterator:

## Elixir, 45 bytes

```
Enum.map Stream.iterate(1,&(&1+1)),&IO.puts/1

```

Try it online!
> 1 votes

# Answer
# , 3 bytes

```
+.=

```

Unwrapped:

```
  +
. = . .
  .

```

Simple explanation:

```
+   Add one to memory cell (starts at zero)
=   Print memory cell as number
.   No-op

The instruction pointer starts at '+' then "falls" into '=', then the '.' at the bottom.
The IP then falls to the '.' on the far right, as if the code is mapped onto a cube.
The IP then falls to '+', completing the loop.

```

Interpreter
> 1 votes

# Answer
# Scratch 3.0, 57 bytes

57 bytes using scratchblocks syntax, 6 blocks total. `say` *might* not be an acceptable form of output because there are no separating characters, so inform me if that's the case.

```
when gf clicked
set[n v]to[
forever
change[n v]by[1
say(n

```
> 1 votes

# Answer
# VBScript, 34 bytes

```
n=1
Do
Wscript.Echo n
n=n+1
Loop

```
> 1 votes

# Answer
# Vyxal, 3 bytes

```
{›…

```

Try it Online!

```
{   # Forever...
 ›  # Increment
  … # Print without popping

```
> 1 votes

# Answer
# JavaScript (V8), ~~37~~ 27 bytes

```
for(i=1;1;)console.log(i++)

```

Try it online!

TIO truncates the output since it exceeds 128 KiB.
> 1 votes

# Answer
# Rattle, 5 bytes

```
[+p]0

```

Try it Online!

# Explanation

```
[ ... ]0             infinite loop
  +                  increment
   p                 print

```
> 1 votes

# Answer
# ErrLess, 9 bytes

```
1}@#a?1+{

```

## Explanation

```
1  { Push one to the stack }
}  { Mark end of "comment" }
@# { Output top of stack as number }
a? { Print newline }
1+ { Add one to top of stack }
{  { Mark start of "comment" (skip adding another 1 to the stack) }

```

Try it online!
> 1 votes

# Answer
# convey, 8 bytes

```
1/.]
1+}

```

Try it online!

Uses the indices command (`/.`) with an infinite input to print produce ascending numbers forever. However, they start from zero, neccesitating a `+1` to be added. Technically I could reuse the 1s that are produced from the other end of the `/.`, but I couldn't figure out a shorter way to do that, so it ends up going to a sink.
> 1 votes

# Answer
# KonamiCode, 48 bytes

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

This is actually quite similar to the 0-100 program, just without the comparison buffer being set.
> 1 votes

# Answer
# Python 3, 26 bytes

```
i=1
while(1):print(i);i+=1

```

Try it online!
> 1 votes

# Answer
# A0A0, 45 bytes

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

```

Prints 1 up to infinity, delimited by tabs. This uses a basic infinite loop construct, which executes the following infinitely:

```
V1 O0 P9 S1
V1          ; Operand, initialized with 1
   O0       ; Outputs the operand as a number
      P9    ; Prints a tab (ascii code 9)
         S1 ; Increments the operand by 1

```

Edit: switched to tabs as a delimiter, since this saves 1 byte
> 1 votes

# Answer
# Knight, ~~15~~ 13 bytes

*Thanks @Steffan for -2 bytes*

```
;=a 0W1O=a+1a

```

Try It Online!

I have no idea what I'm doing but if it works then it works lol.
> 1 votes

# Answer
# GNU sed 4.2.2 `-rn` (`/dev/random`), ~~3~~ 1 byte

```
=

```

Yup, that's it.

For this program to work correctly, it must be run on an infinite-length file that can output a newline byte; `/dev/random` works well for this. Run with `sed -rn '=' /dev/random`.
> 1 votes

# Answer
# Fortran (GFortran), 46 bytes

```
integer(kind=16)::i
print*,(i,i=1,huge(i))
end

```

Try it online!

Theoretically it will iterate up to `huge(i)==2^127`. Need to import a library like fmlib to go higher.
> 1 votes

# Answer
# C++ (gcc), 72 bytes

```
#include <iostream>
int main(){int i=1;while(1){std::cout<<i<<" ";i++;}}

```

Try it online!
> 1 votes

# Answer
# Arturo, 21 bytes

```
f:$=>[f print<=&+1]0f

```

Try it!
> 1 votes

# Answer
## C, 64 bytes

```
s[9];i(int*s){while(!++*s++);}main(){for(;;)i(s)+write(1,s,36);}

```

There is no newline at the end of the file.

This prints out 35-byte little-endian integers, separated by null bytes (up until it hits 2^(25\*8) at which point it breaks, but we don't talk about that :^)

It still works on my machine if `s[9]` is replaced with `s[]`, which reduces it to 63 bytes. This is undefined behaviour so I didn't do it.

Run with `gcc -o count count.c && ./count | hexdump -e '36/1 " %02x" "\n"'` to nicely format the output.
> 1 votes

# Answer
# Vyxal 3, 3 bytes

```
{m,

```

Try it Online!

-1 byte thanks to @lyxal

### Explanation:

```
{m,
{    # Infinite loop (For [1..infinity])
 m   # context variable
  ,  # Print with newline

```

Created with the help of Luminespire.
> 1 votes

# Answer
# C++ (gcc) \+ libgmp, 85 bytes

I'm currently polishing my C++ skills. Despite the clunky boilerplate, this turned out to be surprisingly idiomatic and readable.

```
#include<gmpxx.h>
#include<iostream>
mpz_class i;main(){while(std::cout<<++i<<'\n');}

```

Try it online!
> 1 votes

# Answer
## PowerShell, ~~19~~ 14 Bytes

```
for(){$i++;$i}

```

Removed `echo` as per user recommendation
> 0 votes

# Answer
# Pylongolf2, 6 bytes

```
0>1+~<

```

Have a zero in the stack and continously add up to it.
I could give a more detailed explanation.

# Pylongolf2, 20 bytes (bonus)

```
cn:A0>1+~_A@1=?t¿d<

```

Only works in beta 6, but this version asks for what number to count to.
> 0 votes

# Answer
# PRINDEAL, 21

```
a c
 i n
 r
 c
a r
 p n
 c
 r

```

Preceds each number printed with `n =` , because it is not possible to print without such a prefix in PRINDEAL.
> 0 votes

# Answer
# Pushy, 4 bytes

```
1$#h

1       % Push 1
 $      % While loop (see below):
  #     %   Output last item
   h    %   Increment last item

```

The while loop will keep running while the last value on the stack evaluates to true. Because all values except `0` are truthy in Pushy, this loop will never exit. The `;` to end the loop is assumed by the interpreter.

This should eventually reach `2^128` as specified, because Pushy uses Python 3 (arbitrary sized) integers.
> 0 votes

# Answer
# PHP, ~~95~~ ~~74~~ 64 bytes

```
<?for($n=_;;print strrev($n))for($i=0;!$n[$i]=($n[++$i]+1)%10;);

```

or

```
<?for($n=_;;print strrev($n))while($i*=!$n[$i]=($n[++$i]+1)%10);

```

http://php.net/bc\_installation: These functions are only available if PHP was configured with `--enable-bcmath`.
http://php.net/gmp\_installation: In order to have these functions available, PHP must be compiled with GMP support by using the `--with-gmp option`.

So I just implemented `bcadd` ... sort of. Uses underscore as separator.
> 0 votes

# Answer
# tcl, 23

```
while 1 {puts [incr i]}

```

demo
> 0 votes

# Answer
# stacked, 12 bytes

```
[1+out]0 ani

```

Try it online!

This works as follows:

```
[1+out]0 ani
[     ]0 ani   in an interval of 0 seconds, do:
 1+            add 1 to the counter
   out         output it

```
> 0 votes

# Answer
# VBA, ~~157~~ 103 bytes

The Variant / Decimal data type in VBA only allows up to 29 digits of precision. 2^128 is 39 digits long so we have to smoosh two variables together. Variant is the default for any undeclared variable so that's easy. Every time the right-hand side (`a`) rolls over, set it back to 0 and iterate the left-hand side (`b`) by 1. To handle leading zeros, we set the format to be 28 digits long the first time that `a` rolls over. This has a smaller max than the string method but it's well above 2^128.

```
Sub c()
Do
a=a+1
If a=10^28Then b=b+1:a=0:f=Replace(Space(28)," ",0)
Debug.?b &Format(a,f)
Loop
End Sub

```

Once it's formatted for humans, it looks like this:

```
Sub c()
    Do
        a = a + 1
        If a = 10 ^ 28 Then b = b + 1: a = 0: f = Replace(Space(28), " ", 0)
        Debug.Print b & Format(a, f)
    Loop
End Sub

```

---

Previous method using strings:
It starts with the right-most character, converts it to a number, and then keeps moving left until the result is less than 10.

```
Sub d()
s="1"
Do
Debug.?s
For i=Len(s)To 1Step -1
c=Val(Right(s,1))+1
s=Left(s,i-1)
If c<10Then Exit For
If i-1Then r=r &"0"
Next
s=s &c &r
r=""
Loop
End Sub

```
> 0 votes

# Answer
## REXX, 34 bytes

```
numeric digits 39
do #=0
say #
end

```

(If your interpreter is set to a suitably large default precision, you may skip the `numeric digits` line.)
> 0 votes

# Answer
## QBIC, 8 bytes

```
{n=n+1?n

```

Explanation:

```
{       Start an infinite loop
n=n+1   Increment n (starts at 0)
?n      PRINT n
        Loop closed implicitly

```

Runs better tan expected. QBIC, when run in QBasic 4.5 on DOSBOX handles numbers up to and including 2^128 quite well, but it has a tendency to use scientific notation for the bigger numbers.
> 0 votes

# Answer
# Fourier, 10 bytes

```
(i^~io32a)

```

A very simple program that loops forever.

**Try it on FourIDE**

*Note, the program on FourIDE has been modified to make it more readable: it has a delay of two seconds between each number*
> 0 votes

# Answer
# Braingolf, 15 bytes

```
V# R1[l!_v!@R>]

```

### Explanation:

```
V# R1[l!_v!@R>]
V               Creates new stack and switches to it
 #<space>       Pushes 32 (ASCII value of a space) to stack
   R            Return to main stack
    1           Push 1
     [........] do-while loop. Will always run once, then checks if
                first value in stack is 0 after each loop, if it is,
                breaks out of the loop
      l         Push current length of stack
       !_       Print last item on stack without popping
         v      Switch to next stack
          !@    Print last item on stack as ASCII char without popping
            R   Return to main stack
             >  Move last item to the start of the stack

```
> 0 votes

# Answer
# Groovy, 25 bytes

```
for(i=1g;;i++){println i}

```

Try it online!

Groovy allows numeric literals of type BigInteger or BigDecimal to be declared by using the suffix `g`. BigNumber types are arbitrary length/precision numbers. This code declares a BigInteger then continuously prints (with a newline) and increments it.
> 0 votes

# Answer
## Check, 13 bytes

```
 >1#v
#<)##p#

```

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

# Answer
# Anyfix, 6 bytes

This was intended to be a language that allowed programs to be prefix, infix, and postfix, sometimes all at once. However, because of the way it works, dyads and tryads will default to prefix and monads will default to postfix. It's quite confusing. (Inspired by Jelly and 05AB1E)

```
1¿"Ƥ‘»

```

# Explanation

```
1¿"Ƥ‘»  Program
1         Push 1 onto the stack
 ¿       If the stack is non-empty, then look at the top of the stack off and execute the next token if that value is truthy
  "Ƥ‘"»  ComboToken:
  "      Duplicate the top of the stack
   Ƥ     Pop and print with a trailing newline
    ‘    Increment the value

```

Since this is written in Python, it can easily count up to way past `2 ** 16384`... hehe

This language will be on TIO sometime in the future once Dennis has some time to spare.
> 0 votes

# Answer
# 8th, 31 bytes

**Code**

```
: f n:1+ dup . cr recurse ; 0 f

```
> 0 votes

# Answer
# Casio Basic, 27 bytes

```
For 1⇒z To ∞
Print z
Next

```

The largest integer the fx-CP400 can store precisely is a bit over 2<sup>2032</sup>, or 611 digits. Chances are it'll keep counting up to 10<sup>1000</sup> before overflowing, though.
> 0 votes

# Answer
# Cubically, ~~12~~ 11 bytes

```
R3D1R1(+0%6)

```

Explanation:

```
R3D1R1       get UP's faceval to 1
      (      open loop that can always be jumped to
       +0     add 1 to notepad
         %    print notepad
          )  loop

```
> 0 votes

# Answer
# Implicit on TIO, ~~6~~ 4 bytes

```
(.%ß

```

This requires that the input box on TIO is empty.

```
(.%ß
(...   « loop while top of stack truthy                       »;
 .     «  increment top of stack (read input if stack empty)  »;
  %    «  print integer                                       »;
   ß   «  print space                                         »;
       « just kidding, loop forever                           »;

```

Try it online!
> 0 votes

# Answer
# RProgN 2, 6 bytes

```
1]p1+{

```

Try it online!
> 0 votes

# Answer
# Swift 4, 146 bytes

```
var a=[0];while true{var e=a.count-1;print(a.reduce("",{$0+"\($1)"}));while e>=0{a[e]+=1;if a[e]<10{break};a[e]=0;if e==0{a.insert(1,at:0)};e-=1}}

```

The code compiles as is from a .swift file using `swiftc`. The program outputs numbers in decimal form, and given enough time it will output 2<sup>128</sup> (and beyond).

Ungolfed (and slightly modified<sup>*a*</sup>) version: Swift Sandbox.

---

<sup>*a*: Starts just shy of 10<sup>40</sup> (larger than 2<sup>128</sup>) and ends execution at 10<sup>40</sup> exactly.</sup>
> 0 votes

# Answer
# \>\<\>, 15 Bytes

```
0>1+:n\
 \og10/

```

Start with zero. Add one, print the value, and then print the character at (0,1) in the codebox, which is a space. Repeat ad nauseam.
> 0 votes

# Answer
# TrumpScript, 117 bytes

```
am is 1000001
an is 1000000
As long as,an is an?;:
say am minus an
am is,am plus 1000001 minus an;!
America is great.

```

Try it online!

What, there was no TrumpScript submission? Well, now there is. I don't think we can golf it any further though.
> 0 votes

# Answer
# ALGOL 68 (Genie), ~~58~~ 54 bytes

```
BEGIN LONG LONG INT a:=0;WHILE1=1DO print(a+:=1)OD END

```

Try it online!
> 0 votes

# Answer
# JavaScript (ES6), 56 Bytes, optimized from user81655

```
for(n=[],i=99;;)if(n[i]=-~n[i--]%10)alert(n.join``,i=99)

```
> 0 votes

# Answer
# Pyt, 6 bytes

```
1`Đƥ⁺ł

```

Explanation:

```
1           Push 1
 `   ł      Loop while top of stack is not 0
  Đƥ        Duplicate top of stack, then print
    ⁺       Increment top of stack

```

Try it online!
> 0 votes

# Answer
# Ace, 4 bytes (non - competing)

```
vIPO

```

Try it online!

This is a new language I ~~am~~ (was, :() working on.
> 0 votes

# Answer
# tinylisp, 34 bytes

```
(d f(q((n)(i(disp n)1(f(a n 1
(f 1

```

The program defines a function `f` that takes one argument `n`, prints it, and recurses on `n+1`; then it calls `f` with an initial argument of `1`. Because tinylisp has tail-call optimization, infinite recursion is not a problem--the implementation handles it as an infinite loop instead.

Try it online!
> 0 votes

# Answer
# Julia 0.6, 30 bytes

```
for i=1:big(2)^999 @show i end

```

Outputs lines like `i = 1`, `i = 2`. If the `i =` is disallowed, then `for i=1:big(2)^999 println(i) end` is 32 bytes. This will count to `2^999`, well over the `2^128` required. You can increase that significantly with no additional bytes with `big(2)^9^9` but it times out in TIO. `big(2)` is an arbitrary precision integer, and all math with smaller integer types promotes to arbitrary precision.

Try it online!
> 0 votes

# Answer
# Yabasic, 14 bytes

Script that counts from `0` to `2^1024` then outputs `Inf`, infinitely. Takes no input and outputs to the console.

```
Do?i
i=i+1Loop

```

Try it online!

### Far More Interesting Version, 20 bytes

For some reason, `0/0=2^1024` in Yabasic, and the language appears to have no loss of precision on this range so rather than producing an error, the following code counts exactly from `0` to `179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368`, which is wonderful, and stupid `:P`

```
For i=0To 0/0?i
Next

```

Try it online!
> 0 votes

# Answer
# Visual Basic .NET (.NET Core), 76 bytes

Declared `sub`routine that takes no input, and increments then outputs `i` forever.

```
Module M
Sub Main
Dim i
Do
i+=1
Console.WriteLine(i)
Loop
End Sub
End Module

```

Try it online!
> 0 votes

# Answer
# Foam, 22 bytes

```
0[[+1 : <#]/-\ : ~]: ~

```
> 0 votes

# Answer
# Noether, 6 bytes

```
(!iP?)

```

**Try it online!**

The online link has a delay of 1 second added to prevent the interpreter from freezing up.
> 0 votes

# Answer
# Momema, 17 bytes

```
z00+1*0-8*0-9 9z1

```

Try it online!
> 0 votes

# Answer
# Wolfram Language (Mathematica), 18 bytes (16 characters)

```
Print@i~Do~{i,∞}

```

Try it online!
> 0 votes

# Answer
## , 3 bytes

```
iaE

```

## Explanation

W allows infinite lists, so this simply loops over the infinite list.

```
i   % Unsurprisingly, a built-in for positive infinity.
  E % Foreach the infinite list
    % from 1 to infinity:
 a  % Print this item
    % with a newline

```
> 0 votes

# Answer
## DIVCON, 4 bytes

```
S#o+

```

## Explanation

```
S     No-op
 #    Skip the following:
  o       Output
   +  Increment the accumulator
  o   Output the incremented accumulator
 #    If acc != 0: (in which it already is)
S     Reverse computation

And it continues, forever ...

```
> 0 votes

# Answer
# Factor \+ `lists.lazy`, 19 bytes

```
1 lfrom [ . ] leach

```

Try it online!
> 0 votes

# Answer
# Racket – 45 bytes

```
#!racket
(for([n(in-naturals)])(displayln n))

```

Try it online!

## Explanation

Racket provides us with a neat little function called `in-naturals` that receives an optional argument which tells it where to begin. Since it is a stream (generator, in other languages), we can use it with Racket's `for` loop to display each number followed by a newline.

Documentation for `in-naturals` also says the following:

> An `in-naturals` application can provide better performance for integer iteration when it appears directly in a `for` clause.

Which I assume means that the loop will be more faster to evaluate?

```
#lang racket

(for ([n (in-naturals)])
  (displayln n))

```

Another cool thing about `for` is that it has a keyward argument called `#:when` that will only run the code in the loop if the condition is met:

```
#lang racket

; Code to print all numbers divisible by 31:
(for ([n (in-naturals)] #:when (zero? (modulo n 31)))
  (displayln n))

```

Try it online!

## Compilation on a machine

* Once Racket is set up, store this code as a file with the extension `.rkt`.
* Open a terminal of your choice.
* Check if Racket is in your path via `racket -v`, if so, you can either:
    + Run the code directly via `racket filename.rkt` (replace `filename.rkt` with your file.
    + Compile the code to an executable using `raco exe filename.rkt`. Once compiled, you'll have an executable in the current directory alongside the source file.

# Documentation
> 0 votes

# Answer
# ForWhile, 66 bytes

`(!;$1-:){}9+:66(.:@;66-$1-:).9@1+:0;(.;10%48+'1+3,10/';)+(.#)9#$66`

infinitly prints numbers in decimal separated by tabs.

In ForWhile every loop will exit after a finite number of iterations, and recursion is limited to a fixed depth (3), this means that every **finite** ForWhile program will terminate after a finite number of steps.

The only way to circumvent this is to write an "infinite" program by continuously generating more source-code at runtime.

The above program repeatedly copies its source code to a location right of the instruction pointer and the deletes the old source code (to prevent memory overflow).

online interpreter

# Explanation

```
\ ignored in first iteration
(!;$1-:)
\ push current instruction pointer, offset it to point at the start of the current code-section
        {}9+
\ copy the code to the address immediately after the current source-code
            :66(.:@;66-$1-:).
\ load the value at address 9 and increment it
                             9@1+
\ print the integer converted to a decimal string
                                 :0;(.;10%48+'1+3,10/';)+(.#)
\ print a tab and store the new value of the integer at address 9
                                                             9#$
\ push the length of the code
                                                                66
\ clear the previous code-section
(!;$1-:)
...

```

---

Shorter but less interesting solution (20 bytes)

`2 129`:(;'-(.48#)9#)`

prints the first 2<sup>129</sup>-1 numbers in unary separated by tabs.

online interpreter
> 0 votes

# Answer
# Swift, ~~24~~ 21 bytes

```
(1...).map{print($0)}

```

Pretty self-explanatory, I feel. Numbers are separated by newlines.
> 0 votes

# Answer
# {,}, 31 Chars or \\$31\log\_{256}(4)\approx\\$ 7.75 Bytes

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

```

Log base 4 because there are (, {, commas, and closing brackets (which are unambiguous because the code is balanced)
> 0 votes

# Answer
# Dart, 30 bytes

```
main(i){for(i=0;;print(i++));}

```

Try it online!

It's equivalent to the following Dart code:

```
dynamic main(dynamic i) {
    for (i = 0;; print(i++));
}

```

`i` starts as a `List<String>`, equivalent to Java's `args`. But omitting its type makes it dynamic, making it assignable to any type. Inside the loop, it changes its type to an integer and sets it to zero.
> 0 votes

# Answer
# Rust, 51 49 bytes

```
fn main(){let mut x=1;loop{print!("{}",x);x+=1;}}

```

Try it online!
> 0 votes

# Answer
# C#, 83 Bytes

```
using System;class C{static void Main(){double x=0;for(;;)Console.WriteLine(x++);}}

```

Un-golfed:

```
using System;
class C {
  static void Main(){
    double b=0;
    for(;;)Console.WriteLine(b++);
  }
}

```

Note: C#'s `double` type can store values up to approximately 1.79769313486232x10<sup>308</sup>.
> -1 votes

# Answer
## C++, 72 bytes

*Different from the other C++ answer, as it only uses the std library.*

### Golfed:

```
#include<iostream>
int main(){for(int c=0;c>=0;c++,std::cout<<c<<"\n");}

```

### Ungolfed:

```
#include<iostream>
int main(){
    for(int c = 0; c >= 0; c++){
        std::cout<<c<<"\n";
    }
}

```
> -1 votes

# Answer
# Bash, 25 bytes, possibly invalid

```
while :;do echo -n 1;done

```

Try it online!

Outputs infinite `1`s. In other words, outputs all numbers `1..` in unary, separated by `1` :^)

This is definitely dubious, but I see nothing in the rules or comments that disallows it. I also didn't see an existing submission that uses this gimmick.

This solution could be smaller in other languages, but we need bash in order to be able to output in unary. Since bash has no numbers, I feel it qualifies.

It could probably be smaller in bash too. Unfortunately, I don't know much bash.
> -1 votes

---
Tags: code-golf, number, counting, restricted-memory
---