| Bytes | Lang | Time | Link |
|---|---|---|---|
| 008 | 'Python' is not recognised | 241104T213402Z | Gleb |
| 006 | 'Python' is not recognized | 241214T174256Z | Gleb |
| 003 | FRACTRAN | 250713T233220Z | Lucenapo |
| 023 | SAKO | 250321T113653Z | Acrimori |
| 003 | Jalapeño | 250204T042119Z | ATaco |
| 5118 | ☾ | 250203T174543Z | Joao-3 |
| 036 | Python3 | 250115T234242Z | Laszlo P |
| 038 | Bespoke | 250115T195107Z | Josiah W |
| 044 | Malbolge Original Interpreter | 241214T154522Z | Weird Gl |
| 029 | jbasher2 | 241217T170403Z | madeforl |
| 014 | Raku Perl 6 rakudo | 241211T180254Z | xrs |
| 013 | BASIC | 241105T115420Z | Gleb |
| 014 | AWK | 241105T140456Z | xrs |
| 003 | How dare you fuck the brain | 241004T160749Z | Gleb |
| 007 | 2let | 240222T151805Z | madeforl |
| 018 | GFortran | 201212T064351Z | roblogic |
| 003 | Zsh | 230615T202030Z | Wallace |
| nan | 230615T074024Z | Dadsdy | |
| 004 | !@#$%^&*_+ | 230614T180318Z | Wallace |
| 007 | x86 .COM Executable | 140115T082819Z | AlliedEn |
| 015 | Motorola MC14500B Machine Code | 230227T191058Z | emirps |
| 003 | Trilangle | 230227T152540Z | Bbrk24 |
| 004 | Pip | 230202T231145Z | DLosc |
| 008 | GHCi + Data.Function | 140129T014914Z | daniel g |
| 009 | Windows Batch file | 131109T022605Z | Patrick |
| 009 | Intcode | 191224T035753Z | The Fift |
| 008 | Assembly MIPS | 221107T223435Z | EasyasPi |
| 004 | Phooey | 221107T004946Z | EasyasPi |
| 003 | Bash | 190601T180455Z | Benjamin |
| 050 | Pascal | 221105T134516Z | Kai Burg |
| 002 | Sesos | 160717T023705Z | Dennis |
| 021 | Oration | 160606T181213Z | Żáł |
| 004 | Retina | 161115T230507Z | mbomb007 |
| 012 | Röda | 170313T183417Z | fergusq |
| 014 | Quetzalcoatl | 160302T224441Z | NoOneIsH |
| 003 | Fuzzy Octo Guacamole | 160321T024625Z | Riker |
| 006 | BitCycle | 220903T035321Z | DLosc |
| 013 | tinylisp | 220610T014934Z | emanresu |
| 004 | Pyth | 160220T104414Z | AlexINF |
| 004 | Knight | 220807T023949Z | Aiden Ch |
| 001 | Regenerate a | 220609T154305Z | thejonym |
| 039 | A0A0 | 210627T151625Z | stefvans |
| 015 | Common Lisp | 220511T050859Z | venven |
| 010 | BitCycle | 220511T044321Z | des54321 |
| 048 | Vyxal | 220423T025331Z | naffetS |
| 008 | Dyalog APL | 220422T215638Z | fluentpw |
| 002 | Brachylog | 160831T094459Z | Fatalize |
| 017 | rusty_deque | 220413T142513Z | bigyihsu |
| 026 | Appleseed | 220413T043310Z | DLosc |
| 020 | unsure | 210228T044630Z | Gold Far |
| 004 | Seed | 220217T033005Z | autumn |
| 033 | TRANSCRIPT | 220210T155600Z | Twilight |
| 015 | Python 3 | 220204T210151Z | Oliver |
| 002 | Headass | 220205T063528Z | thejonym |
| 015 | tinylisp | 220205T020638Z | Razetime |
| 008 | APOL | 211211T160403Z | Ginger |
| 015 | KonamiCode | 211201T171803Z | Ginger |
| 062 | RETURN | 211130T101414Z | CreaZyp1 |
| 000 | ℒight | 211123T015030Z | Fmbalbue |
| 011 | Grass | 210917T123621Z | user1004 |
| 026 | INTERCAL | 210917T122158Z | user1004 |
| 016 | Nim | 210905T204447Z | Qaziquza |
| 005 | Cascade | 210816T095305Z | emanresu |
| 060 | Arduino | 210816T001731Z | Bbrk24 |
| 6875 | Mascarpone | 210627T160114Z | Soup Gir |
| 001 | Dis | 210626T083107Z | user1004 |
| 003 | Pushy | 170119T194730Z | user6357 |
| nan | 160327T062054Z | Dennis | |
| 002 | Duocentehexaquinquagesimal | 210414T201410Z | Makonede |
| 008 | PowerShell | 210312T204900Z | Daniel T |
| 015 | Zsh | 210312T153737Z | sech1p |
| 004 | Brainf*ck | 210304T171201Z | Python_4 |
| 009 | [BASIC] | 210228T052245Z | Caleb Fu |
| 001 | Vyxal | 210227T005304Z | lyxal |
| 001 | Befunge93 | 210226T191039Z | Makonede |
| 012 | ARM Thumb | 201227T001439Z | EasyasPi |
| 009 | Ruby | 140703T160429Z | addison |
| 001 | 05AB1E | 201116T224153Z | Makonede |
| 004 | MAWP | 200620T073040Z | Dion |
| 013 | Rockstar | 201001T093401Z | Shaggy |
| 004 | Microsoft Word Math AutoCorrect | 200624T183412Z | General |
| 023 | C | 171224T232201Z | SIGSTACK |
| 055 | Brainetry liveoutput | 200624T143945Z | RGS |
| 010 | Vim | 200621T021212Z | JoshM |
| 002 | AlphaBeta | 200620T171414Z | PkmnQ |
| 1505 | Malbolge | 200619T043850Z | ceilingc |
| 001 | 7 | 200615T201223Z | Pizgenal |
| 009 | Ruby | 200519T154303Z | Sapphire |
| 006 | International Phonetic Esoteric Language | 200616T222310Z | bigyihsu |
| 059 | Go | 200519T155409Z | Sapphire |
| 015 | TSQL | 200303T145249Z | BradC |
| 003 | Rabbit~ | 190723T111630Z | Adam |
| 019 | Roj | 200302T055945Z | user9206 |
| 004 | Keg | 190607T021920Z | user8505 |
| 003 | VisiCalc | 200118T070813Z | user8505 |
| 026 | Spice | 191227T161236Z | Slord6 |
| 086 | Shakespeare Programming Language | 191227T031355Z | Hello Go |
| 007 | MarioLANG | 190920T150012Z | dropbear |
| 016 | TSQL | 190920T104120Z | Jan Droz |
| 003 | bitch | 190130T001633Z | Helen |
| 005 | 33 | 190729T062155Z | TheOnlyM |
| 037 | Intercept 1.1 | 190601T180204Z | Benjamin |
| 011 | TeX | 190913T095746Z | Skillmon |
| 005 | Element | 190911T150035Z | user8505 |
| 007 | MarioLANG | 190911T130913Z | squid |
| 008 | PHP | 171012T140658Z | Shaun Mo |
| 002 | Pyth | 190728T225541Z | hakr14 |
| 008 | Underload | 190728T125322Z | Edgex42 |
| 018 | Lua | 190723T143844Z | val - di |
| 010 | BrainFlak | 190723T140737Z | Dorian |
| 008 | Brian & Chuck | 190723T134612Z | Dorian |
| 023 | Rust | 190723T130109Z | ruohola |
| 001 | Bitwise Cyclic Tag But Way Worse | 190723T102554Z | Edgex42 |
| 003 | bitch | 190607T023930Z | user8505 |
| nan | 150407T150254Z | SuperJed | |
| 004 | Triangular | 190603T152843Z | squid |
| 013 | Turing Machine But Way Worse | 190513T050817Z | u-ndefin |
| 012 | TeX | 180328T192608Z | siracusa |
| 005 | MINOL | 190514T171852Z | brhfl |
| 003 | YABALL | 190513T025253Z | MilkyWay |
| 005 | TIBASIC | 190416T175934Z | absolute |
| 003 | Voovoos | 190416T143601Z | Mayube |
| 002 | 05AB1E | 190415T050917Z | Jackson |
| 011 | Perl 6 | 190414T054433Z | bb94 |
| nan | Minecraft > 1.9 2 + 5 = 7 Bytes | 151112T223455Z | Addison |
| 015 | Tamsin | 190323T051606Z | Esolangi |
| 016 | Python | 190214T200239Z | Merin Na |
| 039 | Muriel | 190213T035706Z | Jo King |
| 001 | Gol><> | 190213T040940Z | KrystosT |
| 194 | JVM bytecode OpenJDK asmtools JASM | 190213T024447Z | Kitten |
| 007 | Clean | 190213T023534Z | Οurous |
| 013 | Turing Machine But Way Worse | 190213T015104Z | MilkyWay |
| 005 | Lean Mean Bean Machine | 181130T163548Z | Mayube |
| 006 | Aheui esotope | 181128T002750Z | cobaltp |
| 008 | Perl 6 | 181128T004318Z | Jo King |
| 010 | Alchemist | 181127T202740Z | ბიმო |
| 056 | JavaScript + HTML | 181127T190424Z | guest271 |
| 003 | MathGolf | 181003T141914Z | maxb |
| 002 | Burlesque | 181115T111035Z | mroman |
| 011 | Perl 6 | 140310T223956Z | Matt Oat |
| 369 | Taxi | 181003T195735Z | JosiahRy |
| 170 | ORK | 181003T193327Z | JosiahRy |
| 003 | √ å ı ¥ ® Ï Ø ¿ | 170313T175850Z | caird co |
| 000 | Z80Golf | 180810T053304Z | Bubbler |
| 004 | Flobnar | 180810T050125Z | Esolangi |
| 089 | Shakespeare Programming Language | 180605T135252Z | 12Me21 |
| 014 | Prolog | 180605T080332Z | Khepu |
| 001 | Ahead | 180603T032655Z | snail_ |
| 004 | Japt | 180517T071254Z | Bubbler |
| 035 | HTML + JavaScript | 180426T142550Z | mbomb007 |
| 005 | TIBasic | 131126T234119Z | Timtech |
| 024 | C | 131112T021309Z | Stuntddu |
| 001 | Gol><> | 180330T072516Z | Bubbler |
| 012 | TIS n 1 1 | 180329T214239Z | Phlarx |
| 032 | Java JDK 10 | 180328T195425Z | Developi |
| 003 | Stax | 180328T171523Z | Weijun Z |
| 004 | Seed | 170210T194440Z | ovs |
| 116 | Shakespeare Programming Language | 180213T093059Z | chococha |
| 014 | PHP | 180212T210856Z | Artistic |
| 007 | FALSE | 180212T202711Z | 12Me21 |
| 002 | axo | 180212T201721Z | qqq |
| 024 | Forth | 150410T210739Z | mbomb007 |
| 005 | Chip8 | 171012T135232Z | 12Me21 |
| 005 | Momema | 180212T071040Z | Esolangi |
| 002 | Wumpus | 180212T051901Z | Jo King |
| 001 | Forked | 180212T050834Z | MD XF |
| 007 | Dreaderef | 170820T054828Z | Esolangi |
| 002 | Aceto | 171224T222231Z | qqq |
| 004 | Flipbit | 171225T014455Z | caird co |
| 002 | Pyth | 171211T192700Z | Tornado5 |
| 028 | Whispers | 171210T145635Z | caird co |
| 013 | Funky | 171107T225841Z | ATaco |
| 003 | sh | 131109T114309Z | klingt.n |
| 001 | cQuents 0 | 171015T234451Z | Stephen |
| 009 | GWBasic | 171015T233439Z | Anonymou |
| 005 | sed | 131109T194525Z | F. Hauri |
| 009 | Jq 1.5 | 171014T071313Z | jq170727 |
| 156 | R | 171012T152908Z | user5957 |
| 002 | QBIC | 170109T144133Z | steenber |
| 023 | VBScript | 171012T120230Z | user7277 |
| 018 | VBA | 171002T214225Z | Taylor R |
| 011 | Juby | 171002T204423Z | Cyoce |
| 004 | Evil | 171001T132322Z | user6280 |
| 020 | JavaScript | 171001T122102Z | user7491 |
| 014 | Wolfram Language Mathematica | 170926T075455Z | Vitaliy |
| 019 | Bitwise | 170926T033105Z | MD XF |
| nan | 140130T202137Z | Braden B | |
| 005 | Dyalog APL | 170820T184502Z | Gil |
| 003 | Cubically | 170805T174153Z | MD XF |
| 011 | AHK | 170730T021337Z | Engineer |
| 041 | Emojicode | 170730T002052Z | betseg |
| 038 | MOO | 170709T235137Z | The Fift |
| 009 | Add++ | 170606T201841Z | caird co |
| 016 | Unreadable | 170606T085225Z | Mayube |
| 002 | Fission 2 | 170606T080229Z | Mayube |
| 003 | Check | 170603T042409Z | Esolangi |
| 005 | shortC | 170606T041059Z | MD XF |
| 012 | Decimal | 170606T040436Z | MD XF |
| 006 | Braingolf | 170603T033208Z | totallyh |
| 016 | Whitespace | 170527T130545Z | Ephphath |
| 001 | Alice | 170411T132605Z | Martin E |
| 016 | Fith | 170216T182041Z | jqkul |
| 008 | Commodore 64/VIC20 assembly | 170216T121437Z | Shaun Be |
| 006 | QC | 170211T210633Z | user6333 |
| 006 | SmileBASIC | 170124T055755Z | 12Me21 |
| 005 | Commodore Basic | 170124T054508Z | Mark |
| 023 | C++ | 170123T163340Z | Matthew |
| 019 | Haxe | 170118T000538Z | ETHprodu |
| 019 | 8th | 170117T202555Z | Chaos Ma |
| 013 | GO | 170117T204049Z | powelles |
| 011 | PHP | 140703T183934Z | Aurel |
| 008 | FALSE | 161223T230041Z | Conor O& |
| 024 | Kitanai | 161221T132317Z | Sygmei |
| 036 | LOLCODE | 140202T063635Z | Giraffes |
| 001 | Labyrinth | 161213T220355Z | Robert H |
| 006 | Casio FX7000G | 161210T214449Z | FlipTack |
| 006 | TI83 Hex Assembly | 161201T210534Z | habs |
| 008 | zsh | 161125T025530Z | apricot |
| 002 | Cubix | 160907T092744Z | ETHprodu |
| 010 | Ruby | 161028T063219Z | anna328p |
| 005 | x86 .COM Executable | 161006T192057Z | HellMood |
| 019 | Sonic Pi | 160505T175133Z | univalen |
| 009 | PHP | 131114T150501Z | Vlad Pre |
| 007 | Golfscript | 140129T204917Z | McKay |
| 049 | Woefully | 160907T072820Z | Destruct |
| 005 | GNU sed | 160831T093604Z | seshouma |
| 001 | Hexagony | 160831T094205Z | Martin E |
| 020 | C | 160529T003007Z | user8397 |
| 006 | Haystack | 160529T002215Z | user8397 |
| 026 | Brainfuck | 160528T231048Z | TuxCraft |
| 004 | APL | 160528T215334Z | TuxCraft |
| 001 | Desmos | 160527T155852Z | weatherm |
| 005 | Emotinomicon 18 bytes | 160527T105433Z | Bál |
| 002 | Burlesque 2 Bytes | 160527T084445Z | mroman |
| 014 | Clojure | 160526T204556Z | mark |
| 004 | APL | 151015T214534Z | Adá |
| 003 | Scratch | 160523T130350Z | weatherm |
| 021 | Come Here | 160325T120641Z | SuperJed |
| 001 | Reng v.1.2 | 160321T032917Z | Conor O& |
| 030 | BASTARD 30 Bytes | 160301T171844Z | s4b3r6 |
| 005 | Pylons | 160229T204104Z | Morgan T |
| 023 | ForceLang | 160229T203659Z | SuperJed |
| 013 | Python | 131110T143636Z | anon |
| 015 | R | 160215T155602Z | Argenis |
| 025 | Bitxtreme | 151112T222050Z | lirtosia |
| 025 | C | 140129T051212Z | Raghuram |
| 001 | Detour | 160125T005859Z | Cyoce |
| 047 | 𝔼𝕊𝕄𝕚𝕟 | 160125T013909Z | Mama Fun |
| 003 | PlatyPar | 151216T014525Z | Cyoce |
| 003 | Mouse2002 | 151214T134241Z | cat |
| 028 | Javascript ES6 | 151015T230316Z | Mama Fun |
| 081 | ArnoldC | 151015T224847Z | Mama Fun |
| 133 | BotEngine | 151015T215642Z | SuperJed |
| 003 | Simplefunge | 140907T005022Z | Aearnus |
| 004 | Selfmodifying Brainfuck | 151015T155802Z | mbomb007 |
| 004 | GoLunar | 150410T211257Z | mbomb007 |
| nan | ><> Fish 2 characters | 151015T140236Z | SjoerdPe |
| 006 | Turing Machine 6 Characters | 131109T230027Z | Serge |
| 001 | Windows Batch File | 150702T010934Z | Hand-E-F |
| 002 | Bat | 150701T203801Z | Qwertiy |
| 042 | Qt 5.4 QMake pro file | 150701T151059Z | ForemanB |
| 003 | Cardinal | 150701T141814Z | M L |
| 003 | Piet | 150613T161144Z | M L |
| 009 | Haskell | 150411T082544Z | Towerism |
| 033 | Mathematica | 150411T023016Z | alephalp |
| nan | I haven't seen Thue used here much | 150410T235358Z | SuperJed |
| 002 | Chinese | 140128T181849Z | Timtech |
| 012 | Xojo | 140621T184554Z | silverpi |
| nan | 150305T152654Z | captncra | |
| nan | 140130T233159Z | Benjamin | |
| 009 | Turing Machine Code | 150410T100749Z | SuperJed |
| 002 | ><> Fish | 150409T124151Z | Thijs te |
| 006 | x86 machine code | 150305T211838Z | SirPytho |
| 002 | This Programming Language | 150306T002153Z | BobTheAw |
| 004 | Marbelous | 140902T143546Z | overacto |
| 001 | LOOP | 150305T150725Z | blutoran |
| 065 | QBasic | 150305T000709Z | DLosc |
| 002 | Pyth | 141120T205640Z | izzyg |
| 006 | CJam | 141120T154313Z | Martin E |
| 016 | Shell | 140907T015209Z | Thomas J |
| 022 | PHP | 140703T213053Z | g.carval |
| 014 | CoffeeScript | 140903T222941Z | rink.att |
| 015 | Clojure | 140902T220659Z | Michael |
| 1117 | Mathematica | 140129T195400Z | Michael |
| 015 | Groovy | 140902T153640Z | Michael |
| 002 | Befunge 98 | 140902T150320Z | AndoDaan |
| 011 | k4/q | 140711T201444Z | Aaron Da |
| nan | 140711T190734Z | Adam Spe | |
| nan | 140711T163507Z | mcgrailm | |
| 018 | SCALA | 140711T132512Z | Govind S |
| 029 | C++ | 140703T222459Z | bacchusb |
| 074 | Java | 140621T183301Z | Ramasamy |
| 012 | VBA | 140703T172958Z | JesterBL |
| 007 | Bash 7 Characters | 140703T171128Z | Ian D. S |
| 016 | C# | 140624T083109Z | EvilFont |
| 013 | Bash | 140622T042338Z | Jwosty |
| 015 | Coffeescript | 140621T194635Z | zsitro |
| 004 | Bash | 140429T200604Z | Digital |
| nan | A couple of attempts for AVR | 140424T144214Z | user |
| 009 | Bash | 140423T181558Z | user2419 |
| nan | 140412T073239Z | Darkgamm | |
| 011 | J | 140311T093634Z | jpjacobs |
| 014 | ~~! 17 bytes | 140310T090618Z | cjfaure |
| 019 | Thue | 140306T063619Z | n̴̖̋h̷͉̃ |
| 072 | JAVA | 131127T221625Z | user1076 |
| 054 | Java | 131111T141825Z | Rich Smi |
| 018 | Rebol | 140214T210727Z | draegtun |
| 1519 | awk | 140214T193538Z | skibrian |
| 010 | perl | 140214T192407Z | skibrian |
| 007 | Atari 8bit Basic — | 140204T191518Z | user1525 |
| 044 | Assembly X86 | 140204T200741Z | Fez Vras |
| 014 | Groovy | 140204T194111Z | krs |
| 026 | Processing | 140204T150809Z | The Guy |
| 023 | C | 140204T150444Z | ugoren |
| 023 | JavaScript | 140204T142315Z | rahulroy |
| 008 | Brainfuck | 140204T113531Z | FIQ |
| 017 | PureBasic | 140203T225337Z | Fozzedou |
| 019 | Scala REPL | 140203T223325Z | Mika |
| nan | 140203T215721Z | markw | |
| 018 | Python 3 15 | 140203T043355Z | Mechanic |
| 002 | PDP11 Machine Code | 140128T211031Z | greggo |
| 057 | C# | 140129T223409Z | Nick |
| 012 | Windows PowerShell | 140129T223423Z | Merin Na |
| 072 | C# | 140129T222350Z | Merin Na |
| 007 | Zozotez LISP | 140129T221003Z | Sylweste |
| 013 | Bash | 140129T213839Z | Eduard F |
| 008 | PowerShell | 140127T171731Z | microbia |
| 004 | Quomplex | 131212T002009Z | Timtech |
| 013 | q/KDB | 140114T083202Z | nyi |
| 002 | Windows Batch file | 140114T164508Z | teh_sena |
| 009 | Postscript | 131213T071751Z | luser dr |
| 002 | GolfBasic 84 | 131212T002249Z | Timtech |
| 013 | Matlab | 131129T154054Z | Sven Hoh |
| 007 | APL | 131128T062028Z | TwiN |
| 060 | C# | 131127T203120Z | It's |
| 022 | F# | 131127T152806Z | goric |
| 008 | PowerShell 2.0 | 131112T021456Z | Iszi |
| 007 | dc | 131112T033422Z | r.e.s. |
| 013 | R | 131109T083448Z | plannapu |
| 014 | JavaScript | 131111T050126Z | zzzzBov |
| 015 | TCL | 131110T224816Z | user7795 |
| 024 | C | 131109T165458Z | Rozuur |
| nan | Summary Ruby 9 | 131109T022245Z | Doorknob |
| 010 | Perl | 131109T170626Z | Matthias |
| 010 | Haskell | 131109T102145Z | shiona |
| 001 | Befunge | 131109T023051Z | marinus |
| 004 | Brainfuck | 131109T022614Z | cardboar |
| 018 | Haskell | 131109T021048Z | MtnViewM |
SAKO, 23 bytes
1)LINIA
SKOCZDO1
KONIEC
Basically the same as this infinite loop solution, but additionally prints newlines.
Jalapeño, 3 bytes
‽1W
Hex-Dump of Bytecode
0 1 2 3 4 5 6 7 8 9 A B C D E F
0000: a2 31 11
Crashed my computer a few times to write it. Essentially while(1){write()}
☾, 5 chars (11 UTF-8 bytes)

