Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, you can walk the AST of your types at runtime and do arbitrary things with it. For example, we're using ArkTypes as our single source of truth for our data and deriving database schemas from them.

This becomes very nice because ArkType's data model is close to an enriched version of TypeScript's own data model. So it's like having your TypeScript types introspectable and transformable at runtime.



TypeBox is similar by virtue of its goal of its runtime types matching JSON Schema's data model without need for conversion.


You can do whatever you want with the AST in effect schema too, it's a parser with a decoder/encoder architecture:

https://effect.website/docs/schema/transformations/


That's neat, thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: