3 ms·
Can we call SQL a programming language, or no? (I was trying to think of someone who's been around for a while, but maybe doesn't receive his just due.) SQL se
by farnsworthy 9y ago
Can we call SQL a programming language, or no? (I was trying to think of someone who's been around for a while, but maybe doesn't receive his just due.)
SQL seems to power nearly everything at some level, has much code written in other languages for the sole purpose of interfacing with it (for better or worse), has inspired other concepts and technologies (even as they are defined against it as what they are not), etc.
I don't think anybody mentioned C yet either, another foundational case…
- deleted 9y ago[deleted]
- gargravarr 9y agoWhere SQL excels is working on vast batches of data without using loops. Once you can think in terms of datasets, it becomes very logical to process it all at once. Nobody needs to mention C because it is definitely not underrated - it's earned its reputation and is respected/feared by developers everywhere!
- rntz 9y agoIf SQL deserves consideration for being "underrated", Datalog certainly does. Compared to SQL, Datalog makes recursive queries very natural[1], making it good for manipulating graph-like structures. For example, here's reachability in a graph: reaches(X,Y) :- edge(X,Y). reaches(X,Z) :- edge(X,Y), reaches(Y,Z). That was easy! Variants of Datalog pop up in unexpected places. Datalog dialects are often used for implementing code analysers (e.g. Semmle). Datomic's product is a variety of Datalog with S-expression syntax. UC Berkeley has a Datalog-based research language called bloom (http://bloom-lang.net/faq/ http://bloom-lang.net/faq/) aimed at implemented distributed systems. Datalog was also an influence on the recently-shuttered Eve (http://witheve.com/ http://witheve.com/) project. In its original form Datalog lacks aggregations, which is probably a big part of why it didn't catch on - aggregations are important! Still, some Datalog implementations add support for aggregations. Unlike SQL, Datalog never really became a standard; more an academic ideal than a practical tool. I think this is a shame. While Datalog doesn't have a canonical practical implementation, in terms of impact on how people think about data query languages, I think it's an academic gem. [1] SQL has recursive queries ("Recursive CTEs"), but they're neither widely used nor particularly well-supported in most SQL implementations - they're basically tacked on. This is partly because they're hard to optimize due to a lack of restrictions; with Recursive CTEs, SQL is Turing-complete. Datalog deliberately isn't, and there's a large literature on optimizing evaluation of recursive Datalog.