What I Would Like to See in a Type System
loudenanalytics.com
loudenanalytics.com
If you want it to happen at runtime, you could accomplish something almost exactly as you describe with macros in multiple mainstream languages. Or, as you alluded, just use business logic.
You'd probably enjoy a more declarative language like Haskell, honestly.