When designing DSLs, you're not bound to the type system of the host language.
The talk references How to Design Programs a lot.
https://github.com/SparkFund/spec-tacular https://github.com/takeoutweight/bidirectional https://github.com/clojure/core.typed
- Types and Programming Languages
- Practical Foundations for Programming languages
- Study Haskell or OCaml