Dependent Types and Protocols

I'm not sure if I understand the advantage of what you are suggesting without more detailed examples. But I think the direction Swift is currently going is to enable more domain specific language which started with things like property wrappers and function builders, but now we're also getting expression macros. Maybe those can (partly) solve what you are striving for?

Again, sorry if I misunderstood what you're trying to achieve here.