Swift is necessary on macOS and is doing fairly poor outside of it because it didn't have Windows and Linux support on par.
That Swift isn’t as popular outside the officially supported platforms isn’t surprising and doesn’t matter. The point is precisely that it didn’t have to cater to a specific one (Windows) to achieve success.