David Blass
@ssalbdivad.dev
1.3K followers 85 following 250 posts
Full-time open source dev and author of @arktype.io, TypeScript's 1:1 validator optimized from editor to runtime⛵ (http://github.com/arktypeio/arktype )🌱
Posts Media Videos Starter Packs
ssalbdivad.dev
I don't know anything about atproto but the type-level string parsers I've worked on for @arktype.io's type syntax and the upcoming @ark/regex are very generalizable!

Also iirc @tylur.dev mentioned he was working on something related to this and Standard Schema?
Reposted by David Blass
arktype.io
new to typescript?

here's a handy little type for parsing regular expressions:
Reposted by David Blass
Reposted by David Blass
arktype.io
🙅convoluted regex
👍simple types
ssalbdivad.dev
There will be an RFC for the proposal soon!
ssalbdivad.dev
days of remaining sanity also numbered btw
arktype.io
the days of untyped regex are numbered
Reposted by David Blass
arktype.io
Ever get mixed up about unions and intersections?

ArkType has your back🫡
Reposted by David Blass
arktype.io
"any sufficiently advanced typescript types are indistinguishable from magic" - Arthur C. Clark, 1962
Reposted by David Blass
arktype.io
Like type-safe environment variables?

Now there's a better way to get them with arkenv⛵❤️
ssalbdivad.dev
worth it
arktype.io
our two-step process for fast typescript types:

1️⃣ build a type-level benchmarking library
2️⃣ spend the prime of your life on cache optimizations
ssalbdivad.dev
Yes this was actually an idea @ahrjarrett.bsky.social and I were experimenting with for ArkType!

It is tremendously useful for testing a parsed syntax.
Reposted by David Blass
arktype.io
attest can snapshot types, type errors and autocomplete results.

all from your existing unit tests📚🔗⬇️
Reposted by David Blass
arktype.io
⚠️trade offer⚠️

i receive: JSON Schema
you receive: lightning-fast validation and clear errors
Reposted by David Blass
arktype.io
How to use ArkType:

1️⃣ write typescript
2️⃣ use it in editor
3️⃣ use it at runtime
ssalbdivad.dev
This opens up so many doors.

Counting on the community to help find them🙏
arktype.io
turns out having type syntax at runtime is pretty nice
ssalbdivad.dev
it's just too easy
arktype.io
ArkType @arktype.io · Sep 9
1️⃣ start with a typescript keyword
2️⃣ .autocomplete the rest
ssalbdivad.dev
Yes would love this! Probably much harder to build property-based testing support in to Standard Schema because there's no standard way to introspect the structure 😔
Reposted by David Blass
arktype.io
ArkType @arktype.io · Sep 8
zod4 is 5x faster than zod3 for object validation.

arktype is 20x faster than zod4.
ssalbdivad.dev
JSON Schema:
Making illegal states representable since 2007
ssalbdivad.dev
shoutout to @typescriptlang.org- still blown away that this works🤯
arktype.io
ArkType @arktype.io · Sep 6
typescript is crazy
ssalbdivad.dev
Also what @typeholes.bsky.social mentioned about combinations of divisibility and ranges could be unsatisfiable, which we could actually check for by reducing them to a union of integers...🤔
ssalbdivad.dev
It will only reject schemas that it can prove are unsatisfiable.

There actually are some solutions to this like regex intersections that are unsatisfiable but because the set-theoretic reductions aren't built for that, they're allowed.
ssalbdivad.dev
i'm not generally considered a pragmatist but even i do not try to error at a type-level here 😅
Reposted by David Blass
arktype.io
ArkType @arktype.io · Sep 5
you deserve better type errors