Skip to main content

Nudo

A type inference engine for JavaScript that executes your code with Abs values under abstract interpretation to derive precise types — no type gymnastics required.

⚡

Execute, Don't Analyze

Nudo executes your JavaScript under abstract interpretation on Abs (shape × term × pred × conf). Call sites are evidence; contracts come from *.nudo.js sidecars — no separate type language needed.

🎯

Precise Inference

Through abstract interpretation, Nudo tracks literal types, narrowing, and control flow with precision that matches how your code actually behaves at runtime.

📝

Directive-Driven

Contracts live in *.nudo.js sidecars and @nudo:refine / @nudo:interface (constraint builders). @nudo:mock stubs dependencies; @nudo:case is debug / nudo test only.

🔌

IDE & Build Integration

Full-featured VS Code extension with hover types, go-to-definition, find references, rename, signature help, and CodeLens. Vite plugin for build-time type checking. CLI for scripting and CI.

🤖

AI Agent Integration

The Nudo language server gives AI coding agents direct access to type inference — what-if analysis, type tracing, and diagnostics over LSP or any LSP→MCP bridge, giving AI the type context it needs to write correct JavaScript.

🔧

Runtime Type Generation

Bridge static inference and runtime validation. Generate Zod schemas, native type guards, and TypeScript declarations from inferred types — one command, zero hand-written validators.

Write JavaScript. Get Types.

With Nudo — plain JavaScript

// plain JS — call sites are evidence
function transform(x) {
if (typeof x === "string") return x.toUpperCase();
if (typeof x === "number") return x + 1;
return null;
}
transform("hi");
transform(1);

With TypeScript — overloads needed

function transform(x: string): string;
function transform(x: number): number;
function transform(x: unknown): null;
function transform(x: unknown) {
if (typeof x === "string") return x.toUpperCase();
if (typeof x === "number") return x + 1;
return null;
}

Real-World Trial

We ran Nudo against real, unannotated libraries and hardened the engine wave by wave until inferred signatures matched runtime behavior.

54.8% → 98.6%precise signatures
291 → 0type errors
6engine hardening waves

Precise-signature coverage on @hapi/hoek — each wave ships one engine capability, no library annotations added.

From unknown to exact

formatNameCall-site discovery
before(unknown, unknown) => unknown
after("Ada", "Lovelace") => "Ada Lovelace"
call collected from test.js:12
deepEqualLiteral object arguments
before(unknown, unknown) => unknown
after({a: 1, b: {c: 2}}, {a: 1, b: {c: 2}}) => boolean
@hapi/hoek — nested equality walk
flattenRecursion & iteration
before(unknown) => unknown
after([1, [2, [3, 4]]]) => [1, 2, 3, 4]
recursive call + for-of tracking

Measured on real-library trials: @hapi/hoek v9.3.0 and @discoveryjs/json-ext v0.5.7 — every signature produced by Nudo’s abstract interpreter, zero type annotations.