Hacker News new | ask | show | jobs
by cricketlover 659 days ago
Do we need another language for querying relqtional data? Why not just use SQL?
3 comments

Datalog is a subset of Prolog, both of which predate SQL. By your logic, we should be asking what was the point of SQL.
> what was the point of SQL.

IBM's get-it-out-the-door release of partial (if not broken) implementation of Codd's relational-algebra model, which incorporates parts of predicate-logic, set-theory, and more besides. It kicked-off an industrywide multivendor revolution in information storage, processing, and retrieval.

...but thesedays I'm convinced the point of SQL is to have something other programming languages can point-to to deflect any criticisms of being slow or unwilling to adopt new features, being specifically unergonomic, or most of all: being entirely unresponsive to the day-to-day needs of present-day application developers.

Datalog is strictly more powerful than SQL and way easier to understand recursive, self-referential queries than CTEs.
Datalog is rad and has some neat ergonomics. It’s not so much a need as a want kind of thing. It’s definitely worth looking into.

I’ve only ever seen it used in Clojure(Script) projects although there’s support in other languages too.