Can programming be truly declarative?

I got involved in declarative and imperative programming for a bit, and I came to the (possibly false) understanding that declarative programming is more or less just an abstraction.

For example, as I understand these concepts, calling a method to do something will be declarative, whereas the implementation of the method is mandatory (optional, although not declarative).

Hence, it seems that wherever you have declarative code, somewhere down the line, it should rely on non-declarative code for implementation. Is this just its nature or are there languages ​​that are 100% declarative (something I can't even think of)?

Please correct me if my understanding of these concepts is disabled! Although I'm about halfway through my BA in Computer Science, I feel like until now I was still taught to "type stuff so the right things happen when you run the code."

Thank.

+3


source to share


1 answer


Declarative programming expresses the logic of a software component without highlighting its control flow. This methodology of calling functions (which is called functional programming - a subparadigm of declarative programming) that you talk about can be a little confusing, especially when learning programming and perhaps learning a language like C / C ++ / Java. There are functional programming languages ​​such as Lisp and Haskell that fully utilize the functional paradigm.



When I first started, I would not have studied the implementations of these paradigms at the same time. Instead, I find it easiest to think of declarative languages ​​as highly expressive languages ​​like CSS SQL. They describe WHAT is to be done in plain English with distraction.

0


source







All Articles