• A Pirate Pig Made Programming Fun Again

    A carved wooden piglet in an oversized tricorn pirate hat stands on a desk in the glow of a lamp at night

    I was getting tired of solving problems I already knew how to solve. The tasks were familiar and repetitive, and I was starting to burn out on programming.

    I’d also become curious about large language models. I wanted to build a bot and find out how the whole thing worked. What do you keep from a conversation, and what do you give the model when the next message arrives? Also, how do you write a bot? I had a few vague ideas and no practical experience.

    I didn’t want to make another helpful assistant. There were already thousands of those, all terribly eager to be useful, and I had no particular desire to add mine to the pile. I wanted something that would entertain me and my friends.

    The idea was to have him sit in a group chat, occasionally say something on his own, and answer when someone spoke to him. He was supposed to be another character in the chat, with his own personality. I didn’t want every conversation to end with “How else can I help you?” or an offer to do something else.

    I have a soft spot for pigs. They’re a running joke with my friends, and we like funny pictures of them. So I decided he’d be a pig.

    A plain pig seemed a bit boring, though, so I made him a pirate. I pictured a piglet rather than a hardened old boar, with a hat slightly too big for him and great faith in his own menacing expression.

    I started writing Swinobot in 2023 and kept adding things to him. There were questions I couldn’t answer yet, and I actually wanted to sit down and figure them out. I was enjoying programming again.

    Now my wife gives me another reason to keep working on him. She sometimes chats with the pig and laughs at his replies. He turned out to have a good sense of humour, and he can be remarkably sweet for someone in his line of work.