A DSL written in a dependently-typed language (such as Idris) would suffice for both the kind of safety and the level of expressivity I require. (Unfortunately, the various JS backends for Haskell, Idris, Agda, etc. are not usable for my purpose, since I need the output to be readable and debuggable).
Anything less than what I have proposed in the previous paragraph is pretty uninteresting to me. It's unfortunate that people are working so hard on Kotlin, when it cannot contribute anything new or interesting, by its very nature.