Julia is basically this, i.e. compiled typed python. The nesting for type declarations gets gnarly though, which answers your general question - the really nice language ergonomics cost compute at runtime because that’s the only way you avoid laying everything out beforehand.