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).
A new universe.
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→
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);
(env PORT DATABASE_URL)
(server api :port PORT
(db users {name: str, email: str unique})
(route GET "/users" (ok (db.all users)))
(route POST "/users" {name email}
(ok (db.add users {name email}))))
What the model writes
Relations, validation, auth, transactions and tools are first-class forms. KernScript compiles them to idiomatic JavaScript your team can inspect and ship.
(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})))))))
(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}"))
(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)
(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)})))
Smaller surface, by design.
Models are astonishing pattern machines. KernScript gives them fewer patterns to choose from and makes every one count.
A small, regular grammar gives the model far less surface to get wrong. Almost everything is the same form: (form args).
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.
Because nearly everything is one uniform shape, the model spends less effort deciding how to structure each line and more on the actual problem.
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.
Everything is one shape, (form args). There is almost nothing to memorize.
The compiler awaits what suspends and leaves pure code synchronous. You never write await, then or Promise.all.
Inference with optionals, enums, unions, records and generics, and one-line errors designed to be easy to fix.
CRUD on Hono and SQLite, Postgres, MySQL or MongoDB, with relations, validation, pagination, bearer / API-key / JWT auth and transactions.
Tools, the tool-calling loop, retries, timeouts and persistent memory across Claude, GPT, Gemini and Ollama.
One language. Real experiences.
Interactive websites, creative tools, and the backend behind them. Built with KernScript.
From a stunning frontend to the backend. The interactions, the scroll-driven visuals, and the server: all built with KernScript.
kernscript.comOne chrome knot. Three ways to explore it. Move between 2D, CSS 3D, and WebGL, rotate the sculpture, and hear procedural sound respond to your touch.
knot.kernscript.com ↗ Built with KernScriptTurn ideas into music. Build beats, shape synthesized sounds, and share your compositions in a procedural music playground.
resonant.kernscript.com ↗Get in early
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.