Return to Arsenal
Validation/TypeScript · Python · Zig

Dhi

Ultra-fast data validation for Python & TypeScript. Drop-in Pydantic/Zod replacement powered by Zig + SIMD WASM.

Origin

Data validation spans every layer of the modern stack — Python backends, TypeScript frontends, edge functions. Dhi unifies them all through a single Zig core compiled to SIMD-accelerated WebAssembly. One schema definition, validated at 375,000 operations per second, across every runtime.

Attributes

375k
val/sec
Zig
+ SIMD WASM
Pydantic/Zod
Drop-in

Capabilities

  • Drop-in replacement for both Pydantic and Zod
  • Single Zig core compiled to SIMD-accelerated WASM
  • Cross-language schema sharing between Python and TypeScript
  • 375,000 validations per second throughput
  • Zero-dependency runtime — just the WASM binary
  • Full type inference in both TypeScript and Python

Invoke

typescript
import { d } from "dhi";

const UserSchema = d.object({
  name: d.string().min(1).max(100),
  email: d.string().email(),
  age: d.number().int().positive(),
  role: d.enum(["admin", "user", "guest"]),
});

type User = d.infer<typeof UserSchema>;

const user = UserSchema.parse(rawData);