I tend to bulk most of my vacation at the end of the year because it creates enough space and time for fun projects. Last year, however, our dog Toby went paraplegic and so were care-taking every three hours for about two months straight. Erratic sleep, erratic self-care, but in the end he could walk again so definitely worth it.
That meant I didn’t really get to do my fun end-of-year hacks beyond just polishing Ptyxis which I had just prototyped for RHEL/CentOS/Bluefin (and more recently Fedora).
This year I’m trying something I’ve wondered about for a while. What would it look like if you shoved a full-featured IDE into the terminal?
The core idea that makes this possible is using a sub-shell with a persistent parent process. So just like you might “jhbuild shell
” you can “foundry enter
” to enter the “IDE”.
In the JHBuild case it would exec
over itself after setting things up. In the foundry
case it maintains an ancestor process and spawns a sub-shell beneath that.
When running foundry
commands from a sub-shell it will proxy that work to the ancestor instance. This all happens with a private D-Bus peer-to-peer process. So you can have multiple of these in place across different terminal tabs eventually.
This is all built with a “libfoundry” that I could consume from Builder in the future to provide the same feature from a full-blown GTK-based IDE too. Not to mention the IDE becomes instantly script-able from your shell. It also becomes extremely easy to unit test.
Since I originally created Builder, I wrote a library to make doing futures, concurrency, and fibers much easier in C. That is libdex. I tend to make things more concurrent while also reducing bug counts when using it. Especially for the complex logic parts which can be written in synchronous looking C even though it is asynchronous in nature.
So the first tenant of the new code is that it will be heavily based on DexFuture.
The second tenant is going to be a reversal of something I tried hard to avoid in Builder. That is a “dot” directory in projects. I never liked how IDEs would litter projects with state files in projects. But since all the others continue to do so I don’t see much value in tying our hands behind our back out of my own OCD purity. Instead, we’ll drop a .foundry
directory with appropriate VCS ignore files. This gives us convenient space for a tmpdir, project-wide settings, and user settings.
The project is just getting started, but you can follow along at chergert/foundry and I’ll try to write more tidbits as I go.
Next time, we’ll cover how the command line tools are built as an N-ary tree to make tab-completion from bash
easy.