3 ms·
Prolog is a beautiful language. I've written 10s of thousands of lines of it, for mathematical reasoning, rule-based reasoning, etc.. Those are domains where it
by bradley13 3y ago
Prolog is a beautiful language. I've written 10s of thousands of lines of it, for mathematical reasoning, rule-based reasoning, etc.. Those are domains where it fits perfectly, and working with it is incredibly fun.
Prolog has two problems for other kinds of applications. First, it doesn't play well with libraries and other languages, because the paradigms are so different. Second, doing any sort of decent GUI is close to impossible, again, because it doesn't fit the paradigm.
- crabbone 3y agoI helped write the interop with Go part of GoLog. And, no, it's not really difficult to interface with other languages. Usually, from Prolog side you see the foreign interface as a predicate with all ground arguments and from the foreign sign you interact with Prolog similar to how you would interact with SQL database: you send a query, then deconstruct the query (including requesting more solutions or driving backtracking etc.) You could say these aren't "interesting" interactions. But this is how it would work because libraries don't really exploit the useful features of Prolog. You could, in principle, write "thicker" layers of interop, where you'd probably have to aggregate multiple library functions into single predicate interface on the Prolog side, where a specific sub-routine would be called based on instantiation mode of the arguments. But this is hardly different from exposing C libraries to object-oriented languages (like Python), where you aggregate multiple C functions to act like property accessors or to act like methods of a data-structure etc.