There are some inspiring thoughts in Paul Davis’s recent post about open source and Ardour that are nice to think about while I’m slogging through the current stage of the move to libpippi / C astrid.
I wonder if going forward, large-scale apps like Ardour ought to (as Reaper did relatively early in its life) consider the “script extension system” to be a vital and critical part of the application infrastructure. This would mean, for example, writing large parts of “core functionality” using this system, rather than dropping back into C++ to get things done. There are precedents for this: GNU Emacs, for example, is at some level written in C, but almost everything about the program is actually constructed in Emacs Lisp, its own “scripting extension”. The C core of Emacs is so small and so irrelevant that it almost doesn’t matter that it is there: if you want to modify or extend Emacs, you (almost always) write Lisp, not C.
Pippi and astrid have somewhat different concerns than a monolithic application like Ardour or Reaper, but in 2016 after a major cython refactor I found myself really wanting to be able to embed parts of pippi into other places, or use it alongside other systems, and finding it all basically trapped inside cython. The move to getting all the fun stuff into libpippi where it can go frolic among the microcontrollers or spend a summer inside a Pure Data object was inspired by that realization that I’d put all my eggs in the python basket. (It didn’t help that at the time python was in the worst throes of the v3 situation.)
The side effect is I’ve fallen in love with C all over again, and I’m approaching libpippi and astrid a bit defensively more as a toolkit to build other tools ad hoc, if I can manage that.
I also think about programs like git, which isn’t really just one
program, but lots of little programs that can be composed together. UNIX
itself is like this with complementary userspace programs that expose
their library functions to shell scripts. The program mkdir
and the syscall mkdir for example do (basically) the same
things. The mkdir program ultimately just calls
mkdir(). So does the printf program and others
like it.
Astrid has a small set of programs inspired by this tradition, too.
There’s astrid-dac which waits for serialized buffers on a
message queue, schedules their playback and mixes them to speakers. The
astrid-adc program writes input into a shared circular
buffer. The astrid-msg program turns command line arguments
into binary messages and sends them over astrid message queues. The
astrid-seq program takes those binary messages and
schedules them for broadcast at a later time. The
astrid-renderer program listens for messages on its queue,
does async renders and then shuffles them off to the serialized buffer
queue.. and so on. These are all in some stage of already existing
more-or-less as their equiv library functions, or are on deck to be
ported…
Seems useful. Slog on.