Let's forget about programming for a minute. All language (human or computer) is about communicating an idea. Some languages have many words, and some have few. Some have short words, and some have long words. Some have many words that say the same thing with different nuance, and some have just one, or none at all.
This makes certain languages able to convey some ideas more effectively than others, and usually, the more "important" a concept is for a language to want to express, the shorter a word it is. But there's a tradeoff: there are only so many short words you can make, so less important concepts usually need to be relegated to longer words.
Usually, too, the simpler an idea is, the fewer words a language will need to talk about it.
A language that's really good about talking about certain ideas will have certain ideas that it can't talk about as easily. Cultural priorities, history, etc., shape how a language works over time to "optimize" for the concepts that the speakers find more important.
The relevance:
- In a language like JavaScript, the "idea" of presenting an alert is "simpler" (there are few configurations possible for what an "alert" is/can do), so the single word
alert may be enough to express the concept
- In Swift on iOS, the "idea" is more complicated (there are many configurations possible for what an "alert" is/can do), so it requires more words to express clearly and without being ambiguous
Part of what others have tried to explain: the idea you're trying to express doesn't come up nearly as often as other ideas, so it takes more words to say than they do. If it was more common to need to express this idea, we'd come up with shorter words to say it, as you suggest.
You can come up with your own words for some ideas (i.e., writing a function to do what you want) and use those, too, if you need to say them very often.
(And in general: Swift tries to be a language that is good at saying many different things effectively, which means that there are many individual ideas that other languages can be better at saying, with the tradeoff that they may have a harder time expressing the majority of ideas that Swift tries to talk about.)