Re:ArkType: Ergonomic TS validator 100x faster than Zod
by udbhavs on Saturday April 12, 2025 @08:01PM
(#43668918)
I was going to ask about how pure types would fill the gap for other validations in Zod like number min/max ranges, but seeing the tags feature use intersection types for that is really neat. I tried assigning a `string & tags.MinLength<4>` to a `string & tags.MinLength<2>` and it's interesting that it threw an error saying they were incompatible.
Re:ArkType: Ergonomic TS validator 100x faster than Zod
by retropragma on Sunday April 13, 2025 @01:07AM
(#43670231)
That's because "minimum length" cannot be enforced in TypeScript. Maybe you already know this.
I'm not a Typia user myself, but my RPC framework has the same feature, and the MinLength issue you mentioned doesn't crop up if you only use the type tags at the client-server boundary, which is enough in my experience.
Re:ArkType: Ergonomic TS validator 100x faster than Zod
by surprisedcat on Saturday April 12, 2025 @10:25PM
(#43669548)
Thanks for sharing the deck! I had no idea Typia existed and it looks absolutely amazing. I guess I'll be trying it out this weekend or next :)
Re:ArkType: Ergonomic TS validator 100x faster than Zod
by CharlieDigital on Saturday April 12, 2025 @11:07PM
(#43669744)
The docs have a bit of a rough edge because the author is Korean, but the examples are quite good and took me maybe 2-3 hours to work through.
Once everything clicked (quite shortly in), I was a bit blown away by everything "just working" as pure TypeScript; I can only describe the DX as "smooth" compared to Zod because now it's TypeScript.
Re:ArkType: Ergonomic TS validator 100x faster than Zod
by retropragma on Sunday April 13, 2025 @01:03AM
(#43670214)
An interesting development with Typia is that it will need to be rewritten in Go to work with TypeScript 7. https://github.com/samchon/typia/issues/1534#issuecomment-27...
This is because it relies on patching the TypeScript implementation. I'm curious if its approach is even feasible with Go?
Re:ArkType: Ergonomic TS validator 100x faster than Zod
by snafferty on Sunday April 13, 2025 @07:38AM
(#43672023)
Between this and node adding the --experimental-strip-types option which would otherwise allow people to skip compilation, I'm not sure I would choose Typia right now. I'm sure it's a great library, but these don't bode well for its future.
Re:ArkType: Ergonomic TS validator 100x faster than Zod
by CharlieDigital on Sunday April 13, 2025 @08:15AM
(#43672209)
I think it's fair to be skeptical, but I'm aligned with the overall approach the author took and I think the approach itself is what is interesting (pure TS + AOT).
Author + contributors seem up for a rewrite in Go based on that thread! Might be bumpy, but a pure TS approach is really appealing.
I was so shocked by how good this is that I ended up writing up a small deck (haven't had time to write this into a doc yet): https://docs.google.com/presentation/d/1fToIKvR7dyvQS1AAtp4Y...
Shockingly good (for backend)
[0] Typia: https://typia.io/
[1] Nestia: https://nestia.io/
[2] https://kysely.dev/