3 ms·
> Hmm I'm fine with prolog, I love it, but I'm not sure how it can be used in practice. Well, that rings similar to what is said about Lisp sometimes, and I th
by hjek 8y ago
> Hmm I'm fine with prolog, I love it, but I'm not sure how it can be used in practice.
Well, that rings similar to what is said about Lisp sometimes, and I think it can easily be refuted by pointing to instances where it is being used in practice[0].
There are some problems that are fairly easy to solve in Prolog, but would be very difficult to express in SQL[1]. And recursive relations, which are at the core of Prolog, only made their way into SQLite 4 years ago[2].
My comment was specifically about those Prolog/Datalog implementations in Racket. Other Prolog implementations might be dealing sensibly with incremental updates (but I don't know).
> Having seen companies where SQL was used very extensively for analytics, data storage etc I can't see how prolog wouldn't help.
You can't see how Prolog wouldn't help, as in Prolog can only be an improvement over SQL?
[0]: https://www.youtube.com/watch?v=G_eYTctGZw8 https://www.youtube.com/watch?v=G_eYTctGZw8
[1]: https://xmonader.github.io/prolog/2018/12/21/solving-murder-prolog.html https://xmonader.github.io/prolog/2018/12/21/solving-murder-...
[2]: https://en.wikipedia.org/wiki/Hierarchical_and_recursive_queries_in_SQL https://en.wikipedia.org/wiki/Hierarchical_and_recursive_que...
- gnulinux 8y agoI think you misread my comment. I am pro-prolog but I'm skeptical of some of the details such as ACID complaint, being battle-tested, getting predictable performance etc. > Well, that rings similar to what is said about Lisp sometimes, and I think it can easily be refuted by pointing to instances where it is being used in practice[0]. I don't think this is relevant. (I'm also a very strong fan of lisp). Most criticism of lisp is to the language itself. People acknowledge that lisp is theoretically possible to solve complex problems easily but they claim this slows us down in practice. This is not my claim against prolog. I think the language is pretty powerful, but I'm not sure if we can find something as rock solid as postgres. > Prolog can only be an improvement over SQL? Yes, precisely.
- hjek 8y ago> I think you misread my comment. Yea, I did misread a bit of it. > I think the language is pretty powerful, but I'm not sure if we can find something as rock solid as postgres. While PostgreSQL may be better for most projects, SWI Prolog is also usable for practical problems, although (if I'm not mistaken) SWI Prolog requires all facts to be loaded into memory, so there's a limitation in scale. And yes, I could't find any resources indicating whether the SWI Prolog database is ACID compliant. But with Racklog and Racket Datalog it doesn't make sense to talk about whether they're ACID compliant as there's not yet any storage mechanisms, so they are not yet usable in any context involving persistent data. The limitations of those implementations are very different from limitations with Prolog/Datalog as such.