7 ms·
Prolog is the poster child for declarative languages. To some extent SQL and Excel fall into declarative language camp. Functional programming is as you say us
by sireat 12y ago
Prolog is the poster child for declarative languages. To some extent SQL and Excel fall into declarative language camp.
Functional programming is as you say using functions and avoiding side effects. See Haskell, see ML, see LISP, I do not see declarative languages among them.
Two completely different animals.
- Dewie 12y agoYeah, prolog. The declarative language where you just specify what you want, and still have to learn the underlying unification algorithm to use it[1], and sprinkle very procedural cuts around your code in order to keep the algorithm from taking unnecessary paths. > Functional programming is as you say using functions and avoiding side effects. See Haskell, see ML, see LISP, I do not see declarative languages among them. Heh, so you're saying that functional programming is not declarative because it is not prolog et al.? No, functional programming is also considered a declarative style of programming. It doesn't matter that it isn't logical programming, or excel. (If you think this argument is a bit just-so, well it's a reply to the same style of "argument". If you want to claim that FP is not declarative, please argue why it is not declarative.) [1] Which is often more effort to learn compared to the conceptual evaluation model of FP, since the FP evaluation model can often be viewed as a more restricted version of evaluation used in imperative languages.