Built for machines. Early access

Your AI writes KernScript. You ship plain JavaScript.

A compact, uniform language designed for models to generate. It compiles to the readable JavaScript and TypeScript your team already runs, reviews and trusts.

KernScript is taking shape in the open. Leave your email and be among the first to build with it.

Open the code lab
LIVE / COMPILER ONLINE
api.ks 0 TOKENS
api.js 0 TOKENS
import { Hono } from "hono";
import { openDb, defineTable, dbAll, dbAdd } from "./server.js";

const env = readEnv(["PORT", "DATABASE_URL"]);
const db = openDb(env.DATABASE_URL);
const users = defineTable(db, "users", {
  columns: [{ name: "name", type: "str" },
    { name: "email", type: "str", unique: true }]
});
const app = new Hono();
app.get("/users", async (c) => reply(c, ok(dbAll(users))));
app.post("/users", async (c) => {
  const body = await readBody(c, { name: "str", email: "str" });
  if (!body.ok) return c.json({ error: "invalid body" }, 400);
  return reply(c, ok(dbAdd(users, body.value)));
});
serve(app, env.PORT);
01 / CODE LAB

What the model writes

A whole application. Almost no ceremony.

Relations, validation, auth, transactions and tools are first-class forms. KernScript compiles them to idiomatic JavaScript your team can inspect and ship.

4 PROGRAMS READY
OUTPUT TARGETJavaScript / TypeScript
Relations, value validation, pagination, API-key auth and an atomic stock transaction.374 tokens · 22 lines
commerce.ks
(env PORT DATABASE_URL API_KEY)
(server shop :port PORT
  (db categories {name: str unique})
  (db products {name: str nonempty, price: (num :min 0),
                stock: num, category: ref categories})
  (db orders {product: ref products, qty: (num :min 1)})
  (auth :apikey)
  (route GET "/products" :public
    (ok (db.all products :order price)))
  (route POST "/orders" {product qty}
    (let p (db.get products product))
    (if (not p) (err 404 "no product")
      (if (< p.stock qty) (err 400 "insufficient stock")
        (ok (tx
          (db.set products product {stock: (- p.stock qty)})
          (db.add orders {product qty})))))))
Fetch, group, average, partition, rank and paginate. The entire pipeline reads top to bottom.246 tokens · 15 lines
pipeline.ks
(env FEED_URL)
(let people (fetch FEED_URL))
(let adults (filter people (fn [p] (>= p.age 18))))
(let byCity (groupBy adults (fn [p] p.city)))
(let rows (map (entries byCity) (fn [e]
  (let ps (at e 1))
  (let total (reduce ps (fn [s p] (+ s p.age)) 0))
  {city: (at e 0), count: (len ps),
   avg: (toFixed (/ total (len ps)) 1)})))
(let ranked (sort rows (fn [r] (- 0 r.count))))
(for r ranked
  (print "{r.city}: {r.count} people, avg {r.avg}"))
A tool-using agent with schemas, retries, timeouts and memory that survives restarts.185 tokens · 9 lines
agent.ks
(tool add (desc "add a and b")
  (in {a: num, b: num}) (out {sum: num})
  {sum: (+ a b)})
(tool lookup (desc "count feed records")
  (in {q: str}) (out {n: num}) (retry 2) (timeout 5000)
  (let d (fetch FEED_URL {q})) {n: (len d)})
(agent helper (model "claude-sonnet-4-6")
  (system "You are a helpful assistant.")
  (tools [add lookup])
  (memory chat :max 30 :persist "agent-mem.db")
  (permission [:net]))
(let answer (ask helper "Find and summarize the records"))
(print answer.text)
Related resources, JWT on writes, validation, nested comments and live counts.280 tokens · 14 lines
blog.ks
(env PORT DATABASE_URL JWT_SECRET)
(server blog :port PORT
  (db authors {name: str, email: (str :email) unique})
  (db posts {title: (str :len 1 100), body: str,
             author: ref authors, published: bool})
  (db comments {post: ref posts, text: str})
  (auth :jwt)
  (route GET "/posts" :public (ok (db.all posts)))
  (route POST "/posts" {title body author published}
    (ok (db.add posts {title body author published})))
  (route POST "/posts/:id/comments" {text}
    (ok (db.add comments {post: id, text})))
  (route GET "/stats" :public
    (ok {posts: (db.count posts),
         comments: (db.count comments)})))
02 / THE IDEA

Smaller surface, by design.

Less code is not the goal. Code a model can get right is.

Models are astonishing pattern machines. KernScript gives them fewer patterns to choose from and makes every one count.

01
◎

More reliable

A small, regular grammar leaves the model far less surface area to get wrong.

02
↻

Self-repairing

One-line compiler diagnostics guide the next correction instead of another full rewrite.

03
∿

Less reasoning

Uniform forms reduce the choices the model must make before it can solve the actual problem.

04
▶

You ship plain JS

Readable JavaScript or strict TypeScript. Your runtime, your review process, your stack.

ONE SHAPE✳INFERRED ASYNC✳REAL TYPES✳SERVER + DB✳AGENTS + MCP
( )

Uniform syntax

Everything has one shape: (form args). Almost nothing to memorize, very little to hallucinate.

⟂

Async, inferred

The compiler awaits what suspends. You never write await, then or Promise.all.

✓

Real type system

Inference, records, unions and diagnostics designed for fast model repair.

⌗

Server, DB and auth

Routes, validation, relations, transactions and auth without the glue.

◎

Agents and MCP

Tools, retries, timeouts and persistent memory across leading providers.

03 / WAITLIST

Get in early

KernScript is coming. Reserve your spot.

We are still shaping the language and its tooling. Leave your email and we will reach out when there is something for you to build with.

Occasional updates and the launch. Unsubscribe any time.

Curious already? Follow on GitHub
Node 20+JavaScript / TypeScriptAI-native