V0 is now available! We'll release moreeee soooon .
We all know Zod for runtime validation. But there's a new player: ArkType. Claims? 100x faster than Zod, 2000x faster than Yup, and your TypeScript types come alive at runtime. No extra schemas. No mismatch. Let's see why it matters.
ArkType is a TypeScript-first runtime validator. Your types are the validator. One definition, two worlds: compile-time safety and runtime checks. Perfect for JSON, API responses, forms, or any untyped data.
Validating untyped data is unavoidable. Zod, Yup, Joi? You often write a schema and infer types separately. Arktype removes that extra step. Isomorphism: runtime mirrors your TS types. No duplication. No mismatch.
Built on set theory + ahead-of-time compilation, it produces lightning-fast validators.
import { type } from "arktype";
const user = type({
id: "number",
name: "string",
email: /.+\@.+..+/,
});
user({
One definition, runtime and compile-time aligned.
// Discriminated unions
const event = type(
{ kind: "'click'", x: "number", y: "number" } |
{ kind: "'keydown'", key: "string", ctrlKey: "boolean" }
);
// Recursive structures
const tree = type({ value: "string", children: "tree[]" });
// Ranges
const config = type({ port: "1<=number<=65535", timeout: "0<=number<=300000" });
const check = type("string|number\[]");
check("hello"); // β
check(\[1, 2, 3]); // β
check({}); // β Error: Expected string or array of numbers
Minimal allocations, optimized validator.
Pick Zod for stability. Pick ArkType for speed and advanced runtime type fidelity. Both can coexist.
Express.js:
import express from "express";
import { type } from "arktype";
const app = express();
app.use(express.json());
const createUserBody = type({
name: "string",
email: "string.email",
age: "number>=18",
});
app.post("/users", (req, res) => {
const body = createUserBody(req.body);
if (body instanceof type.errors)
return res.status(400).json({ errors: body.summary });
res.json({ user: body });
});
React Hook Form:
import { useForm } from "react-hook-form";
import { type } from "arktype";
const loginSchema = type({ email: "string.email", password: "string>=8" });
function LoginForm() {
const {
register,
handleSubmit,
formState: { errors },
} = useForm();
const onSubmit = (data: unknown) => {
const validated = loginSchema(data);
if (validated instanceof type.errors) return;
};
return (
<form onSubmit={handleSubmit(onSubmit)}>
\<input {...register("email")} />
{errors.email && <span>{errors.email.message}</span>}
</form>
);
}
ArkType is not just another validation library. It's fast, expressive, and type-safe at runtime. Stick with Zod for stability, but try ArkType for performance-sensitive workloads or advanced type-level validation.
Mangle: Google's Bold Take on Database Programming Google introduced [Mangle](https://github.com
Zed ACP Opens the Door: Gemini CLI Becomes the First Agent Zed has always focused on speed and f
TypeScript 5.9: Smarter Imports, Sweeter Developer Experience TypeScript 5.9 just dropped π€―