Over the course of 2022, I've found myself gradually programming in a certain way that has been working really well. Here, let me show you a few examples, see if you can spot the pattern:
- A plain-text editor where you can
also draw line drawings.
Minimal dependencies, easy to build, runs anywhere you can install apps without asking permission, thoroughly tested, designed above all to reward curiosity about its internals.
- A different
way to draw polygons. Old way:
(Image drawn using itself, of course.)
- The Pong fork.
Baking the editing environment into other apps for a self-contained curiosity-rewarding/forking
(Notice the extensible graphical logs. It takes very little code to augment debug-by-print. This work stemmed from the Handmade Network Wheel Reinvention Jam)
- Using the editing environment to debug the editing environment. (More
tools should support a command palette; it's the best of commandline and GUI
- Pivot: making
changes to programs as they run. They maintain state even after a crash
(the red error on the left).
- LuaML, a box model
over an infinite 2D surface that you can pan and zoom without restriction.
Built in the live style, of course.
(You can edit each text widget, and scrolling within a widget pans the whole surface. This took me a couple of tries to boil down to a reasonably elegant implementation.)
- Pulling LuaML
“into the left window,” the editing environment.
I've found myself calling these freewheeling apps to myself. They're freewheeling in two ways. First, they're easy to get started with so you can be off doing your thing. Second, they stay freewheeling over time. They don't cramp your style with constraints after you've gotten suckered into adopting them.
“It autoupdates twice a week? I'd rather not spend time tracking down what change broke my habits, thanks.”
“1GB install? What if I'm in, you know, the other 95% of the planet?”
“You have a PR submission process? How lovely for you. Hey, how about I just publish a fork, and you take what you want. (I love getting comments, though.)”
“I don't want to remember a bunch of idiosyncracies about your language and app. Can you just give me good error messages when I mess up? Just don't harsh my buzz about portability, compatibility constraints and whatnot.”
Replace “I” with yourself, dear reader. These apps should work anywhere (except mobile platforms), be easy to try out, easy to edit in place, and easy to subvert if you dislike a design choice. I'm going to continue improving the hacking experience, and I want to support forks in staying up to date with my changes. Unfortunately they require a little bit of programming experience for now (particularly git), but it should all seem pretty familiar regardless of what languages and tools you've used in the past. And if they don't, feel free to reach out. I welcome questions.
A lot of the bang here comes from the stack I'm using: the Lua programming language and the LÖVE game engine for Lua. You don't have to use Lua and LÖVE to be freewheeling, I think, any parsimonious stack designed to be portable and easy to build will do. But if you have another candidate that meets those criteria, I'd like to see it.
Comments gratefully appreciated. Please send them to me by any method of your choice and I'll include them here.