Basically, all I know is that writing crazy scripts like this drives me crazy. Right now, I'm trying to replace that crazy script with what I hope will be a less crazy Haskell program, except that the less crazy Haskell program doesn't actually look less crazy because it's trying to generate a Bash script. Sigh. Here's the Bash script that hopefully less crazy program generates as output. You can see here the beginnings of dimensionality, the token alignment method being run off the results of different sentence selection methods.
I don't know what other people doing the same kind of thing I'm doing approach the problem. Maybe I'm an idiot and everything is doing something obvious; or maybe they just don't care about the same things I do (for example, maybe they are perfectly happy to run a complex N-dimensional process by hand, just writing README files so that they always know what step to execute next, whereas I absolutely insist on automation); or maybe they're just wise enough to treat certain things as non-requirements (for example, maybe they have simpler scripts before they do not use caching of intermediate steps).
In any case, I still expect that I want the right thing but I just don't know how to get it. I think that involves some kind of abstraction. For me, this means writing something in Haskell. Right now, I'm reaching for the one abstraction I know, which is a monad, probably the wrong one.
Also, the way I'm currently approaching this is to use Haskell to generate Bash scripts, rather than just make my test harness be in Haskell (and execute IO actions). This has some downsides, particularly that writing Bash in Haskell can be painful and ugly (gluing bits of syntax tree together)... but I suspect I'll have to go this route for a while longer until I actually have a better sense for what I'm trying to do. One justification is that I already have a test harness in Bash, so it would be a lot easier for me to compare and see if I'm approaching what I want.
Anyway, so I guess today's work was:
- automatic dependency generation - if you list a target that has some dependencies, then the script will automatically include the targets for the dependencies
- dependency rebuild enforcement - if you pass in a target as input, the only way to get something from it will trigger a redo-ifchange
- rudimentary filename parsing - basically generating a chain of
$(basename $(dirname $(...)))
