👉{💎}.rtj

Code The Jewels

Brooklyn  ·  Atlanta  ·  MIT Forever

A programming language built the way Run The Jewels makes music.
Two cities. Two voices. One compiler.

v0.1 RTJ0 MIT License TypeScript Compiler Transpiles to JavaScript 13 Keywords Free Forever

Legend Has It

The Origin

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 language

Code 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

The Vocabulary

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.

jewel→ const / let"Run the jewels" — the thing worth having, worth taking, worth carrying.A variable is a jewel. You declare it, you carry it through the program with intent.
verse→ functionRTJ songs are built from verses. El takes one. Mike takes one.A function is a verse — self-contained, expressive, contributes to the whole.
send→ returnDeliver the jewel. In RTJ, nothing is wasted.When a verse has something to say, it sends it back to whoever called.
talk→ console.log"Talk to Me" — RTJ3, track 9, ft. Trina & Gangsta Boo.RTJ talks directly to people. So does your program. Not print, not log — talk.
ifwild→ ifRTJ energy in conditional form. When the condition holds, things get wild.Execute the branch when the expression is true. The run is live.
elsewild→ elseStill wild. Just differently.The other branch. Both sides of a conditional are wild in this language.
run→ for loop"Run the Jewels." The whole operation. Also the CLI: rtj run.You run a program. You run a loop. You run the jewels. Everything is a run.
in→ loop target"In Brooklyn. In Atlanta. In the cut. In the booth."Where something moves through. Pairs with run.
feature→ importA feature is a guest appearance. You give collaborators their credit.When you import a module, you feature it. Origin matters, so you declare it.
from→ import source"From Brooklyn. From Atlanta." Where something comes from is part of what it is.The module's city of origin. Pairs with feature.
yank→ throwPull the emergency brake. RTJ doesn't let things slide.When something is wrong, you yank. Throws an error and stops the run.
duo→ two-branch compositionMike and El. The whole thing. Requires exactly two branches, always.The signature construct. You cannot have a duo without both voices.
mike  /  el→ duo branchesKiller Mike (Atlanta). El-P (Brooklyn). mike opens. el responds.Both required inside every duo(). mike runs first, el receives the output and closes.

yankee and the brave (ep. 4)

The duo() Construct

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) — RTJ4

The 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.

.rtj
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.

.rtj
feature { trim, upper, split } from "bk:text"

jewel result = "  legend has it  "
  |> trim
  |> upper
  |> split(" ")

// ["LEGEND", "HAS", "IT"]

Blockbuster Night

Run It

RTJ2 · Track 1 · 2014 · Five programs

1 — Hello world

.rtj
talk "Run The Jewels forever"

2 — Variables and functions

.rtj
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)

.rtj
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

.rtj
feature { trim, upper, split } from "bk:text"

jewel words = "  stay gold ponyboy  "
  |> trim
  |> upper
  |> split(" ")

talk words
// ["STAY", "GOLD", "PONYBOY"]

5 — duo() in action

.rtj
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

The Standard Library

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.

bk:textBrooklyn — El-P

El's production is precision — every sound placed exactly right, nothing wasted. Text manipulation mirrors that discipline.

trim(str) — remove whitespace
upper(str) — to uppercase
lower(str) — to lowercase
split(str, sep) — split to array
join(arr, sep) — join to string
bk:parseBrooklyn — El-P

El's style: deconstruct, examine, reconstruct. Break raw material into its components.

words(str) — split into words
lines(str) — split into lines
chars(str) — split into chars
atl:dataAtlanta — Killer Mike

Mike's delivery: direct, efficient, no motion wasted. Data operations with ATL economy.

count(arr) — array length
countBy(arr, fn) — conditional count
first(arr) — first element
last(arr) — last element
atl:flowAtlanta — Killer Mike

Atlanta moves with deliberate weight. Control flow that passes through clean.

identity(x) — returns x unchanged

Planned: htx: (Houston — chopped & screwed async), chi: (Chicago — DOM), det: (Detroit — file system), la: (Los Angeles — HTTP). Every city in the RTJ universe.

Roadmap — more cities coming

Run the Jewels

The CLI

Four commands · npm install -g code-the-jewels · then: rtj

rtj run file.rtjExecute a .rtj file. Transpiles to JavaScript in memory and runs immediately. The full run.
rtj compile file.rtjTranspile to output.js. Writes the generated JavaScript to disk.
rtj check file.rtjSemantic analysis without execution. Reports scope and type errors. The Mike Pass, isolated.
rtj replInteractive REPL. Prompt shows rtj>. Type .exit to quit. .legend for version info.
terminal
$ 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

The Fist & The Gun

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 FistLexer + Parser (El)
The HandsAST
Mike PassSemantic (Mike)
El PassLowering (El)
The GunJS Generator (Mike)
Jewel BoxRuntime + stdlib

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

What's Next

RTJ3 · Track 8 · 2016

DoneFull language spec — 13 keywords with RTJ origins, pipe operator, duo() construct
DoneCompiler architecture — The Fist, Hands, Mike Pass, El Pass, The Gun, Jewel Box
DoneStandard library — bk:text, bk:parse, atl:data, atl:flow
NextShip v0.1 to npm — rtj installable globally, REPL with RTJ welcome banner
NextVSCode extension — .rtj syntax highlighting in pink and gold
LaterMore stdlib cities — htx:, chi:, det:, la: — every city in the RTJ universe
LaterRTJ-flavored error messages — "this jewel don't exist", "duo() needs both mike and el"
LaterBrowser playground — run .rtj without installing anything

Version naming follows the RTJ album eras

v0.1RTJ0 — "The Self-Titled Era"Before the albums. The demo.
v0.2RTJ1 — "Run the Jewels"First release. Free forever.
v0.3RTJ2 — "Blockbuster"The leap. Bigger, harder.
v1.0RTJ3 — "Legend Has It"Stable. Earned.
v2.0RTJ4 — "Walking in the Snow"The reckoning.