Imaginary programming: implementation-free TypeScript for GPT-powered web dev
loom.com
loom.com
/* * This function takes in a blog post text and returns at least 5 good titles for the blog post.
* The titles should be snappy and interesting and entice people to click on the blog post.
*
* @param blogPostText - string with the blog post text
* @returns an array of at least 5 good, enticing titles for the blog post.
*
* @imaginary
*/ declare function titleForBlogPost(blogPostText: string): Promise<Array<string>>;
Under the covers, we've written a TypeScript and Babel plugin that replaces these "imaginary function" declarations with runtime calls to GPT asking GPT what the theoretical function would return for a particular set of inputs. So it's not using GPT to write code (like CoPilot or Ghostwriter); it's using GPT to act as the runtime. This gives you freedom to implement things that you could never do in traditional programming: classification, extraction of structured information out of human language, translation, spell checking, creative generation, etc.
Here's a screencast where I show off adding intelligent features to a simple blog post web app: https://www.loom.com/share/b367f4863fe843998270121131ae04d9
Let me know what you think. Is this useful? Is this something you think you'd enjoy using? Is this a good direction to take web development? Happy to hear any and all feedback!