TLDR; I set out to make asynchronous programming on microcontrollers easier. Along the way, I accidentally built somewhere that humans and AI’s can work together comfortably.


This is the first in a short series of posts about learnings and insights I’ve got during the making of Thingstudio, leading up to a proper introduction.

For now, all you need to know is that Thingstudio is a low-code programming environment for microcontrollers, inspired by Nick O’Leary’s brilliant Node-RED. You drag nodes onto a canvas and wire them together, and the result, called a flow, is the program that runs on the board. Its main goal is to take the pain out of asynchronous programming on small devices. More on all of that in later posts.

The accidental discovery

Each time I added a feature to Thingstudio, I made a flow to test it. Out of curiosity, I started asking an LLM to write some of those test flows for me.

Unsirprisingly, they were perfectly good in terms of functionality, but visually looked a bit of a mess because the LLM had no idea of what a neat diagram looked like. A few pointers later, it was producing correct, neatly laid out flows that were easy to modify.

But the interesting thing wasn’t that the AI could write flows. It was the fact I could read them. I’ll explain. We’ve got pretty used to LLMs generating so much code that it’s difficult for a human to audit it throughly and this is a major problem. The flows that the LLM generated actually had a fair amount of functionality but were compact and easy enough for me check and modify.

Constraints can be Liberating

Thingstudio is a fairly small playground.

There are a fixed set of nodes. Each one has named properties and typed inputs and outputs. You can’t wire a boolean into something that wants bytes, or use a pin the board doesn’t have. All of this is checked by a compiler, and there’s a command line version of it, so an LLM can write a flow, run the check, and get back errors that say exactly which node is wrong and why.

The constraints are only half of it, though. Each node wraps up quite a big chunk of functionality, a OLED display, an MQTT connection, whatever, and the interfaces between nodes are well defined. You can’t easily write spaghetti, because there’s nowhere to put it. Verbosity is just that more difficult.

Think of it as LEGO for programming. LEGO has (or used to have) a pretty restricted set of bricks, but people build huge, elaborate things with it, and you can always see how they were put together.

Lightbulb

Without really meaning to, I’ve made a shared space. The LLM has got an enviroment it can iterate in until it get OK results, and the human is comfortable because the result is small, visible, and easy to change.

Beyond microcontrollers

I suspect this applies well beyond blinking LEDs.

When we think about humans and AI’s working together, the conversation is usually about the AI: how capable it is, how far to trust it, how much to check. This experience suggests another angle, which is to think about the shared environment.

It seems that like small children, LLMs work best with clearly defined boundaries.

PS: Before Thingstudio goes public, I’m looking for testers to try getting started with it. All you need is an ESP32 or a Raspberry Pi Pico. Details at www.thingstudio.net.