Questions tagged [declarative-programming]
A non-imperative style of building the structure and elements of computer programs that is concerned with what the program does over how it does it. Dealing with Query Languages, Reg Ex, logic, functionality and config systems.
25 questions
16
votes
7
answers
9k
views
Is declarative programming just imperative programming 'under the hood'?
From my understanding, in declarative programming, programmer only need to define the end result, but not how to compute it. But for execute that said function, the function must be pre-defined by the ...
3
votes
5
answers
905
views
Is assignment declarative or imperative?
On Wikipedia, the article Programming paradigms defines
declarative as a paradigm in which the programmer merely declares properties of the desired result, but not how to compute it;
imperative as a ...
14
votes
6
answers
3k
views
Is "Low Code" declarative by default?
Something that has really be getting under my skin recently is that Salesforce uses the term "Declarative Development" to mean "Low Code" or "visual code".
For example, this article explains the ...
3
votes
3
answers
233
views
Precisely define "what to solve" and "how to solve" corollary in functional and imperative programming respectively
I am not sure if I ever clearly understood standard corollary "what to solve" and "how to solve" used to point out difference between functional (declarative) and imperative programming paradigm ...
-1
votes
2
answers
176
views
Are executable requirements the most advanced form of declarative code?
The more declarative code is, the less explicit technical details it contains and the closer it gets to requirements expressed in domain language.
In the extreme case, there is no more difference ...
11
votes
3
answers
5k
views
Do functional programming languages disallow side effects?
According to Wikipedia, Functional programming languages, that are Declarative, they disallow side effects. Declarative programming in general, attempts to minimize or eliminate side effects.
Also, ...
1
vote
1
answer
251
views
Is there an EBNF form for Inform 7
I'm trying to learn the language Inform 7 and its very odd programming model.
Unfortunately I'm finding it hard to get my head around it because the language reads so much like natural English. I ...
7
votes
1
answer
376
views
Why does FSharpLint suggest, "In F# code, use 'e1 || e2' instead of 'e1 or e2'"
If I write the expression,
if not (expr1 or expr2) then value
I get the following warning from FSharpLint, In F# code, use 'e1 || e2' instead of 'e1 or e2'.
Why is using || preferred over using or? ...
0
votes
2
answers
244
views
Can a purely declarative language cause runtime exceptions?
Let us consider a purely declarative language such as SQL, XQuery, or a logic language like Prolog, or a purely functional language without variable mutability.
Considering that the interpreter or ...
3
votes
3
answers
583
views
Declarative programming for deterministic real time control
Let's say you want control a motor in real time. Normally you would use a microcontroller or PC with e.g. c-programming language. So you would use an imperative approach. You tell the microcontroller ...
6
votes
2
answers
4k
views
Is declarative programming overrated? [closed]
I've been programming for years with primarily-imperative languages (C++, C#, javascript, python), but have recently experimented with some functional langauges (Lisp, Haskell) and was excited to try ...
1
vote
2
answers
460
views
Declarative parser for JSON and DOM
I am parsing many JSONs and DOMs in PHP. The problem is that the my knowledge about the structure of the JSON/DOM is mixed with code. For example, suppose that I have few sources of first and last ...
18
votes
5
answers
7k
views
What makes functional programming languages declarative as opposed to Imperative?
On many articles, describing the benefits of functional programming, I have seen functional programming languages, such as Haskell, ML, Scala or Clojure, referred to as "declarative languages" ...
3
votes
2
answers
1k
views
How to infer the result of a query?
To understand what a query does, I have always thought the following is the procedure on evaluating a query:
Form the table as specified in the FROM clause.
Pick the rows from that table as specified ...
25
votes
9
answers
14k
views
The dream of declarative programming [closed]
Why hasn't the dream of declarative programming been realized? What are some concrete obstacles getting in the way? For a simple example why can't I say
sort(A) is defined by sort(A) in perm(A) &&...
2
votes
2
answers
786
views
How are declarative languages executed by a computer?
I'm getting introduced to declarative languages and am beginning to love them. In particular Haskell, a functional language, is very expressive, easy to debug. But my question has to do with execution....
2
votes
1
answer
224
views
Declarative caching on Collections
I am interested in using Spring's Cache Abstraction on a module that I am working with but all data operations are on collections to avoid multiple datasource invocations, so I am not sure I have a ...
1
vote
1
answer
1k
views
Mixing declarative & imperative code (Implicit 'unit tests' ?) [closed]
Well I'm no expert, but as a student, I'm curious about languages and their design patterns / goals.
I'd like to know, whether there are any points I miss in the following examples, and why ...
3
votes
1
answer
129
views
In a declarative language, specifically in the context of modelling, can we make a clear distinction between code and data?
For declarative languages, specifically (but not limited to) in the field of modelling, it's not obvious to me whether code can be considered to be separate from data. This line of reasoning may only ...
30
votes
3
answers
15k
views
Is SQL declarative?
I ask because so many of the questions I see in SQL amount to: "This is slow. How do I speed it up"? Or are tutorials stating "Do this this way and not that way as it's faster".
It seems to me that a ...
2
votes
1
answer
1k
views
Is Clojure a 3GL or a 4GL?
A bit of background (in case I'm mistaken)...
I think I understand that (it's an oversimplification):
manually entering codes into memory (or on a punchcard) is "first generation language"
using ...
4
votes
3
answers
601
views
How could you reconcile declarative database development and non-trivial data 'motions'?
Coming back to SQL Server after several years away, I find the Visual Studio Database projects (and now SSDT) very exciting, as they are aiming to offer a way to develop databases declaratively, ...
5
votes
7
answers
1k
views
How to better start learning programming - with imperative or declarative languages? [closed]
Someone is interested in learning to program. What language paradigm should I recomend him - imperative or declarative? And what programming language should he start with?
I think that declarative ...
1
vote
1
answer
208
views
Declarative input language strategies [closed]
I need to develop a simple declarative language to drive an application. I have various computational modules, some of them depending on other modules which also need setup. The problem is that I don'...
13
votes
4
answers
1k
views
What are some good practices when trying to teach declarative programming to imperative programmers?
I offered to do a little bit training in F# at my company and they seemed to show some interest. They are generally VB6 and C# programmers who don't follow programming with too much passion. That ...