I do not have a strong background in theoretical computer science, so the terminology I use may not be the most ideal.
Basically the "trend" across programming languages I have noticed is that there appears to be an trade-off in the speed of a programming language (how long it takes to execute a program) and its expressiveness (saying you want something done vs saying you how you want something done, more expressive languages focus less on the "how", from this definition).
For example, in "higher-level" languages like Python or Java - it is very easy to do something like finding the index of an item in a list with a single line like list.indexOf(item)
. In comparison, doing the same action in a "lower-level" language like C can result in code that is much faster, but at the cost of having write the code yourself which may be several times as long.
Again, this is really just a trend I have noticed and not a hard and fast rule. Languages like C++ that are both very fast yet can also be pretty expressive at times blur the lines.
So I am curious, is there any sort of formalization in programming language theory - or even just rough rules of thumb backed by empirical studies - explicitly listing out the trade off between the expressiveness and execution speed of a programming language?
Or perhaps I am just overthinking it, and having slower code is just a unavoidable byproduct of having a more expressive language as more things are taken care of "behind the scenes" / abstracted away from during compilation, interpretation, etc.?