3 ms·
I initially wrote the word "declarative" but I don't really like it. It implies an objectivity and absoluteness that doesn't align with the subjectivity inheren
by dwohnitmok 5y ago
I initially wrote the word "declarative" but I don't really like it. It implies an objectivity and absoluteness that doesn't align with the subjectivity inherent in trying to tie code to a programmer's intentions. That is what is declarative for one developer or one set of circumstances may smack of being overly procedural for another (see e.g. what opinions you'll get if you tell a population of programmers that regexes are declarative).
To be more specific, SQL and regex literals still don't really capture the magic of Prolog which is unification. It's a heady thing to realize that telling a machine facts and asking it for information is fundamentally the same thing! Just a matter of whether you pass a constant or a variable.
To compare with SQL, it would be as if you did away altogether with the notion of separate `SELECT` and `INSERT` statements and the same prepared SQL statement could be used to mutate the DB or return data just based on what you pass to the `?` parameter.