A language I invented

VELOCITY

A multi-paradigm programming language themed around racing games and web portfolios. Keywords like race, lap, and podium replace function, loop, and return — because why write boring code?

.vl static typing async/await pipe operator |> web-native oop + functional

Core keywords
race

Define a function — enter the race

podium

Return the winning value

lap

Loop — one full iteration

gear

Declare a variable

flag

Boolean true/false

boost

Make a function async

pit

Catch errors — pit to recover

chassis

Define a class

livery

Style a component

draft

Inherit / follow a value

throttle

Rate-limit execution

slipstream

Pipeline operator |>


Code examples
// Variables, functions, loops — the fundamentals

gear driver  = "Senna"
gear lapTime = 78.3
flag dnf     = false

race fastestLap(times) {
  podium times.min()
}

gear drivers = ["Senna", "Prost", "Mansell"]

lap d in drivers {
  render(d)
}

// Slipstream (pipe) chaining
gear result = rawTimes
  |> filter(valid)
  |> sort(asc)
  |> render()

// Classes
chassis Car {
  build(make, topSpeed) {
    gear this.make     = make
    gear this.topSpeed = topSpeed
  }
  race describe() {
    podium `${this.make} — ${this.topSpeed} km/h`
  }
}

gear myRide = new Car("McLaren", 372)
render(myRide.describe())
// AABB collision detection + impact resolution

chassis Hitbox {
  build(x, y, w, h) {
    gear this.x = x
    gear this.y = y
    gear this.w = w
    gear this.h = h
  }
  race overlap(other) {
    gear ox = (this.w + other.w) / 2 - abs((this.x + this.w/2) - (other.x + other.w/2))
    gear oy = (this.h + other.h) / 2 - abs((this.y + this.h/2) - (other.y + other.h/2))
    podium (ox > 0 && oy > 0) ? { ox, oy } : null
  }
}

race detectCollisions(cars) {
  gear crashes = []
  lap i in range(cars.length) {
    lap j in range(i + 1, cars.length) {
      gear hit = cars[i].hitbox.overlap(cars[j].hitbox)
      if hit {
        crashes.push({ carA: cars[i].name, carB: cars[j].name })
        resolveImpact(cars[i], cars[j], hit)
      }
    }
  }
  podium crashes
}

race resolveImpact(a, b, hit) {
  a.speed *= 0.72   // bleed speed on contact
  b.speed *= 0.72
  // push cars apart along minimum overlap axis
  if hit.ox < hit.oy { a.x += hit.ox/2; b.x -= hit.ox/2 }
  else               { a.y += hit.oy/2; b.y -= hit.oy/2 }
}
// Lap timer with personal best detection

chassis RaceTimer {
  build() {
    gear this.lapStart = null
    gear this.laps     = []
    gear this.pb       = Infinity
    flag this.running  = false
  }

  race start() {
    this.lapStart = now()
    this.running  = true
  }

  race crossLine() {
    gear split = now() - this.lapStart
    this.laps.push(split)
    this.lapStart = now()
    if split < this.pb {
      this.pb = split
      emit("pb", { lap: this.laps.length, time: split })
    }
    podium split
  }

  race format(ms) {
    gear m  = floor(ms / 60000)
    gear s  = floor((ms % 60000) / 1000)
    gear ms = ms % 1000
    podium `${m}:${pad(s)}.${pad3(ms)}`
  }
}

// Async HUD updater — boost keeps the game loop free
boost race runHUD(timer, hud) {
  lap {
    if !timer.running { break }
    hud.update(timer.format(timer.currentLap()))
    await sleep(16)   // ~60fps
  }
}
// Portfolio site — web-native keywords

hero {
  title: "Hey, I'm Alex.",
  sub:   "I build fast things on the web.",
  cta:   "See my work"
  livery { bg: "#0a0a0a", text: "#f5f5f5", accent: "#e84a1f" }
}

section "Projects" {
  project {
    name:  "RaceSim",
    desc:  "Browser-based F1 physics engine",
    tags:  ["WebGL", "Rust", "WASM"],
    link:  "github.com/alex/racesim"
  }
  project {
    name:  "Velocity",
    desc:  "A programming language I invented",
    tags:  ["language design", "parser", "racing"],
    link:  "github.com/alex/velocity-lang"
  }
}

section "Contact" {
  email: "alex@example.com",
  github: "github.com/alex"
}

deploy { target: "github-pages", domain: "alex.dev" }

Language spec
file extension.vl
paradigmmulti-paradigm — OOP + functional
typinginferred static (like TypeScript)
entry pointrace main() { ... }
return keywordpodium <value>
loop keywordlap ... in ... { }
pipe operator|> (slipstream)
async modelboost + await (promise-based)
error handlingpit { } catch blocks
classeschassis / build() constructor
web primitiveshero / section / project / deploy
stylinglivery { } blocks
inspired byJavaScript, Elixir (pipe), Rust (inference)