执行,而非分析
Nudo 在 Abs(shape × term × pred × conf)上以抽象解释执行你的 JavaScript。调用点是证据;契约来自 *.nudo.js 侧车——无需独立的类型语言。
精确推导
通过抽象解释,Nudo 在 Abs 上精确追踪字面量、窄化与控制流,推导结果与代码的实际运行时行为一致。
指令驱动
契约写在 *.nudo.js 侧车与 @nudo:refine / @nudo:interface(约束构建器)。@nudo:mock 打桩依赖;@nudo:case 仅用于调试 / nudo test。
IDE 与构建工具集成
功能完备的 VS Code 扩展,支持悬停类型、跳转定义、查找引用、重命名、签名帮助和 CodeLens。Vite 插件实现构建时类型检查。CLI 适用于脚本和 CI。
AI 代理集成
Nudo 语言服务器让 AI 编程代理直接使用类型推断——假设分析、类型追踪和诊断,可通过原生 LSP 或任意 LSP→MCP 桥接入,为 AI 提供编写正确 JavaScript 所需的类型上下文。
运行时类型生成
连接静态推导与运行时验证。从推导类型生成 Zod schema、原生类型守卫和 TypeScript 声明——一条命令,零手写验证器。
写 JavaScript,得类型。
使用 Nudo — 纯 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);
使用 TypeScript — 需要重载
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.
Precise-signature coverage on @hapi/hoek — each wave ships one engine capability, no library annotations added.
From unknown to exact
formatNameCall-site discovery(unknown, unknown) => unknown("Ada", "Lovelace") => "Ada Lovelace"deepEqualLiteral object arguments(unknown, unknown) => unknown({a: 1, b: {c: 2}}, {a: 1, b: {c: 2}}) => booleanflattenRecursion & iteration(unknown) => unknown([1, [2, [3, 4]]]) => [1, 2, 3, 4]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.