This is an automated archive made by the Lemmit Bot.
The original was posted on /r/programminglanguages by /u/__rcu on 2023-12-21 05:11:38.
Sorry if this is out-of-scope for this subreddit, but I’ve been unable to find a coherent explanation of this topic anywhere.
Every time I see this distinction discussed, the answers provided are typically some kind of useless analogy. As I currently (don’t) understand it, declarative languages are languages that are so high level that they totally obscure the implementation from the programmer, like SQL. Imperative languages allow the programmer to specify the steps that they would like done.
The issue I have is that these categories don’t seem well-defined. In C++, which I think most would consider imperative, the actual instructions which are executed are often determined by the distribution you are using and the computer you’re executing them on. For example, executing ``std::sort(begin(a), end(a))may do different things, depending on which compiler you're using. Similarly,std::setmay be implemented in a number of different ways. Sowhat’s the difference between declarative and imperative, in a rigorous way?
Once again, sorry if this is not the right place, or if I’m not asking it in the right way.

