What makes a language "optimized" for a specific task?
There are a few things to consider:

Abstraction: what does the language treat as &quot;special&quot;? Are matrices first-class values, like in Matlab, or do you encode them using simpler types like arrays, as in C? C makes you think about how matrices are implemented, Matlab doesn't.
Likewise, if you've got a complicated system of asynchronous communications, you probably want first-class functions so that you can do callbacks.
The more features that are added, the more complex the language gets. So while there are some &quot;multi-paradigm&quot; languages like C++ and D, most languages pick a niche, choose the things that are important to that niche, and prioritize those as their main abstractions.

Performance: all abstraction comes with a cost, whether it be compile-time or run-time. Some languages limit themselves in a way that makes them less abstract but more performant.
Early Fortran didn't allow for pointers or recursion, so it was great at number crunching, faster than a language like C, where you were running lots of loops. But it was terrible at encoding large data structures, like trees, where you needed pointers for indirection. (Note that I don't know much about modern Fortran.)


Essentially, there are always tradeoffs. More abstract means either slower runtime or more complexity at compile-time. More features means a more complex language. Some features make certain things fast and others slow, like pointers and recursion. There's no perfect language, so each language will reach a sort of local maximum in the space of language qualities.