Brooklyn · Atlanta · MIT Forever
A programming language built the way Run The Jewels makes music.
Two cities. Two voices. One compiler.
Legend Has It
RTJ3 · Track 1 · 2016
El-P is from Brooklyn. Killer Mike is from Atlanta. They make music that sounds like neither city alone — dense, righteous, mechanical, earned. Two voices that shouldn't work together, and then do, completely.
The philosophy behind the languageCode The Jewels is a transpiled programming language. You write .rtj files. The compiler — written in TypeScript — turns them into clean JavaScript. Every design decision traces to a song, an album, a lyric, or a city. This is not superficial theming. The language is built the way RTJ makes music: two halves that require each other.
The stdlib modules are named after cities. The composition construct is named after the duo. The compiler stages are named after the RTJ logo. The whole thing is free, because RTJ releases their albums for free. Code The Jewels is MIT licensed. Always will be.
A Report to the Shareholders
13 keywords · every one has an origin
Every reserved word in Code The Jewels traces back to something in the RTJ catalog. Nothing was named arbitrarily.
rtj run.You run a program. You run a loop. You run the jewels. Everything is a run.yankee and the brave (ep. 4)
RTJ4 · Track 1 · 2020
The opening track of RTJ4. Mike is the Yankee. El is the Brave. Two perspectives, one statement. Neither makes sense without the other. The duo() construct works exactly the same way.
yankee and the brave (ep. 4) — RTJ4The construct
mike runs first — the opening verse, sets the tone. el receives what mike produced and closes it out. Both branches are required. The output chains between them. This is the most RTJ thing in the language.
jewel result = duo(inputValue) { mike: processFirst // Killer Mike opens — Atlanta el: processSecond // El-P responds — Brooklyn } // compiles to: processSecond(processFirst(inputValue)) // mike is always inner. el is always outer. // El produces the foundation. Mike lays the bar on top.
|> The pipe operator — Passing the Jewel
Thread a value through a chain. Each output becomes the next input. You are running the jewels through a sequence, each step handling them before passing forward.
feature { trim, upper, split } from "bk:text" jewel result = " legend has it " |> trim |> upper |> split(" ") // ["LEGEND", "HAS", "IT"]
Blockbuster Night
RTJ2 · Track 1 · 2014 · Five programs
1 — Hello world
talk "Run The Jewels forever"
2 — Variables and functions
jewel trackName = "Legend Has It" jewel bpm = 118 verse describe(name, tempo) { send `${name} hits at ${tempo} BPM` } talk describe(trackName, bpm) // "Legend Has It hits at 118 BPM"
3 — Loop and conditional (RTJ3 tracklist)
jewel rtj3 = [ "Talk to Me", "Legend Has It", "Call Ticketron", "Stay Gold" ] run track in rtj3 { ifwild (track.length > 9) { talk `long title: ${track}` } elsewild { talk `short: ${track}` } }
4 — Pipe chain
feature { trim, upper, split } from "bk:text" jewel words = " stay gold ponyboy " |> trim |> upper |> split(" ") talk words // ["STAY", "GOLD", "PONYBOY"]
5 — duo() in action
feature { words } from "bk:parse" feature { count } from "atl:data" jewel line = "walking in the snow" jewel wordCount = duo(line) { mike: words // ATL: break it into words el: count // BK: count them } talk wordCount // 4
Two Cities
Brooklyn · Atlanta · Every module has a hometown
El-P is from Brooklyn. Killer Mike is from Atlanta. Every stdlib module carries a city prefix because where something comes from is part of what it is. bk: is El's borough. atl: is Mike's city.
El's production is precision — every sound placed exactly right, nothing wasted. Text manipulation mirrors that discipline.
trim(str) — remove whitespaceupper(str) — to uppercaselower(str) — to lowercasesplit(str, sep) — split to arrayjoin(arr, sep) — join to stringEl's style: deconstruct, examine, reconstruct. Break raw material into its components.
words(str) — split into wordslines(str) — split into lineschars(str) — split into charsMike's delivery: direct, efficient, no motion wasted. Data operations with ATL economy.
count(arr) — array lengthcountBy(arr, fn) — conditional countfirst(arr) — first elementlast(arr) — last elementAtlanta moves with deliberate weight. Control flow that passes through clean.
identity(x) — returns x unchangedPlanned: htx: (Houston — chopped & screwed async), chi: (Chicago — DOM), det: (Detroit — file system), la: (Los Angeles — HTTP). Every city in the RTJ universe.
Run the Jewels
Four commands · npm install -g code-the-jewels · then: rtj
rtj>. Type .exit to quit. .legend for version info.$ rtj repl 👉{💎}.rtj Code The Jewels v0.1 — RTJ0 "The Self-Titled Era" El-P (Brooklyn) & Killer Mike (Atlanta) — MIT Forever .help for commands · .exit to quit rtj> jewel x = "legend has it" rtj> talk x legend has it rtj>
The Logo
Six stages · all named after RTJ · The Fist is El, The Gun is Mike
The RTJ logo is two objects: a fist (El-P's half) and a gun (Killer Mike's half). The compiler stages carry those names. Each stage has an owner.
The Fist (El-P) reads every token and builds the AST — dense, mechanical, precise. Mike Pass validates meaning. El Pass rewrites and lowers. The Gun (Killer Mike) fires: generates clean JavaScript.
El builds the foundation. Mike closes it out.Stay Gold
RTJ3 · Track 8 · 2016
rtj installable globally, REPL with RTJ welcome bannerVersion naming follows the RTJ album eras