Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Code golf as a language-design problem essentially starts with GolfScript, which Darren Smith published in 2007 as a stack-based language implemented in Ruby. Every printable character is an operator or literal, blocks are first-class, and the interpreter prints whatever remains on the stack at exit, so many answers need no explicit output at all. GolfScript dominated Anarchy Golf and the early years of Code Golf Stack Exchange, and its stack model directly inspired CJam, and through it much of the modern golfing-language family tree. On XCODX the Ruby interpreter runs inside an authentic terminal, so programs that slurp stdin get your typed input live and there is no local Ruby environment to configure.
# GolfScript prints whatever remains on the stack when the program ends
"Hello, World!"
GolfScript remains a fine daily driver for string and list golf: fold, map, and zip are single characters, and implicit output trims the boilerplate that kills scores in mainstream languages. It is also the natural starting point for anyone studying golfing-language history before moving to CJam, Pyth, or the codepage generation. Teachers use it to introduce concatenative programming, since the whole semantics is visible as values moving through one stack.
Every design decision serves byte count: one-character operators, implicit stdin available as a string, implicit printing of the final stack, and heavy operator overloading so the same symbol acts sensibly on numbers, arrays, strings, and blocks. There are no keywords and almost no mandatory syntax, so program length approaches the information content of the algorithm itself.
Yes, though it rarely tops leaderboards anymore. Jelly, 05AB1E, and Vyxal typically beat it thanks to larger built-in vocabularies and compression. It still appears in new answers because it is easy to learn, well documented by thousands of old solutions, and occasionally optimal for stack-shuffling problems. On Anarchy Golf it retains a strong historical record.
All of standard input is read at program start and placed on the stack as a single string, so a program that begins executing already holds its input. Golfers then split on newlines or spaces and evaluate numbers as needed. If nothing consumes it, the input string simply gets printed back out as part of the final stack.
main.gsplain text — no highlighter ships for this languageno standard input construct"Hello from GolfScript!"