The engine

Parse once. Reason semantically. Emit for the stack.

KERN starts as compact .kern source, becomes a structured IR, and then flows into compiler targets, review rules, MCP tools, tests, and language-evolution workflows.

The important part is not a template string. It is the shared semantic layer: nodes, props, types, routes, effects, guards, confidence, and evidence survive across tools.

.KERNSOURCEASTSEMANTICKERN IRTAILWINDNUXTNEXT.JSREACTVUEEXPRESSFASTAPINATIVECLITERMINALINKREVIEWHover to explore — source → IR → 11 targets

Why it works

The IR carries meaning across products.

The parser accepts an indentation-based language with key=value props, style shorthands, typed nodes, handlers, machines, routes, MCP tools, tests, and evolved node hints. Review and compile both consume the same structured tree.

.kerncompact source
parserAST + diagnostics
semantic IRnodes, effects, guards
targetsframework output

Actions and effects

Review can distinguish reads, writes, network calls, auth, validation, and recovery paths instead of only matching text.

Capability matrix

Target support is explicit: native, lowered, or unsupported by feature and position, so the compiler can be honest about what emits cleanly.

Diagnostics and confidence

Parse diagnostics, review confidence, suppression metadata, and evidence spans make findings easier to audit and automate.

Compile

15 concrete targets in the compiler config.

Each target has its own emitter path. Some features compile natively, some lower to runtime helpers, and some are intentionally marked unsupported until the target can emit them correctly.

--target=lib

shared TypeScript library output

--target=nextjs

Next.js App Router pages and routes

--target=tailwind

React output with Tailwind classes

--target=web

React web components

--target=native

React Native output

--target=express

Node/Express APIs

--target=cli

command-line apps

--target=terminal

ANSI terminal UI

--target=ink

React terminal UI

--target=vue

Vue 3 SFCs

--target=nuxt

Nuxt pages and routes

--target=fastapi

Python FastAPI services

--target=mcp

Model Context Protocol servers

--target=python

portable Python lowering

--target=go

portable Go lowering

Review engine

Static analysis uses more than AST matching.

The review package builds file context, import graphs, call graphs, concept maps, taint flows, public API maps, quality rules, and confidence graphs. That is why it can report problems like unguarded effects or route contract drift with evidence.

reviewDirectory()
  build context graph
  extract TS/Python concepts
  analyze taint flows
  run active rule layers
  group by root cause
  assign confidence
  emit report / SARIF
evolve(input)
  collect TS files
  detect gaps
  analyze patterns
  propose templates
  validate proposals
  stage approved output

Evolve

Turn repeated code into reviewable language.

kern evolve is an experimental pipeline for detecting recurring TypeScript patterns, proposing templates or structural nodes, validating them, and staging the result for approval.

Proof

This site is built from Kern source and Next.js output.

The landing app keeps .kern sources beside generated Next files, uses the compiler target for app routes, and ships the result as a normal Next.js site.