Built for machines. Early access

A new universe.

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

Real world applications

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 with enforced foreign keys, value validation, pagination, API-key auth, and a transaction that decrements stock atomically.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 a dataset, group by city, average ages, partition, rank and paginate. The whole 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 input/output validation, a tool that retries and times out, and chat 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)
Three related resources, JWT auth on writes, email and length validation, a nested comments route and a counts endpoint.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
◎

One shape to learn

A small, regular grammar gives the model far less surface to get wrong. Almost everything is the same form: (form args).

02
↻

Made to be repaired

When a program fails, the type checker answers with one directive line, the kind of feedback a model can act on in a single pass instead of a full rewrite.

03
∿

Less to decide

Because nearly everything is one uniform shape, the model spends less effort deciding how to structure each line and more on the actual problem.

04
▶

You ship plain JS

It compiles to readable JavaScript or strict TypeScript on the standard Node ecosystem. No runtime to adopt, no lock-in, nothing new for your team to learn.

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

Uniform syntax

Everything is one shape, (form args). There is almost nothing to memorize.

⟂

Async, inferred

The compiler awaits what suspends and leaves pure code synchronous. You never write await, then or Promise.all.

✓

Real type system

Inference with optionals, enums, unions, records and generics, and one-line errors designed to be easy to fix.

⌗

Server, DB and auth

CRUD on Hono and SQLite, Postgres, MySQL or MongoDB, with relations, validation, pagination, bearer / API-key / JWT auth and transactions.

◎

Agents and MCP

Tools, the tool-calling loop, retries, timeouts and persistent memory across Claude, GPT, Gemini and Ollama.

03 / BUILT WITH KERNSCRIPT

One language. Real experiences.

See it in action.

Interactive websites, creative tools, and the backend behind them. Built with KernScript.

04 / 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 24.22.1+JavaScript / TypeScriptAI-native