Why don't more languages offer flow typing?
This is not a complete answer, but covers some languages. If you program too exclusively in dynamically-typed languages, you can be too used to not thinking about how physically large your types are, because you work in a world where <i>everything</i> is boxed, and allocations so plentiful you don&#x27;t even hardly have a way of thinking about them because your language does them at the drop of a hat, and so on.<p>But there are many strongly-typed languages that look at types at compile time and decide how large they are, by which I mean, how many bytes of physical RAM they take. These languages have gotten better and better over time at the APIs they offer that give the benefits of this without incurring the programmer costs, but under the hood, no matter how slick they&#x27;ve gotten, there is still a mapping of type -&gt; size &amp; layout. In these languages, this sort of narrowing is a great deal more complicated, because it implies a new type, which will probably require more allocation. For instance, in the example given between a &quot;string&quot; and a &quot;number&quot;, that definitely looks like two differently-sized types to me. This would become very complicated very quickly as you start having to allocate these things in ways that can&#x27;t be transparent to the user, you have to pass these types around, etc. etc.<p>One would expect that the affordances of statically-typed languages would end up being very different. And in fact, they are. Many modern statically-typed languages can solve the same problems outlined in the post, they just solve it in a different way. In this case, an Either, or more generally, a sum type. Then &quot;getViewsOf&quot; returns a value of that sum type and you can switch on it based on the value. It isn&#x27;t exactly the same, in fact I&#x27;m not sure there&#x27;s one aspect of it that&#x27;s the same let alone the whole, but it solves the same problems.<p>So my suggestion would be that there are in fact a lot of languages that essentially have the same feature. They just don&#x27;t call it &quot;flow typing&quot; and it&#x27;s not spelled the same way.