Task

Create a program that, when run, would display all integers from   1   to      ∞      (or any relevant implementation limit),   in sequence   (i.e.   1, 2, 3, 4, etc)   if given enough time.



An example may not be able to reach arbitrarily-large numbers based on implementations limits.   For example, if integers are represented as a 32-bit unsigned value with 0 as the smallest representable value, the largest representable value would be 4,294,967,295.   Some languages support arbitrarily-large numbers as a built-in feature, while others make use of a module or library.

If appropriate, provide an example which reflect the language implementation's common built-in limits as well as an example which supports arbitrarily large numbers, and describe the nature of such limitations—or lack thereof.




/*count all the protons, electrons, & whatnot in the universe, and then */
/*keep counting.  According to some pundits in-the-know, one version of */
/*the big-bang theory is that the universe will collapse back to where  */
/*it started, and this computer program will be still counting.         */
/*┌────────────────────────────────────────────────────────────────────┐
  │ Count all the protons  (and electrons!)  in the universe, and then │
  │ keep counting.  According to some pundits in-the-know, one version │
  │ of the big-bang theory is that the universe will collapse back to  │
  │ where it started, and this computer program will still be counting.│
  │                                                                    │
  │                                                                    │
  │ According to Sir Arthur Eddington in 1938 at his Tamer Lecture at  │
  │ Trinity College (Cambridge), he postulated that there are exactly  │
  │                                                                    │
  │                              136 ∙ 2^256                           │
  │                                                                    │
  │ protons in the universe and the same number of electrons, which is │
  │ equal to around  1.57477e+79.                                      │
  │                                                                    │
  │ Although, a modern estimate is around  10^80.                      │
  │                                                                    │
  │                                                                    │
  │ One estimate of the age of the universe is  13.7  billion years,   │
  │ or  4.32e+17 seconds.    This'll be a piece of cake.               │
  └────────────────────────────────────────────────────────────────────┘*/
numeric digits 1000000000       /*just in case the universe slows down. */
 
                                /*this version of a DO loop increments J*/
         do j=1                 /*Sir Eddington's number, then a googol.*/
         say j                  /*first, destroy some electrons.        */
         end
say 42                          /*(see below for explanation of 42.)    */
exit
 
/*This REXX program (as it will be limited to the NUMERIC DIGITS above, */
/*will only count up to  1000000000000000000000000000000000000000000... */
/*000000000000000000000000000000000000000000000000000000000000000000000 */
/*  ... for another (almost) one billion more zeroes  (then subtract 1).*/
 
/*if we can count  1,000  times faster than the fastest PeeCee, and we  */
/*started at the moment of the big-bang, we'd be at only  1.72e+28,  so */
/*we still have a little ways to go, eh?                                */
 
/*To clarify, we'd be  28 zeroes  into a million zeroes.   If PC's get  */
/*1,000  times faster again,  that would be  31  zeroes into a million. */
 
/*It only took   Deep Thought  7.5  million years  to come up with the  */
/*answer to everything  (and it double-checked the answer).  It was  42.*/