Live data from Hacker News

ArkType: Ergonomic TS validator 100x faster than Zod

arktype.io

1–10 of 72 posts

Re: ArkType: Ergonomic TS validator 100x faster than Zod

#2
ArkType is a really interesting library that has a difficult time marketing itself. More than being a schema validator, it brings TS types into the runtime, so you can programmatically work with types as data with (near?) full fidelity.

I've been evaluating schema libraries for a better-than-Zod source of truth, and ArkType is where I've been focused. Zod v4 just entered beta[1], and it improves many of my problems with it. For such a mature library to improve like this, v4 is treat and speaks volumes to the quality of engineering. But ArkType has a much larger scope, and feels to me more like a data modeling language than a library. Something I definitely want as a dev!

The main downside I see is that its runtime code size footprint is much larger than Zod. For some frontends this may be acceptable, but it's a real cost that isn't wise to pay in many cases. The good news is with precompilation[2] I think ArkType will come into its own and look more like a language with a compiler, and be suitable for lightweight frontends too.

[1] https://v4.zod.dev/v4

[2] https://github.com/arktypeio/arktype/issues/810

Re: ArkType: Ergonomic TS validator 100x faster than Zod

#4
Since recent typescript features have made it more possible, I’m less interested in runtime validation, and really only keen in build-type schema validation.

There’s a few tools out there that generate code that typescript will prove will validate your schema. That I think is the path forward.

Re: ArkType: Ergonomic TS validator 100x faster than Zod

#5
I like the idea of having types at runtime for parsing etc and generating validators in various languages. What stopped me from going there so far is that I already have TypeScript types provided for the various libraries I use. How good are the tools for importing TypeScript types into ArkType/Zod and working with types in various representations in parallel?

Re: ArkType: Ergonomic TS validator 100x faster than Zod

#6

ArkType is a really interesting library that has a difficult time marketing itself. More than being a schema validator, it brings TS types into the runtime, so you can programmatically work with types as data with (near?) full fidelity. I've been evaluating schema libraries for a better-than-Zod source of truth, and ArkType is where I've been focused. Zod v4 just entered beta[1], and it improves many of my problems w…

> The main downside I see is that its runtime code size footprint is much larger than Zod.

Yes, it unfortunately really does bloat your bundle a lot, which is a big reason I personally chose to go with Valibot instead (it also helps that it's a lot closer to zods API so it's easier to pickup).

Thanks for linking that issue, I'll definitely revisit it if they can get the size down.

Re: ArkType: Ergonomic TS validator 100x faster than Zod

#8

Since recent typescript features have made it more possible, I’m less interested in runtime validation, and really only keen in build-type schema validation. There’s a few tools out there that generate code that typescript will prove will validate your schema. That I think is the path forward.

I don’t know too much about about the TS ecosystem but do these new systems you talk about do it via a “Smart Constructor”? That is the pattern I typically use to solve this problem in Haskell and Rust code.

Re: ArkType: Ergonomic TS validator 100x faster than Zod

#9

ArkType is a really interesting library that has a difficult time marketing itself. More than being a schema validator, it brings TS types into the runtime, so you can programmatically work with types as data with (near?) full fidelity. I've been evaluating schema libraries for a better-than-Zod source of truth, and ArkType is where I've been focused. Zod v4 just entered beta[1], and it improves many of my problems w…

Definitely check out Valibot as well, it may be the smaller footprint zod you’re looking for: https://valibot.dev
Post reply on HN