The general problem is that typing for these sorts of systems suck. If it works it's a nice little safety feature, but when the types don't line up it's infuriating. Treating everything as a lowest common denominator makes compatibility trivial.
Powershell offers this I believe.
Yep. Not perfect... type systems have come a long way since PowerShell did it. But it's a good start.
Look at stuff like PowerShell secure strings for an example of the sort of neat stuff you can do.
NuShell is also attempting this. Both are cross platform.