@[email protected] @grainloom wish I had satisfying answers. I ought to explore Rain’s suggestions more sometime.
There seems to be tension between how much is done at compile-time (validation, code generation, optimization) and run-time. Many intentionally designed type systems use type erasure to intentionally lighten the output and prevent runtime cheats. Idris does some clever tricks to determine which dependent types need to be checked at runtime.