Thoughts on coding with GPT
The AI's there - but the infrastructure to support content creators isn't; ChatGPT's still pretty narrow in its intelligence
Last month I wrote about how I used ChatGPT to build a simple word game (which is live, here!).
This is a quick addendum to that, to note two things:
First, the infrastructure for hosting & deploying code is awful. Now that LLMs make it extremely easy for non-technical people to write code, there is a huge opportunity in helping people bring their ideas to life with better, simpler tools.
Second, one of the biggest differences between GPT and humans (for the time being) is that (smart) humans can intuit another person’s intention from a question, and give an answer that addresses that intention, rather than the question itself.
Terrible infrastructure
As I wrote last month, I gave ChatGPT instructions on the mechanics of the game I wanted to build, and with some wrangling, I had the code ready very quickly.
Deploying that code on the web so you can all access it is another story. At the very least, you need to
Find an IDE that lets you test your code quickly (I resorted to W3Schools’ try it yourself editor…)
Buy a domain name
Host your code somewhere, and have the domain point to it
Be able to track page views and other analytics
These aren’t easy to do! Even when some these services are offered by a single provider (like Google), they feel like separate products, and making them work together is confusing. In my case, and with advice from my brother-in-law, I ended up hosting my code on Github, deploying it via Vercel, and directing a domain I bought from Google to it; I had to set up Google analytics seperately, because incredibly, no-one at Google has thought to incorporate light analytics in their Domains service (all you can see there is how often your website appeared in search results).
And that’s just the basics. Setting up more advanced features such as databases, or scripts that run on schedule, or authentication, is basically impossible for a layperson. For instance, see Vercel’s guide on using databases:
How on earth is a non-coder meant to know what’s a serverless function? If they ask ChatGPT how to store data in a database, ChatGPT will write their queries for them — all that person wants is to plug that query in somewhere and have it work!
GPT can help anyone with an idea write the code for it; all we need now is a platform to tie everything together. I envision a place where
You ask GPT to write code for your idea (bonus points for asking for creative assets from image-generating AIs)
The code is automatically hosted on a server; the server provides simple functionality to host SQL databases, script schedules, plug-and-play components for user registration, billing & payment, etc.
You purchase a domain name
You can track analytics
Bonus points for buying ads &c.
If this existed, all you’d need is the idea.
GPT is still rather narrow
GPT is good at answering questions; but it does not yet understand why you’re asking the question. I wanted to have scholargrams generate a daily set of tiles (like Wordle), rather than generate a new set every time you reload the site. I tried different approaches, which all failed because of the aforementioned poor infrastructure:
I asked GPT to translate the javascript code for generating tiles into SQL, so I could update a table with 20 letters once a day, then query it every time the site loads. GPT did it (though its code was buggy, and I had to re-write it myself), but it turned out I couldn’t query SQL tables easily from Vercel. So I had to give up this idea.
I then tried to have github schedule a script to write 20 letters on an empty html page every day at midnight — here I struggled to get the script to commit the changes correctly.
Finally, I called a friend of mine for advice. The conversation went like this:
‘Hey. I’m struggling to generate tiles for my game, store them somewhere, and retrieve them every time the site reloads…’
‘You don’t need to do that. When you generate your tiles, instead of using a rand() method, use a seeded rand method, with today’s date. That will generate the same tiles every time the function is called on the same day’
My friend did not answer my question (how to retrieve data stored elsewhere). But he solved the problem I was trying to solve, with an entirely different (and more elegant & efficient) approach.
I wonder how long it’ll take GPT to be able to do the same!