Show HN: Magic functions for TypeScript
github.com
github.com
The library itself is interesting and fun to play with[1], especially as you rack up OpenAI credits ;)
The surprising thing for me though, was how productive I was with GPT-4. I went from “this should be possible” to having a working prototype over the course of an afternoon.
Looking back at my early ChatGPT prompts that day is humorous, as I was asking very simple questions like “How do you pass a Typescript type to a Javascript function?” which eventually led me to the existence of Typescript transformers, ts-patch, typescript-json-schema, etc.
I had no previous experience working with the internals of Typescript, and had just assumed that this would be possible in a first-class way. GPT-4 kindly let me down, and explained I needed to use ttypescript or ts-patch. From here, we quickly dove through the rest of the task, with the LLM helping me debug version incompatibilities, library quirks (turns out JSON schema libraries are quite diverse in their capabilities!), and even creating the initial README for the project.
If you haven’t had a chance to play with LLMs yet, or you have a GPT-4 invite waiting in an email somewhere, I can’t recommend jumping outside your comfort zone and seeing how these models can help you build cool things. They’re not quite perfect, and certainly very hyped, but they don’t care how silly your questions are… they just… help.
Stats:
- 148 requests sent (including programmatic)
- $7.61 spent