4 ms·
To me this makes Prolog sound like a tool to reach for similar to SQL. Specialized language for asking specific kinds of search or query over your data.
by jimbokun 2y ago
To me this makes Prolog sound like a tool to reach for similar to SQL. Specialized language for asking specific kinds of search or query over your data.
- gorkempacaci 2y agoIndeed Prolog programs are also called databases sometimes. Some things Prolog can do over SQL: - infinite data defined by recursive predicates - flexible data structures (think JSON but better, called complex terms) and a way to query them (called unification algorithm) - execution strategy fine-tuned for reasoning (called resolution algorithm). You can do this with SQL but you’d have to formalize things using set operations and it’d be very very slow. On the other hand, SQL can query plain data very very fast.
- wwweston 2y agoI've also wondered why Prolog or at least Datalog isn't available/used more widely as a query layer, especially considering that the promise of SQLs natural-ish language really didn't lead to a level of adoption among non-tech workers even approaching the popularity of the spreadsheet, so the reason for that style of syntax didn't really pan out, and Prolog would appear to have some syntactic and capability advantages.