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.
CJam arrived in 2014, written in Java by the Code Golf Stack Exchange user aditsu as a faster, extended successor to GolfScript. It is a stack-based golfing language: single characters push values, operators consume the stack, and whatever remains is printed when the program ends. Compared with its ancestor it added proper floating point, more block and array operations, and a large set of two-character extensions under the e prefix. For several years CJam and Pyth traded blows at the top of Code Golf Stack Exchange leaderboards before the codepage generation of Jelly and 05AB1E took over. XCODX gives you the JVM interpreter inside an actual terminal, so stack programs that read stdin can be fed input as they run, with nothing to install.
e# CJam prints whatever is left on the stack when the program ends
"Hello, World!"
CJam is still a productive choice for stack-flavored golf: string manipulation, base conversion, and array folding challenges golf down well with its one-character operators. It is also a gentler on-ramp to concatenative thinking than Forth, since you can watch the stack shape a computation line by line. Golf historians and esolang fans run classic CJam answers from the 2014 to 2016 era here to study how pre-codepage golfing languages worked.
CJam deliberately borrows GolfScript's stack model and much of its syntax, so simple programs look alike. The differences are practical: CJam runs on the JVM and is far faster, has real floating-point numbers, regular expressions via Java, more built-in operators, and extended commands prefixed with e. GolfScript, implemented in Ruby in 2007, is slower and smaller but historically first.
Not implicitly. Operators do the reading: q pushes all of standard input as one string, l reads a single line, and r reads one whitespace-separated token. From there you split and cast as needed, for example q~ to read and evaluate. Because XCODX runs a live terminal, a program using l will pause and wait for the line you type.
It can still win language-restricted or algorithm-heavy challenges, but against Jelly, 05AB1E, and Vyxal it usually loses a few bytes because those languages pack 256 operations into a custom codepage and include dictionary compression. Development stopped years ago, yet the interpreter remains stable, and thousands of existing answers make it one of the best-documented golfing languages to learn from.
main.cjamplain text — no highlighter ships for this languageno standard input construct"Hello from CJam!"