➰1:☾
Prints an infinite stream of new lines, since calling ☾ (Python's print) with no arguments prints a singular new line. You could try it in the web UI, but there, it just hangs without output (it prints after halting).
Python3, 36 bytes
x=[1];[print(x.append(1))for i in x]
Malbolge (Original Interpreter), 164 46 44 bytes
Warning: This code uses non-printable characters, replace [2] by a byte containing 0x02, [8] by a byte containing 0x08, and [15] by a byte containing 0x0f
(=&`^?>=<}X98765[2][8][18][2][2][8][2][2][2][8][2][2][2][8][2][2][2][8][18]!~}|{zy[15]
1505 bytes? Using a toolchain? Surely we can torture ourselves improve this code even more by making it non-portable. This program prints the letter T forever. The technique used here is the same one used by Lou Scheffer. We try to find a good enough pattern that we can exploit for our program, and we put the goto values we want in binary as padding (When not needed, I just used o instead). Luckily, we have a pattern of printing (<) at position 3 and a pattern of data pointer jumping (j) at position 9. In the previous version of the code, I absolutely wanted these two commands to be together, which was a mistake. Here's an explanation of the normalized version of the code minus the extra bytes:
jpj -> Put some printable value in the accumulator and jump to data section
<i -> Sometimes prints and jumps to the data pointer resetting section
oooo
ji -> Sometimes rewinds the tape and jumps to the printing section
[INSERT PADDING HERE]
Malbolge and Malbolge Unshackled, 113 90 bytes
(=BA@?>=<;:381x543,1N/.-,+*)('&%$#"!~}|{zLxwvutWr1p0.--kjihgfedcF!`_^]\[ZYXWVUTSRQPONMLKig
To be honest, I wasn't completely satisfied with my first attempt, since it was using a well-known bug from the original interpreter, so I tried to rewrite it so that it would work for a regular interpreter. This took more time than I expected... Well, if you disregard the fact that I'm programming in Malbolge. Here's a short explanation of the code:
j -> Move the data pointer forward
pooooooooopopjooop -> Crazy operations in order to initialize
the right values into the data section loop
o
i -> Starts loop
oooooooooooooooooooo
/ -> Used for the first crazyop at the start
of the program
ooooo
joio<i -> MAIN LOOP: Alternates between data pointer
resetting and printing
i< -> Some values for crazyop and goto
ooooooooo
ji -> Data pointer resetting loop
oooooooooooooooooooooo
<i -> Printing loop
jbasher2, 29 bytes
while 1 < 2
output 1
endwhile
AWK, 14 bytes
{for(;;)print}
The default output for AWK is your input, so pass this any string and it prints it (on a new line) forever.
GFortran, 21 18 bytes
Endless newlines. Try it Online!
1 print*;goto1
end
Alternate solution (19B), hopefully less annoying for @Sapphire_Brick!
do;print*;enddo
end
(,), 10 Chars or \$10\times \log_{256}(3)\approx1.98\$ Bytes
(,,(),,())
x86 .COM Executable, 7
in hex:
b8 21 0e cd 10 eb fc
The others need kilobytes or more of system libraries and runtime. Back to basics:
$ echo -ne '\xb8!\xe\xcd\x10\xeb\xfc' > A.COM
$ dosbox A.COM

You can change the 2nd byte (0x21, or !) to change the output.
Uses a BIOS interrupt for output; doesn't need DOS, but I didn't have QEMU set up.
Explanation
The machine code corresponds with the following assembly:
mov ax, 0x0e21
again: int 0x10
jmp again
The output is all in the int call -- per this reference, int 0x10 with 0x0e in AH will print the byte in AL to the screen.
Knowing that register AX is a 16-bit word comprised of AH in the high byte and AL in the low byte, we can save an extra load (and thereby a byte in the machine code) by loading them together.
Motorola MC14500B Machine Code, 1.5 bytes
1BC
Explanation
1 # store data in register R
B # output R
C # JMP to the start of the program
Trilangle, unbounded memory, 3 bytes
'1!
Push a 1 to the stack, print it, repeat.
Trilangle, 4 bytes
'1,!
Push a 1 to the stack, print it, pop it off, repeat.
Trilangle -w, 1 + 2 = 3 bytes
,
When run with the -w flag or in the online interpreter, popping from an empty stack prints a warning.
Pip, 4 bytes
W1P1
Prints the number 1 with a trailing newline over and over. Attempt This Online!
This is a simple loop; in pseudocode,
while 1:
print 1
Almost any expression can be printed instead of 1. For example, W1Pr prints random floats between 0 and 1 forever.
A more interesting option, also 4 bytes:
P*,u
This constructs an infinite range starting at 0 (,u) and then prints each element of it (P*). The result is an infinite loop that outputs the natural numbers one at a time. Attempt This Online!
GHCi + Data.Function, 8 bytes
Old thread, but a fun one is
fix show
in Haskell, it prints
"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\…
forever since it's basically running
let x = show x in x
It knows that x is a string, so the first character is ", so this needs to be escaped with \", but know that \ needs to be escaped so \\\x, and so on and so on.
Windows Batch file, 9 characters
:a
goto a
Assembly (MIPS, SPIM), 8 bytes
main:j$0
This has both infinite stdout output and infinite stderr output, meaning that I have \$\infty * 2\$ output. Clearly that makes my answer twice as good as the others and I should win 😏.
Jumps to the zero register, which is an invalid address. Without macros:
main:
# Jump to the address in the zero register, which is 0
jr $zero
This causes the default exception handler to emit the following error message repeatedly while it advances the PC past the offending instruction to "solve" the problem.
Exception 6 [Bad instruction address] occurred and ignored
Exception 6 [Bad instruction address] occurred and ignored
Exception 6 [Bad instruction address] occurred and ignored
...
All while the interpreter also prints this error message to stderr:
Exception occurred at PC=0x00000000
Bad address in text read: 0x00000000
Exception occurred at PC=0x00000004
Bad address in text read: 0x00000004
Exception occurred at PC=0x00000008
Bad address in text read: 0x00000008
...
This continues until it eventually wraps to __start, jumps to main, then jumps back to 0x00000000.
Phooey, 4 bytes
=[?]
Outputs a debug dump repeatedly.
>>> DEBUG <<<
Tape: [>1<]
Stack:
>>> DEBUG <<<
Tape: [>1<]
Stack:
>>> DEBUG <<<
Tape: [>1<]
Stack:
>>> DEBUG <<<
Tape: [>1<]
Stack:
...
= tape = tape == stack
since tape and stack are 0, sets it to 1
[ While tape is not 0
? Dump debug info
] End
Phooey (interpreter bug, eventual crash), 2 bytes
<?
Based on my "Raise a SIGSEGV" entry, where an interpreter bug is used to cause an infinite printing loop.
The bug is thoroughly explained in that post.
However, as one might expect, this does eventually (and quickly) segfault. If there was no memory protection, it would run infinitely.
Pascal, 50 B
Full program compatible to ISO standard 7185 “Pascal”.
program p(output);begin while 8=8 do writeLn end.
program p(output);begin while 0=0 do write(1)end.
Some dialects such as Free Pascal do not require and actually ignore the program header (the program p(output);).
There you could omit those 18 bytes, so it’s 32 bytes in total.
Sesos, 2 bytes
0000000: 2c06 ,.
Prints an infinite amount of ones.
Try it online! Check Debug to see the generated binary code.
How it works
The binary file above has been generated by assembling the following SASM code.
set numout ; Switch to numeric output
add 1 ; Set the current cell to 1.
jmp ; Jump to the corresponding exit marker.
put ; Print the integer in the current cell to STDOUT.
; (implicit jnz)
; If the integer in the current cell is non-zero,
; jump to the previous instruction.
Oration, 21 bytes
to iterate, 1
listen,
40 bytes:
to iterate, 1
listen,
capture,
that's it
The first does print() (but it's python 2, so prints infinite ()), the second does print('') (the capture begins a string and the that's it ends it).
Retina, 4 bytes
+:`0
Doesn't match, so output 0, then it does match so output 1, now it doesn't so output 0, etc...
Quetzalcoatl, 14 chars
while 1: ::' '
This is for an older version of Quetzalcoatl.
Fuzzy Octo Guacamole, 3 bytes
(1)
Infinitely outputs 1.
Due to weird implicit output and recursive loops (it executes the code inside the loop using recursion), 1 is outputted by the implicit output.
BitCycle, 6 bytes
!~<
1^
Inspired by emanresu A's suggested golf to des54321's answer. Similarly to that answer, this outputs alternating 0s and 1s.
Explanation
The initial 1 bit is directed north into the dupneg (~). A negated copy (0) is sent west to the sink (!) and is output. A non-negated copy is sent east, whereupon it is immediately directed west again back into the dupneg. Now the original copy is sent north and leaves the playfield, while the negated copy is sent south, redirected north again, and the cycle continues forever (with the bit changing parity each time).
tinylisp, 13 bytes
(d f(q(a(f
(f
Outputs an infinite stream of errors. -1 thanks to DLosc.
The tinylisp interpreter throws a warning because a shadows the builtin a, but continues evaluation.
Pyth, 4 bytes
Pyth is a new programming lenguage, so this answer doesn't count.
.V"0
Explanation:
.V - Forever loop
"0 - Outputs zeros
Regenerate -a, 1 byte
*
Prints newlines forever :P it's finding and printing every possible match for at least 0 nothings, delimited with newlines. Surprised this isn't a syntax error.
A0A0, 43 39 bytes
A0A0
A0C3G1G1A0
A0O0A0
A0A1G-3G-3A0
G-3
Prints 0 forever. This uses a classic infinite loop which was created by the inventor of the language. Considering the only important thing about this code is that it runs infinitely, I'll use this post as an explanation of this looping construct, since it's the basis for all loops.
Loops are generally not really difficult in programming languages, even those which only have goto instructions and not proper looping constructs. A0A0 has goto instructions, so what's the problem? A0A0 is a self-modifying language which deletes the instruciton after it executes it. So if we were to use a goto to form a loop, we would simply end up at nothing and the program halts. This is not what we want.
Thankfully, the language contains instructions to modify its own code. There are two instructions that do this. A# and C# where # is a placeholder for an integer. A# appends the current line of instructions (excluding itself) to the line # positions below. C# clears the line # positions below this line. Since all integers are allowed, negative numbers can be used to go to lines above and 0 can be used to stay on the same line.
Let's take a look at the basis of the loop.
A0 A0
A0 C3 G1 G1 A0
A0 instructions here A0
A0 A1 G-3 G-3 A0
G-3
The first thing we do when entering the loop is go past four A0 instructions which append their own lines to themselves. Remember that it excludes itself, so this first A0 is not copied. This would be an issue on subsequent iterations, which is why at the very end of the loop, there is also an A0. This means that this A0 at the end is copied, which preserves the ability to copy the loop infinite amount of times.
You'll notice that the last line does not have any kind of append instruction. This is necessary, because we must at some point go back up and we can't go up if we have an A#. But if we never place a G-3 there again, we eventually will end up there and, again get stuck since there's no instruction there. This is what line 4 is for. It contains the following:
A1 G-3 G-3
It places two G-3 in line lower - at line 5. This preserves the ability for us to keep jumping back up forever. However, this line contains an A0 at the end. And during exeuciton, it may contain many more instructions we don't want. If we execute anything that is not G-3, we go to line 6 and left the loop. This is where line 2 comes into play. It contains a C3 instruction, which clears the line three lines lower. This is line 5. Because the instructions are aligned properly, this means that the line is cleared the moment we would hit an instruction that is not G-3. And since at the same point there will be another A1 G-3 G-3 on line 4, this now empty line will get two G-3 instructions again, just in time.
You may observe that, since there are also G-3 instructions on line 4, we may sometimes jump up to line 1 instead of line 2. And this is where line 1 comes into play. It only contains A0 A0. This will repeat itself infinitely on that line and acts as an infinite no-op. After executing a single instruction, the program counter automatically moves to the next line and we're back on line 2 again.
And all of this code gives us freedom on line 3. We can put whatever instructions we want in there, as long as these instructions don't modify the loop. We can even have multiple lines in the middle, as long as you change the G-3 to the appropriate amount.
Edit: Optimized by 4 bytes. It turns out that there is no minimum requirement of 3 instructions for the loop, allowing us to drop 2 instructions, totalling 4 bytes.
BitCycle, 10 bytes
!
~<
1A^
Outputs an infinite bit stream of alternating 1s and 0s, or, with the -u or -U flags, an infinite sequence of 1s.
Dyalog APL: 8 characters
Now you can choose what to infinitely print out! Yeeeay!!!
{⍞←⍵⋄∇⍵}
Brachylog, 2 bytes
ẉ⊥
Not only does it print infinitely, this prints something much more interesting than most answers here: all integers.
Explanation
Assign an integer value to the input ; since it is not constrained, it can take any
value in (-∞, +∞), meaning there is an infinite number of choice points
The way = is implemented makes it so that the order of choices it will try is:
0, 1, -1, 2, -2, 3, -3, …
ẉ Write that integer to STDOUT, followed by a linebreak
⊥ False (i.e. go back and try the next integer choice point)
Appleseed, 26 bytes
(def start!(q(_(print!(0to
Explanation
(def start! ; Define the start! event handler as
(q ; A function
(_ ; That takes any number of arguments
(print! ; And outputs
(0to ; The infinite list of all nonnegative integers
unsure, 20 bytes
um but uh okay wait
Don't try it online, it freezes the browser. Listen to the code. Even it wants you to wait. Think this through. Don't be like me. Don't lose that unsaved tab.
TRANSCRIPT, 33 bytes
You can see a f here.
>TIE F TO F
Generate endless warnings due to unclosed loop. At first it doesn't seem possible to loop infinitely in TRANSCRIPT because it only have for loops, but this works.
Headass, 2 bytes
PE
Try it here! copy and paste this: srun("PE")
Prints an infinite stream of 0s and newlines.
P Print the value of the current register (initialized at 0) + a newline
E Go to code block determined by value at current register,
Block 0 = return to start.
Headascii, 2 bytes
!E
Try it here! copy and paste this: erun("!E")
Similar to the last one, but instead of printing 0s and newlines, it just prints newlines.
! Print the value of the string register (initially empty) + a newline
E Go to code block determined by value at current register,
Block 0 = return to start.
KonamiCode, 15 bytes
v(^)L(^)<<<B(^)
Explanation:
v(^) [Writes 1 to memory address 1.]
L(^) [A loop marker]
<<< [Output the current memory address as a number]
B(^) [A reverse-jump instruction, ending the loop.]
Note: We can't use 0 for the first instruction becuase the comparison buffer is set to 0 by default. This means that the reverse-jump's condition will be fulfilled and the loop will immediately exit. However, we could also replace this instruction with S(^) and have the program run the same way.
RETURN, 62 bytes
(())(()()()()()()()()()()()()()()()()())((()()()()()()()()()))
Explanation:
(()) Add 1
(()()()()()()()()()()()()()()()()()) While nonzero repeat what's in the next group of brackets
(
(()()()()()()()()()) Put character
)
Grass, 11 bytes
Taken from original document (Japanese):
wWWwwwwWWww
How it works
In pseudo code:
function f(x){
Out("w");
return x(x);
}
f(f)
Nim, 16 bytes
while 1>0:echo 0
Arduino, 61 60 bytes
Managed to shave off one byte by changing what counts as "output".
void setup(){pinMode(13,1);digitalWrite(13,1);}void loop(){}
Explanation:
void setup() {
pinMode(13, OUTPUT); // OUTPUT is defined as 1
// Arduino boards have a built-in LED connected to pin 13, hence the choice of pin
digitalWrite(13, HIGH); // HIGH is defined as 1
}
void loop() {}
This leaves the built-in LED on, which in a sense is output.
Original answer:
void setup(){Serial.begin(300);}void loop(){Serial.print(0);}
Fills the Serial monitor with 0s.
Mascarpone, 6.875 bytes
['@.:!]v*:!
Explanation:
[ ] // push a string that will define an operation
'@. // push the symbol '@ and output it (popping it in the process)
:! // duplicate the top of the stack and execute it
v* // push a function/operation that does the above
:! // duplicate the operation, and execute it.
The operation duplicates and executes itself tail-recursively, generating the infinite output.
5 bits are sufficient for the characters used by this program, thus the total size is 55 bits, or 6.875 bytes
Dis, 1 byte.
{
Outputs infinite amount of NULL characters; may be slow, depending on the implementation.
Pushy, 3 bytes
3[_
Explanation:
3 \ pushes 3 to the stack
[ \ starts an infinite loop
_ \ prints out the contents of the stack
Jelly
2 bytes
Ȯß
How it works
Ȯß Main link. Implicit argument: 0
Ȯ Output/print the implicit argument.
ß Recursively call the main link.
Thanks to tail call optimization, this results in an actual infinite loop.
Brainf*ck (4 bytes)
+[.]
Infinitely produces 0x01 character.
[BASIC] 10 9 bytes
1?:goto 1
Infinite carriage return/line feeds. (I saved a byte when I realized I could just output new lines without a 0 or other character!)
It's the first program every BASIC programmer learnt back in the day! Good old "GOTO" and the hatred it earned from "real" programmers...
Of course, a more "structured" version would use an infinite WHILE loop, but that's 6 bytes more:
while(1):?:wend
(note:TIO truncates the output eventually, but in a standard BASIC interpreter, the code will run forever.)
Vyxal, 1 byte
∞
Don't try it online
Polyglots with 05AB1E.
Vyxal, 2 bytes
{፣
A bit more of a creative way to do the job.
ARM Thumb, Linux syscalls only, 12 bytes
Raw machine code:
2704 2001 4669 2201 df00 e7f9
Assembly:
.text
.globl _start
.thumb
.thumb_func
_start:
movs r7, #4 @ write syscall
movs r0, #1 @ STDOUT_FILENO
mov r1, sp @ sp is a valid pointer. May not be legible, but...
movs r2, #1 @ one byte is fine
svc #0 @ syscall: write(STDOUT_FILENO, sp, 1)
b _start @ loop forever
ARM Thumb, with libc, 6 bytes
Raw machine code (f7ff fffe is an unlinked libc call):
f7ff fffe e7fc
Assembly:
.text
.globl main
.thumb
.thumb_func
@ Note that putchar returns the char it put, so we do this:
@ for (;;) putchar(argc);
main:
bl putchar @ putchar(argc)
b main @ Loop forever
Fun fact: These programs do the exact same thing, printing argc % 256 in binary infinitely, since sp[0] at _start is also argc.
MAWP, 4 bytes
[!:]
Explanation:
[ start of loop
! duplicate top of stack (1)
: print top of stack
] end of loop
Prints 1 infinitely
Microsoft Word Math AutoCorrect, 4 bytes
- Add a new entry in the Math AutoCorrect table (not the regular one):
$->$$. This makes a new production rule for us. (3 bytes) - Insert an Equation (Alt + =), and type a single
$. The AutoCorrect will replace it with a$$, but that's not you inputting any extra characters, so it doesn't add to the byte count. This initializes our memory tape. (1 byte) - Press the "Professional" button under Equation Tools. This is where the program officially starts running.
- Watch the little right-moving Turing Machine freeze up Word.
Explanation
The Professional button makes the Autocorrect sweep from left to right, running the production rules. On initial state $$, it sees a $ in the first position and replaces it with $$.
- Then check the next position to the right.
- Replace
$with$$, otherwise halt. - Repeat.
Note: the GUI doesn't show the $'s being generated as the GUI doesn't update until the operation halts, which it won't here. If you open up your Task Manager, you can see the memory usage going up to see that this is indeed what's happening. Sure, I could have made it produce more $s but the production rate would still just be O(1) per loop anyway, and I'd be spending precious bytes programming it. Oh, and I'm counting the $s as output.
C, 29 28 26 23 bytes
main(){main(puts(""));}
-2 @steadybox
-3 @rtpatx
gcc won't like it, but it compiles.
Outputs null bytes continuously. You can swap out the 0 for anything 0-9.
You can use 7 if you really hate your speakers.
Brainetry --live-output, 55 bytes
Uses the --live-output flag, otherwise output to the console would be deferred to the end of the program, which never happens because we have an infinite loop going on.
a b c d
a b c d e f g h
a b c d e f g
a b c d e f g h i
This is a golfed version of this program:
Lets produce infinite output.
This is really simple, all it takes is:
A cell with a non zero value
and the --live-output flag also needs to be on.
If you want to try this, clone the linked github repo and run python brainetry.py btry/infinite_output.btry --live-output.
Vim, 10 bytes
<esc> is the byte typed when you press the escape key
qqiq<esc>@qq@q
This will output q infinitely into your vim buffer.
Here's how it works:
qq # create macro q
iq # enter insert mode and type q
<esc> # escape to normal mode
@q # make the macro call itself
q # end macro
@q # call macro q
AlphaBeta, 2 bytes
MN
Outputs infinite null bytes.
Explanation
# All registers are initialized to 0
M # Output the number in register 3
N # If register 3 is 0, goto the position at the position register.
Malbolge, 1505 bytes
b'a;$9"~}HG{iyxwuu?O=pL:]mHj5!3DCezRQ=+^:('&Y$#m!1So.QOO=v('98$65a!}^{@hyf<WV9sr%4#I20FEJVBfw)btOr@#!7~|4{y1xv.us+rp(om%lj"ig}fd"cx``uz]rwvYnslkTonPfOjiKgJeG]\EC_X]@[Z<R;VU7S6QP2N1LK-I,GF(D'BA#?>7~;:9y16w43s10)p-,l*#(i&%e#d!~``{tyxZpuXsrTTongOkdMhg`Hd]ba`_^W@[ZYXW9UNSRQPOHMLKJ-++FE''<A$?>=<;:387xw43s10/(-&m*)('&}${d!~}|^zyxwvutmVqpiRQlkjiKafedc\E`_^@\[ZYX;V9NMRQ42NGLK.IH*F?DCBA$#>7~;{{8xx5uu2rr/oo,ll)ii&f|e"!aw`{z\r[vXnmVTpongPkNihgJ_dcFa`B^]\UZ=RWV8TSLQ4ON0LE.IHA)E>'BA:?!7~5|38y6/v321q).-&m*)i'&%|{d!~}_{zs\wvutsUqTonPlOjiKgJedFbE`_A]@[Z<X;VU7S6QP22GL/JIB+FEDC%;@?>7~;:987w5v32r0)p-,+k)('~g$#"b~w|uz]xwvutsrqTinQlOjLhgfeH]bE`CB]\>ZSXWVUTSRQPON1LE.I,+*((&&$$""~~||zzxxv4u210/(-n+l)(i&g$ddy~}`u^]\ZvutVlUjSQQOOMMKgfeG]F[DBB@@>><X;99NS6QP3NG0KJ-H+F(('<%@#"~~||z876v.u,sqqoommkki'&%e{dyb``^^\\ZvuWslUjoRmlNNibgJeHcFDDY^A\[Z=XQV987553311/KJI+A*?(&BA@"8!6}{9zxx/43s1*q(ommkki'h%$ecc~}v_^][wZutWrUpohQlkNiLgIIHcbaZ_B]@[><<QVUT6L5JO2MLK.IHGF?(C&%:#!=<|:3z1xvvttr0/.n&m$ki'&f${dyb``^zyxZpYnWUUSSQmPkjLLgfedc\aD_BA?[>YXW:UTSRQJO2ML/J-H**?DC&;$?"!}}{{y765u-t+rppnn%*kii~%f#"!xa|_zyxZpYnWUqpoQgPeNLLJJHHFFDDBB@\?ZY;;PU8S6QPO1G0EJ-HGF)>C&%@#>=~;|92y65v3t1qqp-&ml)j'&gee"!x}|{z]xwYutWlqTonmPkjchgfIHFF[`_^@V?T=;;997SRQ3I2G0.JI+G@)>'%%##!!}}{987w/v-2sqq(onI*6FXDDU0S!Q>O{]sKwp$#s!Uj|nPle+vbK'_7$\n!Y|@{?=,XW:('6_^#3NlkKJIBxe?b'a;^#8[<Z|zVy0SetPb=`o'm8Hk(E3CCe@Rb`<*:sKJ%54"2DS/AQlOj)hK`HdGbn`2^Az.T<;WV87rRo#m[MLjJVyASdu&<$q"8J}}{z2xwwe3cOa/on,JH#iigCUe"yba+*)][wI$4Wr2CRRz?kN*ht9&^cF!mCB{izyx;vt8'65Q42[Z0.hI+xeRQ
This was built with Prof. Masahiko Sakai's LAL toolchain from the following source code.
PROGRAM_START_TO ENTRY@Argh
ROUTINE Argh {
REV_JMP:REV JMP
ENTRY:
OUTPUT
DUP
JMP REV_JMP
}
7, 1 byte
I
Outputs IôŸ (the bytes 49 f4 9f) repeated forever.
Explanation
In binary, I is 01001001, which is broken into 3-bit chunks to get 010 010 01. This (including the implicit trailing bit 1) is converted to octal to get the instructions 223. These instructions are executed and push 223 on the frame to get ||223.
The last section of the frame (223) is copied to the command list, and executed. 2 duplicates the last section, and the second 2 duplicates the duplicate, leaving ||223|223|223 on the frame. 3 outputs the last section of the frame, 223 (which is automatically converted to 7223 because it contains anonymous commands) and then removes the last two sections. This leaves the frame as ||223.
This process (executing 223) is repeated forever, each time adding 7223 to the output.
The very first 7 specifies the output format as "the same way the source was", meaning that each future command in the output adds three bits. This means that output consists of the bits 010 010 011 111 (from 2237) repeated forever. This is 49f in hexadecimal, so repeating it leads to the bytes 49 f4 9f 49 f4 9f ... .
Ruby, 11 9 characters
loop{p:p}
Old answer:
p 0 while 1
International Phonetic Esoteric Language, 6 bytes
10ɑeoɒ
Will print 0 with newlines forever.
Explanation:
10ɑeoɒ
10 (push the bounds for the loop: from 0 to 1)
ɑ (pop the bounds and start the loop)
e (push the current index)
o (print)
ɒ (check if index < start. 0 < 1, so loop)
Go, 59 characters
package main
import "fmt"
func main(){for{fmt.Print(0)}}
T-SQL, 15 bytes
a:PRINT 0GOTO a
6 years and 10 pages of answers, and no SQL versions yet.
Notes:
PRINTis 1 byte less than aSELECT.- A label with a goto is 1 byte shorter than the shortest
WHILEstatement:WHILE 1=1PRINT 1(you can't just doWHILE 1in SQL) - Depending on the version of SQL Management Studio, the "messages" pane (which displays the result of
PRINTstatements), might not immediately refresh; this is a client-side UI issue only.
Rabbit~, 3
]:[
Prints the number 93 (Int representation of ']') infinitely.
Inverted brackets loops while input is equal, doesn't terminate since input is always ']'
Keg, 4 characters
{A,}
This outputs "A" to the console infinitely.
Non-completing forms
This simply auto-completes the } at the end.
{A,
{🄂
This uses a later-added feature of auto-pushing & printing.
VisiCalc, 3 bytes
You need an extra newline to enter the instruction.
/-/
The trailing newline is significant.
Explanation
/ Start a command:
- Replicate forever
/ The target for replication is the / character
Extra newline to enter the instruction
You end up with a cell with an infinite number of /'s.
However, the current cell can only show a finite amount
of /'s because cells are trunctuated based on their lengths.
```
Spice, 26 bytes
Spice module that recursively calls itself. Quite quickly hits a stack overflow.
Given the code is saved to a module named 'x':
;return@OUT a;LOD .\x a a;
Un-golfed explanation
;a;return@ - define variables: "a" and the required "return"
OUT a; - output a, implicitly "[0]"
LOD .\x a a; - call this module, passing a, storing result in a
Shakespeare Programming Language, 86 bytes
8.Ajax,.Puck,.Act I:.Scene I:.[Exeunt][Enter Ajax and Puck]Ajax:Speak thy.Let usAct I.
Prints infinite literal NULs. Since all characters initialize to 0, we can just print the value of one of them and loop back to Act I. I use Jo King's trick of beginning Scene I with Exeunt to save bytes over using a second scene. Pretty simple stuff.
TSQL, 16 17 bytes
l:PRINT'1'GOTO l
WHILE 1=1PRINT'1'
bitch, 3 bytes
>/<
Explanation
> Begin loop / Print accumulator value (intialised to 0) < Loop back to beginning of loop
33, 5 bytes
1a[o]
Explanation:
1a (Set the accumulator to 1, to allow the loop to continue to run)
[o] (Print the accumulator, 1, forever)
Intercept 1.1, 37 bytes
Almost exact copy of my answer to a different question.
malware bm bitminer
software install 1
Prints newlines to the terminal. You'll probably have to leave this one overnight, as there is a delay of 5-15 minutes between each newline.
Will print infinitely as long as:
Your internet connection does not drop.
Nobody runs an antivirus program on your system.
Input is marked with a >>. The command prompt is the empty >>.
Assuming a system with only TZ_INFECT installed...
>> malware bm bitminer
creating bm (bitminer)
... wait a minute ...
finished creating bm (bitminer)
>> software install 1
Success
bm installed
...wait...
(newlines)
>>
Note that I'm using a custom client that prefixes [BROADCAST] to all broadcast events.
How???
TZ_INFECT is Intercept's malware generator. We can generate a bitminer by running malware <name> bitminer. This will create a new piece of software with the given name of type bitminer
We then install the bitminer: software install <index>, where index is the 0-based index of the software as given by software list. This is why I made sure the only piece of software on the system was the malware generator. This places our new bitminer at index 1.
There is a bug in the implementation of bitminer that results in an empty broadcast event to be sent to the client whenever bits are generated. Since bits are generated at random intervals, the broadcasts are sent at random intervals. Forever.
Note: the newlines are harder to detect using the official game client, but you can see them by running a command and watching the newlines slowly push the resulting output off the screen.
TeX, 11 bytes
The following results in an infinite amount of Undefined control sequence. errors (if run in batch mode no human interaction needed):
\def~{\[~}~
TeX, 14 bytes
The following creates a PDF with infinite lines each containing a dot (theoretically that is, since the process never terminates, the file isn't finalized so not really created). I've stopped the process after more than 1000000 pages were output. At some point memory wouldn't suffice anymore for this.
\def~{.\par~}~
PHP, 16 bytes 8 bytes
My first attempt and this Code Golf :)
while(a)
I'm sure I could make it better without that echo? hmm...
Pyth, 3 2 bytes
#d
Prints the string " " (single space) until a print instruction produces an error (which, I mean, I guess could happen).
Lua, 18 bytes
::a::print()goto a
Shortest I was able to came up with (beats any loop). Prints newlines forever.
Brain-Flak, 10 bytes
(()){(())}
I don't know if this counts as a valid answer because Brain-Flak prints the contents of the active stack and this code just fills the stack.
(()) push 1 on stack
{ while top of stack != 0
(()) push 1 on stack
}
Brian & Chuck, 8 bytes
!{?
!{.?
Brian simply restarts Chuck and Chuck sets Brian's instruction pointer to the left end, prints it and restarts Brian.
Produces endless "!!!!!!..."
Rust, 23 bytes
fn main(){loop{dbg!()}}
Outputs infinitely:
[src\main.rs:1] [src\main.rs:1] [src\main.rs:1] [src\main.rs:1] [src\main.rs:1] [src\main.rs:1]
Bitwise Cyclic Tag But Way Worse, 9 1 byte
2
Turns out that this is a valid answer, I over-complicated that way too much. Outputs endless null characters
bitch, 3 characters
Yet another answer(am I supposed to be doing that?)
>/<
This program outputs infinite 0's to the console.
The Hexadecimal Stacking Pseudo-Assembly Language (24):
000000
400000
120000
010000
Continuously prints 0s.
TeX, 14 12 bytes
\def~{x
~}~
Less infinite than the other solutions, though, as TeX writes its output to a file.
MINOL, 5 bytes
GOTO0
Any expression in MINOL that isn't entered as part of a program (that is, isn't assigned a line number by the user) is considered line 0. While seemingly not a part of the official spec (which, as far as I can tell, is a series of letters sent to and subsequently reformatted and published by 'Dr. Dobb's Journal of Computer Calisthenics and Orthodontia' in 1976), lines executed this way always seem to spit out a newline. This obviously wouldn't be the case in a full program, which would take 11 bytes (inc. the trailing CR):
1 PR:GOTO1
YABALL, 3 bytes
!.?
Explanation
! Go off of "reverse mode" (a mode where the IP goes left instead of right) if in reverse mode, otherwise no-op
. Print current cell, which is NUL
? Go in "reverse mode"
Basically an infinite loop printing NULs.
The commands are executed like so: !.?.!.?.!.? ...
TI-BASIC, 5 bytes
Disp 1:prgmA
This solution requires that the program's name is prgmA.
Displays 1 on a new line forever, or at least until the calculator runs out of free RAM.
Here's an alternative 7 byte solution that is guaranteed to never terminate:
While 1:Disp 1:End
It has the same output as the above solution.
Notes:
Each successive
prgmAcall uses up 16 bytes of free RAM.If there aren't 16 free bytes, then the program crashes with an
ERR:MEMORYerror.
Voovoos, 3 bytes
x.<
Pretty much just endlessly bounces between the . and <
. pops the top of the stack and prints it, but if you pop an empty stack in voovoos you get 0, so it just endlessly prints 0.
05AB1E, 2 bytes
Version 1 (3 bytes)
[A,
prints out the alphabet
Version 1 (2 bytes)
[,
Outputs infinite newlines
Minecraft > 1.9 2 + 5 = 7 Bytes
Note that this version of this "language" was created after the question.
Surprisingly good for MineCraft. o-o
This is using this definition of MineCraft scoring.
The command say 1 put inside of a permanently active repeating command block. It will permanently output [@] 1 to the chat.
Python: (16 characters)
while 1:print(0)
Muriel, 39 bytes
A:"\";.A;@\"A:\\\"\"+|A+A";@"A:\""+|A+A
This is near identical to the Muriel quine, except I've changed the print command in the last instruction to an eval command, and the addition of .A; in order to print something (in this case, the shortest thing was a part of the source code ("+|A+A";@"A:\""+|A+A) itself).
Gol><>, 1 byte
n
There we go, I feel like this cheats a little bit, but it works! Now to golf this more... ;)
JVM bytecode (OpenJDK asmtools JASM), 194 bytes
enum i {public static Method main:"([Ljava/lang/String;)V" stack 2 locals 1 {l:getstatic java/lang/System.out:"Ljava/io/PrintStream;";ldc 0;invokevirtual java/io/PrintStream.print:(I)V;goto l;}}
Ungolfed
enum i {
public static Method main:"([Ljava/lang/String;)V" stack 2 locals 1 {
l:
getstatic java/lang/System.out:"Ljava/io/PrintStream;";
ldc 0;
invokevirtual java/io/PrintStream.print:(I)V;
goto l;
}
}
First we get a reference to System.out, then we just invoke void print(int) with zero. Repeat until the heat death of the universe, since this method never returns.
Using enum instead of class saves 1 byte, along with using ldc 0 instead of iconst_0 to save 2 more bytes.
Bonus points for not decompiling correctly in the Fernflower decompiler, no?
Turing Machine But Way Worse, 13 bytes
0 0 1 1 0 1 0
prints chr(128),chr(128+64),chr(128+64+32),...,chr(128+64+...+2+1) infinitely.
No explanation since the code is self-explanatory.
Lean Mean Bean Machine, 5 bytes
O
$
~
Endlessly output 0
O spawns a marble, which drops and runs the operation there each tick. New marbles have a value of 0.
$ prints the marble's value.
~ teleports the marble to the top of the current column.
Aheui (esotope), 6 bytes
박망
or simillar codes with same length like following;
반망
받망
...
박맣
...
will produce infinite output.
Perl 6, 8 bytes
Thanks to nwellnhof for this solution.
.say xx*
Prints (Any) infinitely.
Perl 6, 10 bytes
1...!*.say
Defines a list that increments until the result of printing the current number is false (which never happens).
Alchemist, 10 bytes
_->_+Out_a
Explanation
Initially the universe contains the _-atom, there is only one reaction consuming _ and creating a new _ with the side-effect of printing a. This will go on until the real universe terminates.
JavaScript + HTML, 56 bytes
(g=_=>requestAnimationFrame(_=>document.writeln(g())))()
MathGolf, 4 3 bytes
Äo↔
Explanation
Ä start block of length 1
o print TOS without popping
↔ do while false without popping
Burlesque - 2 bytes
bc
bc box cycle
Rather boring. bc encloses the top of the stack in a block and then infinitely repeats this block and thus when the value is printed when the program stops it'll obviously never stop producing output.
Perl 6, 13 11 characters
Using some nice Perl6 syntax for infinite lazy lists:
.say for ^∞
The code will print all integers from 0 upto infinity or until RAM runs out to store single big integers, whichever comes first.
Taxi, 377 369 bytes
-8 bytes by getting rid of the quotes.
Go to Post Office:w 1 l 1 r 1 l.
[B]
! is waiting at Writer's Depot.
! is waiting at Writer's Depot.
! is waiting at Writer's Depot.
Go to Zoom Zoom:s 1 l 1 l 4 l 2 r.
Go to Writer's Depot:w.
Pickup a passenger going to Post Office.
Pickup a passenger going to Post Office.
Pickup a passenger going to Post Office.
Go to Post Office:n 3 r 2 r 3 r 1 l.
Switch to plan B.
The repetition of the passengers is needed for the driver to get enough fare to get enough gas to continue forever.
ORK, 170 bytes
There is such a thing as a o
A o can i
When a o is to i:
I have a scribe called W
W is to write "!"
I am to loop
When this program starts:
I have a o called O
O is to i
Objects R Kool. Maybe, but they're inconvenient (why can't I just loop the main function?).
√ å ı ¥ ® Ï Ø ¿ , 3 bytes
(o)
Will output:
===== OUTPUT =====
0 0 0 0 0 etc.
==================
followed by execution information.
TIO Compiler. Enter the code as the first input and None as the second.
Z80Golf, 0 bytes
Surprisingly, this is an empty machine code program that produces infinite output.
How it works
Z80Golf machine initializes all the memory and registers to zero, and then loads the code to address 0. But there's nothing to load, so the whole memory becomes a no-op program.
When the PC hits the address $8000 ($ indicates hex in Z80 assembly), putchar is simulated. It consists of printing the register a to stdout and a ret instruction. Initially the stack pointer sp is zero, and ret does pc <- [sp]; sp <- sp + 2. The whole memory is zeroed, so the ret always returns to the start of the program regardless of sp.
The conclusion is that an empty Z80Golf program is a program that infinitely prints null bytes.
Flobnar, 4 bytes
0,_@
Outputs 0x00 bytes indefinitely.
This works because _ is said to get the conditional from the cell on the other side of it, and then use its value to choose between the east and west cells. It is expected to be evaluated from a vertical direction, but it doesn't have to be.
@ indicates the starting point for the program and evaluates to the return value of the cell to its west (_). _ evaluates what's on the other side (0,) to print 0. , always has a return value of 0, however, and this causes the horizontal if to choose the branch to its east. This is @, which evaluates the cell to its west, continuing the cycle.
Flobnar doesn't have decimal output by default, but the linked implementation has a -d flag which enables . for decimal output. This allows a slightly prettier version that outputs printable characters instead.
0._@
Shakespeare Programming Language, 89 bytes
,.Ajax,.Puck,.Act I:.Scene I:.[Enter Ajax and Puck]Scene V:.Ajax:Speak thy!Let usScene V!
I haven't used this language before, this is mostly based on tips from "Tips for golfing in The Shakespeare Programming Language", so I think it can be made shorter.
Prolog (14 bytes)
a:-write(0),a.
Simple tail recursive predicate in swi-prolog. Called like so a.
Ahead, 1 byte
O
Prints 0 forever. O pops the stack and prints that value as a number written out (as opposed to a Unicode character). Like Befunge, the empty stack pops 0, so this will print 0.
Since this is a 1x1 board, the head has nowhere to go and will stay on this cell forever, outputting forever.
Japt, 4 bytes
i@Oo
How it works
Ui@Oo
Ui Call every 10 milliseconds...
@Oo the function that prints `undefined`.
Without input, U is initialized to zero, and 0 .i is the wrapper for setInterval JS function. According to its spec, the interval is low-capped at 10, so the target function is called every 10ms (approximately).
Oo prints its arguments to output, and with no arguments, it prints undefined.
The following is only correct with unbounded call stack (and therefore not a valid submission). When run on an actual browser, it overflows the stack in an instant.
3 bytes
ßOo
ß recursively calls the program. The whole source is translated to rp(O.o()) which first calls O.o() and then calls the program again.
HTML + JavaScript, 35 bytes
This alerts repeatedly. For some reason, it alerts 8. It also produces a 404 error in the console each iteration.
<img onerror=alert(this.src=x) src=
This is 32 bytes, but is far less interesting:
<img onerror=for(;;)alert() src=
TI-Basic, 5
Pause
It does produce infinite output; in the top right hand corner, the pixels are alternating ;)
Game Maker Language, 11
while(1){a}
The a produces errors infinitely ;)
C, 26 25 24 (no recursion)
main(){for(;;puts(""));}
Prints endless '\n' characters. This is a byte longer than the shortest C answer, but doesn't rely on tail call optimization to avoid overflowing the stack.
Gol><>, 1 byte
D
D is a command designed for debugging, which prints the entire stack (from bottom to top) between brackets. D on empty stack generates []\n to stdout, and the IP loops through the row endlessly.
Alternative solution, 1 byte
Credits to Jo King
N
Unlike ><>, Gol><> has infinite zeroes at the bottom of the stack, which allows to print the top without pushing anything. Any of Nno will do; N prints 0\n, n prints 0, and o prints null bytes.
Alternatively, there are many 2-byte solutions:
- One of
0-9a-f,l, ormfollowed by one ofNnoD; Try it online!- Any of
0-9a-fpushes a hexadecimal digit to the stack,lpushes the current stack size, andmpushes-1. Nprints the top as number with newline,nis the same without newline, andoprints as a char.
- Any of
S"; Try it online!- Initially
S"is interpreted as one command which prints the encountered chars up to ending". The next loop ofS"is interpreted as a literalSand then closing", which prints a singleSto stdout.
- Initially
"followed by any ofNnoD; Try it online!- Use
"as both opening and closing quote, then print the char.
- Use
TIS -n 1 1, 12 bytes
@0
MOV 0 ANY
Just shoves a bunch of 0\n to the output. On TIO, reached the 128KiB cutoff quite quickly. Without the -n flag, prints null bytes instead.
If you are familiar with TIS-100, you will be used to a 3x4 array of computational nodes, however, this solutions only uses one such node, nominally giving the zeroes downward as output.
The only instruction that send data out of a computational node is MOV, and that requires a source and a destination. the smallest possible source is a single digit number, and the smallest possible destination is UP. However, to produce actual output, the data needs to travel downwards, restricting the choice to either DOWN or ANY.
Stax, 3 bytes
W1P
Outputs 1 forever. Since Stax terminates when trying to peek or pop an empty stack, I am not sure how to do it in 2 bytes or less.
Seed, 4 bytes
99 5
Try it online! Outputs 11 infinitely
Generates the following Befunge-98 Program:
[glzgx"Lz^v*M7TW!4:wi/l-[, s44~s;|Sa3zb|u<B/-&<Y a@=nN>Nc%}"gq!kCW $1{2hyzABRj*glr#z(@Zx@xT=>1'.b
/
The relevant part is just this:
[>1'.b
/
b pushes 11 to the stack and . prints it. 1 and 49 are also pushed to the stack, but never actually printed.
Animation of the code running:
Shakespeare Programming Language, 116 bytes
.
Puck, a pig.
Page,.
Act I:.
Scene I:.
[Enter Puck and Page]
Page:
Open thy heart! Let us return to act I.
[Exeunt]
Will output -1 forever.
FALSE, 7 bytes
[^.^]3#
This works in some FALSE interpreters (http://www.quirkster.com/iano/js/false-js.html (Paste the code, click "show", then click "step" a bunch of times (not "run" because it's an infinite loop!))). Outputs an infinite amount of -1s.
Explanation:
Some versions of FALSE are weakly typed, so a normal number can be used as a function pointer.
[^.^] pushes a function to the stack. (specifically, the character in the code that is starts at.) In this case, it pushes the number 0.
3 Pushes the number 3, which when called as a function will start execution at the ] of the previous function (meaning that it skips all the code)
# Is a "while" loop. It pops two functions, then calls the first function (that is, the one which was PUSHED first). It then pops a value from the stack, and if this value is true, it runs the second function and repeats. If the value is false, it continues.
Our function [^.^] will first use ^ to push the next character of STDIN (if input is empty, it pushes -1), then . prints the numerical value (-1), and ^ pushes the next value of input again. This is the value which will be "returned" and used in the loop. Because it is non-zero, the second "function" is called (which is just a number pointing to a location in the code), and the interpreter immediately sees a ], causing it to return from the function.
Forth, 24 bytes
Defines then calls a word that loops forever, pushing and printing <0> each iteration.
: f begin .s 0 until ; f
With a do-loop (25 bytes):
: f 0 0 do 0 .s +loop ; f
Prints <1> 0 forever.
Chip-8, 5 bytes
Sound output counts, right?
0x6F 0xFF 'set register 15 to 255
0xFF 0x18 'set sound timer to the value of register 15
0x12 'jump to first instruction (second byte is 00 so it can be omitted)
If drawing graphics counts, 3 bytes:
0xD0 0x0F 0x12
Momema, 5 bytes
j0!j1
Try it online! Outputs to STDERR. Requires the -d interpreter flag.
The Momema interpreter has a -d (debug) flag that enables a ! instruction, which outputs some debugging information to STDERR.
Explanation
j 0 # label j0: jump past label j0 (no-op)
! # debug
j 1 # label j1: jump past label j0 (back to start)
Wumpus, 2 bytes
OO
Outputs infinite 0s
Funnily enough, even though a single O causes an infinite loop, a new command is only executed once it leaves the current cell, meaning the pointer gets trapped inside the O triangle, bouncing off the walls. Adding another cell (which could be almost any cell that doesn't end the program such as @ or %) allows the pointer to escape and execute the Output instruction again.
Forked, 1 byte
%
Prints the top of stack (0 if empty). The IP wraps upon hitting the edge of the playing field, looping infinitely.
Dreaderef, 9 8 7 bytes
5?1 1-1
Explanation:
In a more readable form (which can still be fed into the preprocessor), this program is:
numo 0
deref 1 -1
The numo (numeric output) statement does just about what you'd expect: it outputs 0. I could have used chro, but that makes it output unprintables and doesn't affect the byte count.
To understand the second line, you have to know a little bit about Dreaderef:
- Programs are loaded into the data space at the beginning of execution.
- The pointer to the current instruction is located at position
-1.
What deref 1 -1 does is:
- Dereferences 1 (takes the value of the cell at index 1). This always returns 0.
- Stores the result in cell -1, which is effectively a GOTO to instruction 0.
Dreaderef doesn't have a "load constant" instruction, so the best way to load a constant into a cell is to use some sort of arithmetic instruction or copy it from some other cell with deref, which is what I do here.
Aceto, 2 bytes
pO
p prints the top stack element (implicit 0) O returns to the origin of the program
alternate version:
nO
n prints a newline, O returns to origin
Pyth - 2 bytes
#0
Exlanation:
#0
# Loop forever
0 Print 0
sh, 3 bytes
yes
outputs y continuously
cQuents 0, 1 byte
$
Outputs 1,2,3,4,5,6... up to Python's int cap (aka as long as you have memory).
Alternately, any number would work, printing that number separated by commas infinitely:
7
This may work at some point with an empty program once I finish this language - theoretically it should print 0,0,0,0,0,0... for an empty program but I haven't implemented empty nodes.
GW-Basic, 9 bytes (tokenised)
TRON:RUN
This will output [0] until the cows come home. Actually only 3 bytes are actual tokens; here's the full content of the file:
255 unprotected
xxx xxx offset, recalculated on LOAD
0 0 line number 0
162 TRON
':' :
138 RUN
0 line terminator
You can often delete trailing zeroes, but this one was required because when GW-Basic starts up, another value is at the memory location where that zero will get loaded, so without it you'd get a syntax error.
sed 7 5 chars (version 4.2)
sed -e ':;p;b' <<<'Hello world!'
Unfortunely, this won't work anymore, from version 4.4 of GNU sed:
sed -e ':a;p;ba' <<<'Hello world!'
R, 15 chars (or 6)
repeat print(1)
or, you could cheat slightly with just
repeat
which will invisibly return NULL for each time through the loop. Thus it will return NULL infinite times, you just can't tell.
QBIC, 3 2 bytes
{?
Explanation:
{ Start a DO-loop
? PRINT nothing, followed by \n
The DO-loop is implicitly closed by QBIC.
VBScript, 23 characters
Do:Wscript.Echo"C":Loop
Needs to be run with cscript.exe for command-line output. If run with wscript.exe (default action), it opens infinite dialog boxes.
Also, here's a shorter (17 character) version which opens boxes regardless of whether it's running using cscript.exe or wscript.exe.
Do:MsgBox"C":Loop
However I'm not sure if that counts too, as it doesn't print anything and just opens dialog boxes indefinetely.
VBA, 18 Bytes
Anonymous VBE immediate window that outputs an infinite quantity of newline characters vbCrLf to the VBE immediate window
Do:DoEvents:?:Loop
J-uby, 11 Bytes
-:p|:+&1!~0
Explanation
!~ is iterate until constant: x = f(x) until x == f(x)
-:p is the global print function, and :+&1 increments a number
So -:p|:+&1 prints a number and returns the next integer
We start at 0
Evil, 4 bytes
Continuously prints the Start of Heading character:
amwb
If NUL is allowed you could do mwb.
An alternative, that goes through the ASCII characters, would be:
mawb
Quick explanation of commands:
m= marking character;a= increment accumulator;w= write accumulator to STDOUT;b= go backwards to marking character and continue execution from there.
JavaScript, 20 bytes
for(;;)console.log()
Sends infinite undefined output.
Wolfram Language ( Mathematica ) 14 bytes 12 characters
Do[Echo@1,∞]
Bitwise, 19 bytes
OUT 0 &1
JMP &-2 &1
Prints a load of null bytes. Try it online!
OUT 0 &1 prints the 0th register when a literal 1 is truthy. JMP &-2 &1 jumps back two (one) lines when a literal 1 is truthy.
I've got two:
C - 27 26 24 bytes
main(){for(;;)puts("");}
This one infinitely prints \n, due to the behavior of puts(3)
Brainfuck - 13 4 bytes
+[.]
This one infinitely prints the invisible Start Of Heading control character.
(Thanks to scottinet, Sylwester and Erik the Golfer for suggestions that helped shorten the answer)
Dyalog APL, 5 bytes
⍞←⍣⊢0
⍞← character output
(f⍣g)Y power operator repeatedly applies left operand to the argument until (f Y) g Y returns true. In this case f is the assignment to output and g is ⊢ which returns the right argument, which is always 0 as the assignment doesn't modify it.
Note that the right operand could also be any of ⊣≠≢
I hesitate to add a link to try it online :)
Cubically, 3 bytes
%0)
This should look like this:
(%0)
( open loop that can always be jumped to
%0 print 0th face sum as integer (0)
) jump back to loop regardless of faces
However, ) will just jump back to the start of the file if no jump point is provided.
AHK, 11 bytes
Loop
Send,a
Pretty boring but couldn't find an AHK answer in here and thought it worthy of submission.
Emojicode, 41 bytes
🏁🍇🔁👍🍇😀🔤.🔤🍉🍉
MOO, 39 38 bytes
while(!suspend(player:tell()))endwhile
Huge abuse of side effects; player:tell() by default does not return a value, which means it implicitly returns zero, and the resulting suspend(0) is necessary to avoid running out of ticks.
Fission 2, 2 bytes
R"
Same concept as the Befunge answer. An atom is spawned at the R, and moves right. It reaches the " and enters string mode, wraps to the beginning of the line and prints an R, then exits string mode and wraps again.
Outside of string mode, R simply changes the atom's direction to right, which is the direction it's already moving in.
Check, 3 bytes (non-competing)
#<#
Outputs infinite newlines.
Check is my new esolang. It uses a combination of 2D and 1D semantics.
Explanation
This uses a bit of a hack in the language - namely, that < means "print a newline" in 1D mode, and "move left" in 2D mode.
The IP first runs into a #, which turns it into 2D mode. However, it runs into <, which immediately points it back. It runs into the first # again and switches back to 1D mode. The IP then hits <, which outputs a newline, and then hits the second #, which switches it back to 2D mode again. The IP wraps around to the first #, where it switches back to 1D mode. It hits < again, printing another newline, and the process repeats.
shortC, 5 bytes
AWP'1
Prints 1 forever. Explanation:
A main function
W forever
P print char
'1 char '1'
Decimal, 12 bytes
11D91D30191D
Explanation:
11D ; push whatever's in RAM to the stack as an INT
91D ; declare jump 1
301 ; print
91D ; goto jump 1
Another version that does not invoke undefined behavior:
82D ; builtin - push random INT to stack
91D ; declare jump 1
301 ; print
91D ; goto jump 1
Whitespace, 16 bytes
Saves 3 bytes on the previous Whitespace answer by abusing empty labels and declaring the value 0 as a 0-bit number (the spec unfortunately requires a sign bit). Posting as a new answer as the previous answer combines multiple unrelated entries.
Explanation
(s - space, t - tab, n - newline)
nssn # Declare label ''
sssn # Push +0 onto the stack
tnst # Pop and output the stack value as a number - outputs the character '0'
nsnn # Jump to label ''
Fith, 16 bytes
{ 1 . q } :: q q
{ 1 . q } pushes to the stack an anonymous function which prints 1 then calls a function named q. :: q binds this function to the word q, then the final q calls the new infinitely-recursing function.
Non-recursive version (19 bytes):
{ 1 } { 1 . } while
This pushes a condition function, which will always push 1, and a body function, which prints 1. The while word continues to run the body as long as the condition leaves a truthy value on top of the stack.
Commodore 64/VIC-20 assembly, 8 bytes (assembled)
033C LDA #$40
033E JSR $FFD2
0341 JMP $033E
When executed with SYS 828, this will continuously output the @ character to the screen using the Kernal routine to print. If you don't care what you're outputting, then you can remove 033C LDA #$40 and save two whole bytes (the last thing in the accumulator will be outputted).
QC 6 bytes
Not competing because language is newer than the question
A00$00
A00 prints nothing(because memory is empty) and a new line
$00 jump to start(no recursion, sets instruction pointer to 00)
SmileBASIC, 6 bytes
?EXEC.
? is print, EXEC runs a program, and . is the same as 0.0.
If newlines don't count as output, here's a 7 byte answer:
?.EXEC.
?. = PRINT 0.0, EXEC. = EXEC 0.0
Commodore Basic, 5 bytes
1?:R╭
PETSCII substitution: ╭ = SHIFT+U
Prints a newline, then runs itself. Forever.
C++, 23 bytes
main(){for(;;)puts(";");}
I was too lazy, but hey, It outputs a javascript script, which does absolutely nothing!
Haxe, 19 bytes
while(1>0)trace(1);
There are several things about Haxe that make this challenge more difficult than in similar languages:
- Its lack of a
for(;;)loop - Its unwillingness to consider anything other than
trueorfalsetruthy or falsy - Its unwillingness to print an empty line (with
trace();)
If not for these things, this program might have been 15 bytes:
for(;;)trace();
Test it online here, though you may not want to, as it freezes your browser.
8th, 24 19 bytes
: f 0 . recurse ; f
The word f pushes a 0 on the stack and print it in a recursive way
PHP - 17 16 13 11 bytes
<?for(;;)echo O;
Oh well, I guess PHP can't ever always win...
Thank you, m.buettner
Edit:
<?for(;;)0/0;
As it turns out, division by zero triggers a warning in php. So, even though the output it produces goes to STDERR, it's still infinite!
Edit 2:
for(;;)0/0;
(Run with php -r)
FALSE, 8 bytes
There are many programs that work, each 8 bytes. The one I find the most interesting is:
[1$][.]#
This is a while loop (#). [1$] is the condition, and it pushes two 1s. The last is popped for the condition (true), and then [.] is executed, which prints the number.
Here are some other programs (including the above):
[1$][.]#
[1][1.]#
[1$.][]#
[^^.][]#
[^.^][]#
[^][^.]#
A more interesting 9-byte (arbitrary 1-char repeated):
['c$,][]#
I feel that the following 7-byte programs should work on some FALSE interpreters, but I haven't found any such yet:
[1"][]#
[.1][]#
Kitanai, 24 bytes
#print"0"&2&1#print"1"&~
The "#" defines a flag, the first "print" displays 0, then the "&2" jumps to the second "#", it then prints "1", goes to the origin ("&~") which is just after "&2", then it jumps to the first "#" thanks to the "&1". And it does all that infinitely :)
LOLCODE (36)
HAI IZ 1<2? VISIBLE "0" KTHX KTHXBYE
Thought I'd give LOLCODE a shot, has a surprisingly large amount of functionality.
Labyrinth, 1 byte
!
Labyrinth's stack has implicit zeroes at the bottom and the ! character outputs the integer representation of top of the stack. Since the program never finds anywhere else to go besides this single character, it keeps repeating that instruction.
Casio FX-7000G, 6 bytes
Lbl 0◢
Goto 0
This uses the calculator's own encoding, where each token is stored as a byte.
Lbl 0 sets the label of the first line to 0. The triangle means "print last value", which is in this case 0. The next line is your standard Goto statement, jumping back to the top so the value can be printed again.
Due to the calculator's limitations, the user must press EXE after each printed value before the next can be displayed.
TI-83 Hex Assembly, 6 bytes
PROGRAM:I
:AsmPrgm
:EF0A45
:C3959D
Run with Asm(prgmI). Prints garbage over and over again. The only way to stop the printing is to physically remove the batteries from the calculator and re-insert them, at which point the calculator's RAM will be cleared. I count each hex digit pair as one byte.
zsh (8 chars)
</dev/z*
Analogous to cat /dev/zero.
Note: This does depend on there not being any other files in /dev starting with z, other than /dev/zero.
Cubix, 2 bytes
.O
Cubix is a stack-based 2D language, created by me in March 2016. Cubix differs from ordinary 2D languages in that it's not strictly 2D: the code is wrapped around a cube. This program wraps to this cube net:
.
>O . . .
.
where the IP (instruction pointer) starts at the arrow. O outputs the item on top of the stack as a number; if the stack is empty, it outputs 0. . is a no-op.
When the IP reaches the right side of the cube net, it simply wraps back around to the left and runs O again. Thus, this code outputs 0 forever.
Ruby, 10 bytes
loop{puts}
This program prints out an infinite stream of newlines.
x86 .COM Executable, 5 bytes
in hex:
40 CD 29 FF E6
in asm:
inc ax
int 0x29
jmp si
Explanation:
inc ax increments the register AX by one. int 0x29 is the "fast put char" routine of MSDOS, which simply outputs the value in AL (the low part of AX) and advances the cursor by one. jmp si is just a weird way to jump back to the top, since the register SI is 0x100 on almost every DOS-like operating system, which is also where a .com program starts ;) It's also possible to do a short jump instead, which also uses 2 bytes.
Sources:
Sonic Pi, 19 Bytes
loop do puts "" end
Sonic Pi is a sound language, but it's also fully a programming language.
PHP, 9 chars
for(;;)a;
Assumes error_reporting includes notices, and you can run it like this:
php -r "for(;;)a;"
The output is the following (repeated until the script is stopped):
PHP Stack trace:
PHP 1. {main}() Command line code:0
PHP Notice: Use of undefined constant a - assumed 'a' in Command line code on line 1
Note: 11 characters if code is written in a file: <?for(;;)a;
Golfscript - 7
{1a}:a~
I'm still learing golfscript, but unless I'm mistaken, this puts 1 on the stack, then starts over?
But apparently, the stack only prints when the program terminates, so perhaps this is better:
{1.p}do
(thanks Dennis)
Woefully, 49 bytes (newer than challenge)
||| |
|| |
| |
|| |
||| |
|||| |
||||| |
|||||| |
Explanation
v v represents char pointer, instruction pointer finds first space after the char
|||A| pointed at by char pointer
||A| A- Push zero
|A|
||B|
|||B| B- Pop and print (number)
||||B|
|||||B|
||||||B|
[end] End- go back to character char pointer is pointing at. Char pointer has not moved
so it will just execute the same again
GNU sed, 5 bytes
:;l;b
Any sed script requires input to start executing. With echo|sed ':;l;b', a line with a single $ character on it is printed continuously.
Hexagony, 1 byte
This answer is non-competing, as Hexagony is newer than this challenge.
!
Prints an infinite amount of 0s by printing the value of the initial memory edge (which happens to be 0) over and over. The ! is executed in a loop because the source code is toroidal.
C, 20 bytes (competing according to the challenge's creator)
Suppose the following code is contained in e.c:
int i;
#include"e.c"
In a machine with infinite system resources, GCC will create an infinitely big temporary file trying to resolve a recursive #inclusion.
Haystack, 6 bytes (non-competing, the language came 2 years after the challenge)
>"a"o<
This will print a [infinity] times.
If the above code gives a syntax error because of the lack of | (that character is the needle. The ultimate goal of all Haystack programs is to find the needle in the haystack), one can simply append it to the end:
>"a"o<|
Brainfuck, 26 bytes
++++[>++++<-]>[>++<-]>+[.]
Do 4*4*2+1 (33, !) and the final loop is a infinite loop that only print the current memory cell (!).
APL, 4 bytes
1
→1
This code must be put in a function, since the →(goto) operator has only sense in a function.
Desmos, 1 byte
x
Graphs y=x forever.
Emotinomicon 18 bytes, 5 chars
😀⏪😀😨⏩
Explanation:
😀 - push 0 to the stack
⏪ - open loop
😀 - push 0 to the stack
😨 - pop top of the stack, and output it as a number
⏩ - end loop
As long as there's something on the stack, it's going to loop indefinitely
Burlesque - 2 Bytes
bc
basically just creates an infinite list and outputting infinite lists will obviously produce infinite output.
Don't try this in the online shell because some browsers freeze when trying to render the result because it's huge :) (at some point either the browser stops rendering or the webserver closes the stream).
Clojure, 14 bytes
(pr(cycle[1]))
Scratch, 3 bytes

(scoring used)
Adds a blank item to list = repeatedly and indefinitely.
Come Here, 21 bytes
COME FROM1 1TELL1NEXT
In the reference implementation, this prints infinitely many smiley characters. Don't ask me why.
Reng v.1.2, 1 byte
n
Pops N and prints N. N is always zero, popping off the empty stack.
BASTARD 30 Bytes
{(., <> {fi out {t 0}(.)})(.)}
This makes use of a few things that are still in question with the spec, but I'm the authour, so what the hell.
Note: BASTARD is still under development, and I haven't finished the spec, or even a rough REPL, so it probably should be disqualified for everything.
Explanation:
- Everything has to sit in a
{}block. - We define a function called
.that takes no arguments. - The function prints an undefined variable from the stack, which equates to
'nil'. - The function also calls itself, thus an infinite loop.
- We call the infinite function.
Note: Anonymous functions may or may not be introduced in the future. The current syntax proposed would reduce the above to 24 bytes:
{(<> {fi out {t 0}(@)})}
The only new concept here is @, which is a self-reference to the anonymous function.
Pylons, 5
wp,1}
While 1, print the (empty) stack.
ForceLang, 23 bytes
label l
io.write goto l
Looks weird, but it works. The key here is that goto does not interrupt the evaluation of the current line, and returns nil.
Python, 17 13
while 1:print
Thanks to Ben and r.e.s.
R, 15 bytes
Infinitely prints 1
while(T)cat(1)
Bitxtreme, 0.25 bytes
Binary representation:
00
From the documentation:
The first bit of each pair is a pointer to the memory position which holds the value to subtract from the accumulator. The result is stored in that same memory position pointed to by the operand. If the result is negative (the bits are in two's complement representation) then the second bit of the pair will be added to the current PC, modulo 2.
The program counter and accumulator are initialized to zero; then, the contents of memory location 0 are subtracted from the accumulator. This happens to be 0, leaving the accumulator at zero. Since there was no carry, the second bit is not added to the program counter.
The program counter is then incremented by 2 modulo 2, sending it back to the start, and causing an infinite loop. At each step, the special memory location 0 is modified, causing its contents (a 0) to be written to output.
It can be argued that this program should be scored as 1 byte, because the official interpreter in Python requires zero-padding. However, I don't think the zero-padding is really code.
C, 25 bytes
main(){while(puts("1"));}
Detour, 1 bytes
,
, outputs its contents, and passes it on to the next cell (,). In the event of not being given input, a 0 will be passed in.
PlatyPar, 3 Bytes
1WA
Explanation:
1 ## push 1 to the stack
W ## while(stack[-1])
A ## alert(stack[-1])
Works the same as my truth machine, except manually inputting the 1 instead of asking for it.
Mouse-2002, 3 bytes
(0!)
prints 0 forever.
Alternatively, for a more interesting and (theoretically) infinite error with no loop, the Ackermann Function in 99 bytes in this language:
"M>"?a:"N>"?b:#Y,a.b.;$Y1%n:2%m:m.0=k:n.0=j:j.k.>[n.1+!|j.k.<[#Y,m.1-,1;!|#Y,m.1-,#Y,n.,n.1-;;!]]]@
Expanded:
"M>" ? a:
"N>" ? b:
1 a:
1 b:
#Y, a. b.;!
$Y 1% n: 2% m: ~ ack
m. 0 = k: ~ store whether m == 0 in k
n. 0 = j:
j. k. > [ ~ if y>x
n.1+ ~ print it
| j. k. < [ ~ if x>y
#Y, m. 1-, 1;
| #Y, m. 1-, #Y, m.,n. 1-;;!
]
]
]
@
$
Errors recursively, forever, as long as the input was a positive nonzero integer. (result of a bug in the interpreter: the code is correct!)
Javascript ES6, 28 bytes
setInterval`console.log()`
I didn't want to code an infinite for loop like everyone else...
Try it here using anything BUT Firefox.
ArnoldC, 81 bytes
IT'S SHOWTIME
STICK AROUND 1
TALK TO THE HAND 0
CHILL
YOU HAVE BEEN TERMINATED
Prints 0 forever.
Explanation
IT'S SHOWTIME # start program
STICK AROUND 1 # infinite while loop (since 1!=0)
TALK TO THE HAND 0 # print 0
CHILL # end loop
YOU HAVE BEEN TERMINATED # end program
BotEngine, 1x3=3
Noncompeting as BotEngine is much too recent a language. Anyway, here we go:
>CT
It starts with a right-moving bot on the >. When it reaches the C, it creates a left-moving bot (which starts on the C.) On the next step, the left-moving bot reaches the > and is turned around to move right and the right-moving bot reaches the T, destroying itself and printing TRUE. The step after that, the other bot gets to the C starting the process over again.
>CF also works but prints FALSE instead of TRUE. Using P in this case would print empty lines instead.
Simplefunge, 3 chars
Does it count if, you know, it is your own language?
>o<
Prints 0 over and over again, as the tape is initialized as a tape of infinite zeros.
Self-modifying Brainfuck, 4 bytes
Prints ] forever. Note that the traditional BF programs work as well.
<[.]
The pointer starts one to the right of the source code on the tape, so moving left once puts the pointer at ].
GoLunar, 4 bytes
This is the equivalent of 5543 zeros in a row in Unary, which is equivalent to +[.] in BrainF***.
5543
><> Fish - 2 characters, I'm counting the shortest one.
Thijs beat me to it, but oh well. Here are a couple more ><> answers.
1n
-Infinite 1's, 2 bytes
>"drlow ,olleH"l
?
!
^ <
o
-Infinite "Hello, world", 84 bytes.
Edit: Whoops. It's character count, not bytecount. I also fixed the first answer. Edit 2: Thanks mbomb007 for shaving off 1 character.
Turing Machine - 6 Characters :
#s->1Rs
where # is blank symbol (on the tape by default), s describes the only existing (start) state, 1 is printing a digit, R means shifting to the right, s at the end is staying in the same state.
Windows Batch File, 1 character
Create a file called a.bat containing:
a
When you execute this batch file, it executes itself. The Windows Command Prompt by default echos every command to the console, so the output resembles:
C:\>a
C:\>a
C:\>a
C:\>a
Bat, 2 chars
%0
The output is (starting from a blank line, I've added nbsp to make it visible bellow)
d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"
d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"
d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"
d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"
d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"
d:\Temp\Supertemp>"D:\Temp\Supertemp\inf.bat"
Qt 5.4 QMake pro file, 42 chars
defineReplace(A){log(A)return($$A())}$$A()
Is an infinite loop, but sadly gets caught out by qmake interpreter before it can get very far.
AAAA[...]Ran into infinite recursion (depth > 100).
Not sure if that counts under disqualification.
Cardinal, 3 characters
.%$
Explanation:
. print active value
% start pointers here
$ jump to x,y = active, inactive value
.%$
Pointers spread out in all cardinal directions from every %
All pointers carry two values, initialized to 0. The upper value is
called the active value, and it can be accessed directly. The lower
value is called inactive value. Inactive values can only be accessed
by flipping both values, switching the active to inactive, and the
inactive to active, or by using instructions like $ that grab the
inactive value directly to e.g. execute a jump.
The < and > below the values are the positional and directional
markers of the pointers. In programs, they instruct pointers to change
the movement direction.
0 0 At this step, the first active value (from the left pointer)
0 0 gets printed in the console, the right pointer is going to
<%> jump to x,y=0,0
0 The jumped (former left) pointer prints out the next 0
0
>%$
0
0 ... travels on ...
.>$
0
0
.%> ... reaches the jump instruction again, going to jump to 0,0 again
0
0
>%$ ... print out the next 0... and so on, to infinity.
Piet, 3 codels
==>
<== here it is ;)
Just to make it visible, the same at codel size 10:

This program bounces forward and backward, executing:
forward direction:
1
PSH (push on stack)
OUN (output number)
backward direction:
MUL (multiply)
POP (pop from stack)
The backward instructions are ignored because the stack is empty.
So, the program prints an infinite amount of 1’s in the console.
Edit: I just noticed that captncraig came up with the same answer before me. Sorry for that. Please upvote captncraig’s answer instead.
Haskell, 9 characters
show[1..]
Prints an infinite list of integers starting from 1, exploiting the lazy evaluation of Haskell.
Mathematica, 34 33 bytes
$IterationLimit=∞;#0@Print@1&[]
If there were no limitation on the maximum length of evaluation chain in Mathematica, #0@Print@1&[] is only 13 bytes, 4 bytes shorter than For[,0<1,Print@1].
I haven't seen Thue used here much, so here we go:
Thue (22 19 bytes)
a::=ab b::=~1 ::= a
Xojo, 18 12 chars
Again, please don't actually run this (same reason as the JavaScript answer):
do
Beep
loop
Never said the output couldn't be audio...
piet - 3 codels

Outputs an infinite number of 1's
Piet (135 codels/pixels)
Prints an infinite sequence of $ signs (arbitrary, could've been anything. Loaded in the upper right corner of course).

Run with npiet -v11 the.gif
Turing Machine Code (9)
(This is the dialect of turing machine code used by many online turing machine simulators)
0 * 1 r *
It will endlessly ouput ones while moving rightward along the tape.
><> (Fish), 2
A creative way to use the infinite codebox of fish:
"o
Because the instruction pointer returns back to the beginning of the line after reaching the end, this code can essentially be read as
"o"o
which means 'read the string "o" and then output it'.
x86 machine code, 6 bytes
b40e cd10 ebfc
Assembly version of the code:
mov ah, 0Eh; bios teletype output
code_golf:
int 10h; print character(ascii 0)
jmp code_golf; loop
This code constantly prints ASCII 0 (NULL).
This was run using DOSBOX
Marbelous 4
24MB
Marbelous does surprisingy well here. This will post an infinite amount of dollar signs $, though it will hit the stack limit rather quickly.
How it works.
24 is a language literal, which will fall off the board and be printed to STDOUT as its corresponding ascii character. MB is the name implicitly given to the main board, since the main board has no input, it will fire every tick. And since cells are evaluated from left to right, the literal will always be printed before the next recursive call.
So this is rougly equivalent to this pseudocode:
MB() {
print('$');
while(true) MB();
}
A solution without infinite recursion 11
24@0
@0/\..
This one works by looping the literal between two portals @0, whenever the 24 hits the lower @0 it is transported to the cell underneath the upper @0. It the lands on the /\, which is a clone operator, it puts one copy of the marble (literal) on it's left (back on the portal) and another one to its right. This coopy then falls off the board (since .. is an empty cell) and gets printed to STDOUT.
In pseudocode, this would translate to:
MB() {
while(true) print '$'
}
A shorter solution without infinite recursion 9
24
\\/\..
This one constantly tosses the marble around between a cloner and a deflector, putting one copy on the rightmost cell, to be dropped off the board. In pseudocode that would look something like:
MB() {
List charlist = ['$'];
while(true) {
charlist.add(charlist[0];
charlist.add(charlist[0];
charlist.pop();
print(charlist.pop());
// Wait, what?
}
}
note
The .. cells are necessary on the two last boards since the marbles would land off the board (and be discarded) otherwise. For some extra fun, you replace the 24 marble by FF and the empty .. cell by a ??, which turns any marble into a marble between 0 and it's current value before dropping it down. Guess what that would look like on STDOUT.
QBasic, 6 (5?) characters
?1:RUN
? is short for PRINT, and RUN without arguments runs the current file from the top. This is the shortest (and most interesting) way to get an infinite loop in QBasic.
If, as in the accepted answer, infinite newlines count, then I present this 5-character version:
?:RUN
Pyth, 2
#G
(or # followed by any normal variable, actually).
# is while True. Variables are printed implicitly, and since G is 'abcdefghijklmnopqrstuvwxyz', that gets printed infinitely.
CJam, 6 bytes
1{1p}h
or
{1p1}g
which prints an infinite number of 1\n without risk of stack overflow (as there's no recursion).
I think CJam might be younger than the question, but this answer isn't a winner, so I don't see any harm.
Shell, 16 Chars
cat /dev/urandom
PHP: 22 chars
<?PHP while(true){print(0);} ?>
My first golf, hope I did it right :)
It will hang your browser if you do it on a PHP page, but from the command line it does the expected: prints something until you get bored and stop it.
CoffeeScript, 14
Pretty unoriginal and similar to JavaScript:
alert 6while 1
Clojure - 18 15 chars
(while 1(pr 1))
Mathematica, 11 bytes (invisible) or 17 bytes (visible)
Clearly not going to win here, but it works
For[,0<1,1]
If you actually want to see the characters streaming down the screen, use
For[,0<1,Print@1]
(20 bytes). I had thought I might do well with
Range@∞
or even
1~Table~{∞}
But to my surprise, the Kernel checks for infinite bounds and disallows them.
Groovy - 15 chars
for(;;)print 1
Befunge 98 - 2
,"
Outputs ",,,,,,,,,,," for eternity.
k4/q (11)
{x}{x""}/-1
The second function, {x""}, sends the empty string to x. If x is an integer, it's interpreted as a file descriptor. If x is 1 or 2, this means to print to stdout or stderr. If x is -1 or -2, this means to additionally print a newline. The result of sending a string to a file descriptor is that file descriptor.
The first function {x} is an idempotent function. (k has an actual idempotent function, ::, but in this context, it would have to be written (::), so this is shorter.)
The construct g f/x, where g and f are functions, is a variation on functional "fold": f x is called, then g f x is tested as a boolean; if it is false, execution stops; if not, f is called on the result of the prior call. (The return value is the result of the last call to f.) Every integer but 0 is truthy, so the -1 returned by {x""} -1 allows the execution to continue.
As a bonus, and at no extra character cost, if you swap the / for a \, you'll waste infinite amounts of RAM too: g f\x does the same thing, but it saves all the intermediate results as it runs--its return value is the full list of intermediate returns of f.
Just for fun, here's another alternate version. It's the same length, but only valid in k (not q):
`{x}{x@$x}/1`
This one prints "1"s forever, through more or less the same method, but a couple details are slightly different.
BASIC
10 PRINT "HELLO WORLD"
20 GOTO 10
AppleScript:
repeat until 1 < 0
say "hi"
end repeat
SCALA 18
while(1>0)print(1)
C++ 29
main(){while(1)std::cout<<1;}
Java, 74 characters
Since Java 7 and later versions seeks for main function at first instead of static block; I think this would be the best option to print infinite loops with small code. For your reference: static block won't execute in Java 7.
class I{public static void main(String[]a){for(;;)System.out.println(1);}}
VBA: 12
Audio is output, right?
do:beep:loop
Put that in your 'favorite' coworker's favorite macro-enabled MS office file for some 'fun'!
Private Sub Workbook_Open()
Do:Beep:Loop
End Sub
Bonus points if they're using headphones.
Bash - 7 Characters
echo
$0
Prints endless newlines, at least until your computer crashes.
C# (16)
Directly executable in LinqPad:
for(;;)0.Dump();
Bash - 13
cat /dev/zero
OK, not the shortest, but I'm surprised this isn't here already.
Coffeescript 15
alert 0 while 1
Bash, 4 bytes
$0&$
Outputs ./forever2.sh: line 1: $: command not found continuously.
Because $0 is backgrounded, each parent dies after the invalid command $, and so stack/memory is not eaten up, and this should continue indefinitely.
Strangely the output gets slower and slower over time. top reports that system CPU usage is close to 100%, but there are memory- or CPU-hog processes. Presumably some resource allocation in the kernel gets less and less efficient.
A couple of attempts for AVR, starting with one of the older MEGA/TINY models:
inc r1
out DIRC, r0
out DIRC, r1
rjmp .-2
And for XMEGA:
inc r0
sts PORTC_DIR, r0
rjmp .-2
Both of these rely on registers being cleared at reset. The output is toggling the direction of PORTC pin 0 (input/output). You need to connect a pull-up resistor to this pin to create a square wave.
Bash, 9 characters
echo 1;$0
Because the $0 variable always holds the filename.
Brainfuck - 6/4
Brainfuck does this easily:
-[.>-]
If we assume that the interpreter didn't zero the cells on startup but instead gave us already-initialised cells, the count goes down by two:
[.>]
J 11
echo@-^:_]1
Outputs 0's because inversion (-) does not converge when repeated ad infinitum (^:_).
~-~! - 17 bytes, with cheating 14 bytes
'=|@*:'&*|:'&|.|:
~-~! has a very limited set of characters, and does not support explicit numbers, so yeah. Outputs infinite .s.
If I sway the rules a bit and have the user input the character to be output infinitely, I can have 15 bytes:
'=|@*:'&*|:'&^:
Depending on the implementation, the last : for both of these can be left out, lowering the byte counts to 16 and 14.
Thue, 19
b::=~1
a::=ba
::=
a
The code prints an infinite stream of 1's.
The code is quite simple and easy to understand.
bcan be expanded as "output 1" (then b is replaced with empty string)acan be expanded as/replaced byba::=on its own ends the list of rulesaon the last line represents the initial state.
JAVA - 72 chars:
counting everything:
class T{public static void main(String[]a){for(;;)System.out.print(0);}}
Obviously, Java was not built for code golfing.
Java, 54 characters
Best attempt in Java:
class A{static{for(int i=0;i<1;)System.out.print(1);}}
Rebol, 18 chars
forever[print now]
Can shave off 1 perhaps even 2 more characters by choosing something different to now (for eg. pi).
However I like that it prints the time forever :)
awk, 15/19 chars
Canonical version, 19 characters:
BEGIN{for(;;)print}
Version requiring user input (one newline will do), 14 chars (scores as 15 because of the required input):
{for(;;)print}
perl, 10 chars
Here's another 10 char perl solution with some different tradeoffs. Specifically, it doesn't require the -n flag or user input to start. However, it does keep eating memory ad infinitum.
warn;do$0
save to a file, execute that file and you get eg:
Warning: something's wrong at /tmp/foo.pl line 1.
Warning: something's wrong at /tmp/foo.pl line 1.
Warning: something's wrong at /tmp/foo.pl line 1.
Atari 8-bit Basic — 7 characters
1L.:G.1
This is what you can type. Internally, it expands to:
1 LIST : GOTO 1
In Atari 8-bit Basic you can use LIST in a program.
I seem to remember this shorter sequence:
1L.:R.
Which expands to:
1 LIST : RUN
This would work, but I'm not sure if R. corresponds to RUN.
Assembly X86 - 44
Ok Im not a geek with assembly x86 but I wanted just to add this as a possible solution. COnsidering the number of dependencies needed by assembly code this code should be the shortest, a simple infinite loop that prints "x":
loop:
movl $120, %rdi
call putchar
jmp loop
Groovy, 14
for(;;)print 1
from the command line: groovy -e "for(;;)print 1"
Processing, 26
for(int i=0;i<1;)print(1);
Prints 1 continuously.
C, 23 chars
Slightly shorter than the best C/C++ answer so far. Prints empty lines infinitely (but if compiled without optimizations, overflows the stack).
main(){main(puts(""));}
JavaScript, 23 characters
while(1)console.log(1);
Brainfuck, 8 bytes
+[[+.]+]
Assumes wrapping.
I'm aware that a solution was already posted by @cardboard_box - allthough his doesn't print any printable characters.
PureBasic - 17 chars
r:
Debug 0
Goto r
A slight variation on the classic BASIC infinite loop :-)
Scala REPL (19 characters)
while(true)print(1)
Clojure
(repeat 1)
Returns a lazy seq of 1's '(1 1 1 1 1 1 1 1 1 1 ...)
Python 3: 15, 17, or 18 characters
mdeitrick's answer is longer in Python 3, which replaces the print statement with a function call (15 chars):
while 1:print()
This remains the shortest I've found in Python 3. However, there are some more-interesting ways of printing in an infinite loop that are only a few characters longer.
print()returnsNone, which != 9, making it an infinite loop; the8is a no-op that substitutes forpass(18 chars):while print()!=9:8iter(print, 9)defines an iterable that returns the output ofprint()until it equals9(which never happens).anyconsumes the input iterable looking for a true value, which never arrives sinceprint()always returnsNone. (You could also usesetto the same effect.)any(iter(print,9))Or, we can consumer the iterable by testing whether it contains
8(17 chars):8in iter(print,9)Or, unpack it using the splat operator:
*_,=iter(print,9)The weirdest way I thought of is to use splat destructuring inside a function call,
function(*iterable). It seems that Python tries to consume the entire iterable before even attempting the function call—even if the function call is bogus. This means that we don't even need a real function, because the type error will only be thrown after the iterable is exhausted (i.e. never):8(*iter(print,9))
PDP-11 Machine Code: 2 bytes (or 6 if you actually want output)
mov -(pc),-(sp) ; octal opcode = 014746
On many PDP-11's, this instruction will actually do what it says - back the PC up, push its own opcode onto the stack, and repeat until all 64K ram is used up and then just keep filling circularly (or until something like a segfault happens). Not really infinite output, but it's in the spirit.
In 6 bytes you could do this, sending characters directly to the console
mov #SerialPortTxRegAddr,r0 ; oct= 012700 177562 hex = 0x15C0 0xFF72
movb -(pc),(r0) ; oct= 114710 hex = 0x99C8
Which would send a series of 0xC8 characters (these would be probably be seen as 'H' by any terminal which would be attached to the PDP-11)
Yes, I'm actually that old :-)
C#, 57
Another C# entry, with a twist:
class M{static int Main(){for(;;)System.Console.Beep();}}
This interpretation of "output" may be stretching, but still valid I think (and saves 4 characters! :)
Windows PowerShell (12)
for(;;){'-'}
C# (72)
using System; class P {static void Main(){for(;;) Console.Write('-');}}
Output

Zozotez LISP: 7
When started with the minimal interactive session dictated in the documentation:
(:'r p)
How it works is that it redefined read so the REPL prints what print returns rather than keyboard input. The never ending output is continious lines of: Zozotez-moi~>NILNIL
When started with the full interactive session it gets longer, but does the same (10 bytes):
(:'read p)
Without a bootstrap Zozotez does just (eval(read)) thus we need to implement a loop in one expression (16 bytes):
((:'z(\()(p)(z))))
The : is set to it binds z to the lambda expression (\()(p)(z)), when called without arguments calls print (p) with default argument NIL, then calls z (recurses).
: returns the value (the function) so wrapping it all in parenthesis makes the initial call.
Common Lisp: 15
(loop(print())) ; prints infinite lines of NIL
Racket: 21
(let z()(print'N)(z))
Works similar. The names let makes and calls the proecdure l that takes no arguments. The body prints N, then recurses. print without arguments displays data quoted so it prints 'N'N'N....
Scheme: 23
(let z()(display'N)(z))
Same as Racket version only that display is used which don't quote output. NNNN...
Bash - 13 bytes
cat /dev/zero
to see run cat -v /dev/zero
Documentation here: /dev/zero and here Purpose of /dev/zero?
PowerShell (8)
Save "a.ps1" file with following script code:
1
.\a.ps1
from command line run the script.
My initial solution was different, but I found that it has already been answered by Iszi.
I managed to write another solution with same byte length.
q/KDB, 13 chars
while[1;0N!1]
Outputs
1
forever.
For more information on q/KDB :
Another Solution:
{0N!1}/[0<;1]
Windows Batch file, 2 chars
%0
Calls itself infinitely.
Postscript 9
{1 =}loop
Output 1 in an infinite loop.
Golf-Basic 84, 2 characters
p`
Causes upper-right line of 5 pixels to alternate continuously.
Matlab, 13
while 1
1
end
This prints
ans =
1
infinitely many times.
APL, 7
{∇⎕←⍵}1
Defines a function which output its argument and call itself with the same argument, then call it once with argument 1
C#, 60
class A{static void Main(){for(;;System.Console.Write(1));}}
F# - 22
while 1=1 do printf"x"
PowerShell 2.0: 17 11 8
My initial solution:
while(1 -eq 1){1}
Thanks to r.e.s.:
while(1){1}
I think Danko Durbić has the winner, here. I'm not even sure why this should work, but it does and I can't think of anything shorter so far.
for(){1}
R, 13 characters
repeat cat(1)
JavaScript: 14
WARNING: you really don't want to run this in your browser
for(;;)alert()
TCL (15)
while 1 puts\ x
(kind'a silly that we must write at least 30 characters per reply :)
C, 25 24
main(){main(puts("1"));}
Summary: Ruby - 9, Golfscript - 6, ><> - 2, Whitespace - 19, Perl - 2
One language I know, and two I've never, ever, used before :D
EDIT: Perl one didn't work when I installed Perl to try it :(
Ruby, 9
loop{p 1}
Simply prints 1 on separate lines continually.
Also, a bunch of alternatives:
loop{p''} # prints [ "" ] on separate lines continually
loop{p p} # prints [ nil ] on separate lines continually
10-char solution:
p 1while 1
I was actually surprised that I could remove the space between the first 1 and the while, but apparently it works
Golfscript, 6
{1p}do
My first Golfscript program! :P
><> (Fish), 2
1n
Whitespace, 19
lssslssstltlsslslsl
Where s represents a space, t represents a tab, and l a linefeed.
Perl, 10 chars
TIMTOWTDI:
$ perl -nE 'say;redo' <input> # 10 chars (1+8+1)
$ perl -E 'say while+1' # 11 chars
$ perl -E 'o:say;goto o' # 12 chars
$ perl -E 'for(;;){say}' # 12 chars
$ cat inf.pl
warn;exec$^X,$0 # 15 chars
If you have infinite RAM (maybe in the cloud ;-)
$ perl -E 'sub o{say;&o}o' # 14 chars
$ perl -E '&{*1=sub{say;&1}}' # 17 chars, just kidding *gg*
Haskell, 10
print[1..]
I think this is the shortest code to
- Print something out.
- Create an infinite
Show:able datastructure.
For those interested, it prints:
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,...
Befunge (1)
.
Outputs 0 forever. It works because in Befunge lines wrap around, and you get 0 if you pop from the empty stack.
Brainfuck, 4
+[.]
Alternatively,
-[.]
Haskell, 18 chars
a=1:a;main=print a
N.B.: No new line at end!




