For some months, I’ve wanted to write a program that would let me page through the list of my list of Mastodon followers whom I don’t myself follow, showing me their bio and a sampling of their recent posts, and giving me an easy interface for following them back. Hmm, I just expressed my desire in one sentence, and it’s 2023. That means it’s time to ask an AI to code it for me!

An AI did not code it for me. However, one did get me over the hump of simply starting the project, and gave me the confidence to drive it the rest of the way myself.

I could probably have banged something together rapidly with familiar Perl, using a Mastodon library readily available on CPAN. But that library has seen a few years pass since its most recent update, a fact that helped this project feel like the perfect opportunity to get more comfortable with Python, writing my first such program to solve a real-world problem. This made my next action clear—and it also gave it much higher startup costs. And so, I did nothing at all with this idea for a long time.

But my first day back at work after a week off gave me some new perspective, as well as the idea to ask Bard, my employer’s LLM, how it would attack this problem.

It wrote up a script in an eyeblink, of course. The program that Bard showed me would import a library called Mastodon, with a pleasantly simple-looking API. It would proceed to log me into a Mastodon server, grab lists of my followers and the accounts I follow, and create the list of the first minus the second. When I asked Bard how to install this Mastodon library, it pointed me to Mastodon.py by Lorenz Diener—which has a completely different API than the one it demonstrated. Then it gave me the incorrect pip command to install it.

It seems that Bard had, at first, made up a reasonable-seeming Mastodon library, in the way that today’s LLMs are rather famously wont to do. But in this case, that was good enough for me! I was able to treat its bogus script like a template, an initial bit of ground to stand on that gave me a much more solid starting space than a totally empty text editing window would have.

Bard also seemed to have some half-baked notions about how to register my app with my Mastodon instance and then authenticate with it, but here too it succeeded in getting me to look in the right places.

Between Bard’s confidently semi-correct answers and the real Python library’s documentation, I had realized my initial goal within an hour. I doubt that I would have gotten there so quickly had I started from nothing. More to the point, I got started at all. Even if Bard couldn’t give me an instantly accurate cut-and-paste answer, it still gave me a customized and wholly applicable framework for finding my own way to a solution, helping me understand my problem better by breaking it into smaller goals and refining the questions I put to it.

I spent another hour or two improving the program, exploring the actual library’s API and adding the features that would let me see user summaries, and choose whether to follow any back. With more specific questions, like “What are valid values for booleans in Python?” and “How do you strip HTML from text in Python?”, Bard answered with bang-on accuracy. And this was the other half of my discovery about coding with LLMs: I found this kind of interaction far more pleasant than putting basic programming questions to a traditional search engine. As I observed last winter, the top search results for any questions about popular languages like Python are an unreadable mess. Getting results from a tool like Bard feels like a refreshing reset.

I notice that Google’s own marketing around Bard, including the way that the LLM introduces itself, describes it as more of an an assistant or a collaborator than an expert or consultant. This humbler framing of an LLM’s utility seems more correct to me than the highly skeptical and even fearful reactions to LLMs that presently prevail in my slice of social-media culture. I feel cautiously open-minded about this technology, and willing to continue actively experimenting with its use as a talking, knowledgable, but essentially inert rubber ducky.

Share or reply to this post on Mastodon, or elsewhere.


Next post: The Book of Apshai—a personal exegesis

Previous post: Three months with the Yale Assure deadbolt

Loading responses...

Share a response

To share a response that links to this page from somewhere else on the web, paste its URL here.