4 ms·
Stuff like this is always fascinating to me since I read 'The Reasoned Schemer' and worked my way through Clojure core.logic. So as I understand this leverages
by kamaal 4y ago
Stuff like this is always fascinating to me since I read 'The Reasoned Schemer' and worked my way through Clojure core.logic.
So as I understand this leverages and extends Prolog, and yet it is very dry on showing your average programmer how they could use this to solve their real world every day problems. If such a segment of user being the intended audience here at all?
Either way resources to learn something like this to do something useful are welcome. Can somebody who is more familiar with the ecosystem give some pointers?
- rad_gruchalski 4y agoOne reason could be having oop-style objects available in Prolog. Prolog modules are global, they’re like a singleton, or like s bunch of namespaced functions. Once you import a module, it is like a singleton. Prolog doesn’t have anything what could store a state of a module so functions inside of a module can operate on some common state. One way would be to use a global database but that’s really discouraged because of performance impact it can have. Modules being a Prolog construct can be basically created at runtime. So if you need multiple instances, you could create and load multiple modules at runtime. But that’s pretty verbose and quite a bit of work. Logtalk gives you this out of the box using your standard Prolog.
- harperlee 4y agoI think one of the use cases for lambda-prolog (a prolog for higher-level logic instead of first-level logic) was the ability to implement modules in a logical-native way.