3 ms·
I believe it's the combination of needing exploration but also wanting "safe checkpoints" that leads me now towards writing in terms of code generation first an
by crq-yml 3y ago
I believe it's the combination of needing exploration but also wanting "safe checkpoints" that leads me now towards writing in terms of code generation first and making big iterations through the generator, and then subsequently testing and exploring interactively. I've been working in a blend of Forth, Lua, and Python this way. All three have REPLs. Python is the "fattest" of the three, and does more of the dirty work with the OS and file processing since those things are built in. Lua is the one I actually want to use for the primary task of generating source because of its small size, familiarity and flexibility. Forth is the tip of the spear and solves concrete lower-level stuff without needing the help of another layer.
While I haven't yet made this process very sophisticated - it's mostly string substitution, pretty prints and state machines - it has a natural way of tightening the screws on any specification, because each step presents challenges about which layer I want to use, and whether I want to break with locally idiomatic usage and take the approach of inlining something from above instead.