"ex is the version of ed rolled up in vim, which extends the command set of ed. vi, by contrast, handles colon commands by invoking ed externally."
Actually vi and ex came about at the same time. You can see the POSIX standard mentions [1] ex and vi (not vim) together, and you can also refer to [2], under the "First appeared" column.
Indeed, there is a mistake in what I wrote. What I should have said is that Bill Joy wrote ex, and then he used this implementation to write vi. Vim is like vi in that it comes with an ex built in, which is an extension of Bill Joy's ex.
Actually vi and ex came about at the same time. You can see the POSIX standard mentions [1] ex and vi (not vim) together, and you can also refer to [2], under the "First appeared" column.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex...
[2] http://en.wikipedia.org/wiki/List_of_Unix_utilities