4 ms·
As do I, for semantic clarity reasons. One example is SQL, which is written in a different order than it is executed. Humans can reason quite well about many th
by saosebastiao 11y ago
As do I, for semantic clarity reasons. One example is SQL, which is written in a different order than it is executed. Humans can reason quite well about many things that are expressed out of order, but instructions have never been one of those things. Ideally it shouldn't matter, as SQL is supposed to be declarative, but each step transforms the data in some way such that you need to know the order.
Datalog is interesting because there is no statement order...it is pure declarative. Every transformation has an output that is bound to a unique identifier, which makes reasoning about order sequential even if the words on the screen are not. As great as SQL is, it would be better if we could go back to the foundings of relational databases and make Datalog the default query engine.
- joe_the_user 11y agoThe thing with SQL is that it was indeed written to allow English-like statements and to be an "easy to understand" language. If you take only the simplest SQL statements then it is easy to understand but with any complexity it indeed becomes hard. Despite this, SQL is the most successful logic/declarative language in the world. I think it's been argued that Prolog and logic programming stalled because SQL is good enough for the largest domain that logic programming is useful for. Ultimately, I don't think it's any missing feature in SQL that makes it hard to understand large statements - it's just that large logic statements are hard. Maybe some way to make expressions more modular - incrementally constructing "adjectives" for use where clauses for example. But much as we all like our pet improvement to logic expression, I don't think that's the problem.