Evgen Mykhailenko praises TypeScript but highlights a persistent pain: types vanish at runtime. That disappearance keeps bundles small, yet it forces developers to duplicate type definitions in schema libraries like Zod or JSON Schema when structured output is needed. He emphasizes that duplication is increasingly annoying as APIs and model-driven workflows demand concrete schemas, and that maintaining parallel type and schema artifacts creates extra work and potential drift.
To solve this, he proposes an optional compiler flag that preserves enough compile-time type information to emit runtime JSON Schema: TypeScript type → compiler → runtime JSON Schema. He calls out a practical downside that’s especially relevant today - every time a type and its duplicated schema are sent to an LLM, the same structure is described twice, wasting token budget; coding agents then generate unit tests to validate conversions, adding further overhead. He published a small playground demo showing how the idea could work and invites feedback on whether TypeScript should adopt such an option.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.