Loading video...

Video Failed to Load

Go Home

🪄 What if you could write code that doesn't exist yet and it just... worked?

151,683 views • 3 years ago •via X (Twitter)

10 Comments

Caleb Porzio's profile picture
Caleb Porzio3 years ago

How it works: - I intercept the static call to "Ai" using PHP's magic: callStatic() - I send OpenAI Codex the the file you used it in as a prompt - I tell it to "write the implementation" - I take that implementation, eval() it the first time, and put it in the class for later

Caleb Porzio's profile picture
Caleb Porzio3 years ago

If you're scared of an AI injecting code into your app: - No code generation will happen in production (only locally) - All code is stored in a single "Ai.php" file so it's not bled throughout your codebase - The code is easily discoverable, editable, and deletable - Also, you should be lol

Caleb Porzio's profile picture
Caleb Porzio3 years ago

Also also, this is just a random toy I made for fun.

Marcel Pociot 🧪's profile picture
Marcel Pociot 🧪3 years ago

Welcome to the AI team

Caleb Porzio's profile picture
Caleb Porzio3 years ago

Bahaha

Tony Lea's profile picture
Tony Lea3 years ago

AI::tellCalebThisIsAwesome() Dude! This looks amazing 🤯

Caleb Porzio's profile picture
Caleb Porzio3 years ago

Haha dope

Aaron Francis's profile picture
Aaron Francis3 years ago

Haha dude this is so clever

Caleb Porzio's profile picture
Caleb Porzio3 years ago

wew!

MattStopa's profile picture
MattStopa3 years ago

I used chat GPT but With a comment I could just feed what I want it to generate You my friend have discovered the future of coding. Honestly the only thing to do is just the integration layer.

Related Videos