I actually wrote some thoughts about this a few months ago [0]. tmux actually does a really good job in this regard, the config language is fairly simple, and if you want to do more complicated things you just shell out and then use the CLI which is great because it exposes all the things you can do in a config file.
[0]: https://willhbr.net/2024/01/18/the-code-config-continuum/