Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Use prompt": Compile-time code generation (twitter.com/preyneyv)
1 point by preyneyv 4 months ago | hide | past | favorite | 2 comments
Inspired by Next.js' announcement of the "use cache" directive, I spent a weekend building the next big thing: "use prompt".

Compile-time code generation using directives. Transformers combined with transforms. A workflow like never before.

(/s) ---

It works by using a custom plugin to transform the AST and substitute function bodies with generated code. More info on the GitHub readme.

GitHub: https://github.com/preyneyv/swc-plugin-use-prompt Demo: https://codesandbox.io/p/devbox/swc-plugin-use-prompt-m73dsf...




If this is satire... Bravo.

If not... Yikes.


complete satire

really fun to build though




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: