4 ms·
I've seen "declarative" languages that included if statements (explicit dynamic behavior!) still passed off as declarative. Some even add sequencing, and what n
by seanmcdirmid 12y ago
I've seen "declarative" languages that included if statements (explicit dynamic behavior!) still passed off as declarative. Some even add sequencing, and what not. However, its ok because they aren't part of the language core, just escape hatches on expressiveness :)
"Declarative" always exists in a spectrum: one's specification is another's implementation. It used to be that Fortran was "declarative" because you no longer had to write machine code and schedule instructions by hand! In truth, it is about how many, not just the kind, details can be omitted. E.g. the list order element is probably important, and if HTML couldn't guarantee that this order would be preserved at run-time, there would be some big problems.
- leoc 12y ago> "Declarative" always exists in a spectrum: one's specification is another's implementation. I'll go further: statelessness and applicativity obviously have an intimate and important relationship with declarativity ("what rather than how") (just as non-Turing-equivalence does), but they're not the same, and trying to simply define the latter as the former is an annoying PR wheeze that spreads obfuscation.
- innguest 12y ago> It used to be that Fortran was "declarative" because you no longer had to write machine code and schedule instructions by hand! Maybe, but even at that time, pure mathematics was still more declarative than Fortran, so it's not a relative term. > In truth, it is about how many, not just the kind, details can be omitted. I think it's about the kind of details that can be omitted. If I can omit implementation details (how to execute my code on a given machine) from my function declaration, then that is a declarative function.
- seanmcdirmid 12y agoAgain, an implementation is just a more detailed specification. I can say "make me a cake", or I could provide a high level theory on cake baking so my cake gets made, or a detailed recipe, or I can describe all the movements needed exactly. Which one is declarative? There are many levels in describing what one wants, that there is somehow a magical sharp line where it becomes "how" is not reasonable.