Introduction

KERN is the language between you and AI. You describe what you want. AI writes .kern. KERN compiles it to production code.

How it works

You don't learn KERN like you'd learn TypeScript. You don't write it by hand. KERN exists for the AI — a compact, structured format that LLMs naturally understand and generate. Your job is to describe, guide, and ship.

You

Describe a SaaS landing page with pricing and dark mode

AI

Writes 40 lines of .kern — layout, styles, data, interactions

KERN

Compiles to ~150 lines of typed Next.js / Vue / Express / Python

You

Review, tweak, ship — or tell the AI to iterate

This is the symbiosis: you bring the vision, AI brings the execution, KERN is the reliable bridge that makes the output compilable, reviewable, and multi-target.

What you get

11 targets, 1 source

Same .kern compiles to Next.js, React, Vue, Express, FastAPI, React Native, CLI, Terminal, Ink, Nuxt, Tailwind.

70% fewer tokens

AI generates faster, cheaper, with less hallucination. Your API costs drop.

kern review

68 static analysis rules catch security holes, dead logic, and framework bugs before you ship.

AI-native

7 LLMs understood KERN without training. It's the syntax AI naturally thinks in.

Why these docs exist

If the AI writes KERN, why do you need docs? Three reasons:

  • Understand what the AI generated — Read the .kern output, know what each node does, verify it's correct.
  • Guide the AI better — The more you know about KERN's capabilities, the better prompts you write. "Add a state machine for the checkout flow" beats "make the checkout work."
  • Trust the output — Understand the compiler, the review rules, the config options. Ship with confidence.

What KERN looks like

You'll see this in AI output. Each line is a node with props and styles:

page name=Hello
  metadata title="Hello World"

  col {ai:center,p:80,gap:16}
    text value="Hello World" tag=h1 {fs:48,fw:800,c:#fff}
    text value="Built with KERN" tag=p {fs:18,c:#a1a1aa}
    button text="Get Started" to=start {bg:#f97316,c:#fff,br:8,p:16}

7 lines → ~25 lines of typed Next.js. The Syntax Reference explains every piece — but you don't need to memorize it. The AI handles that.

Get started

npm install -g @kernlang/cli

Choose your path

Deep reference