3 ms·
I've never actually used Prolog, but like you say, it always seems like a really cool language. That said, I always wondered why it needs to be a language inste
by hencq 11y ago
I've never actually used Prolog, but like you say, it always seems like a really cool language. That said, I always wondered why it needs to be a language instead of just a library in another language. It seems there are some types of problems that are really well suited to Prolog, but I don't think it necessarily applies to all problems. So why not use another language and then bring in the relational piece as a library? Granted, I think that's what Kanren does in Scheme, but it doesn't really seem to be all that common.
Also, maybe I misunderstand, but doesn't using Prolog limit you to the unification algorithm used? If you wanted to build something like the Cassowary constraint solver in Prolog would it be really easy or would you still need to implement the algorithm from scratch?
- dragonwriter 11y ago> That said, I always wondered why it needs to be a language instead of just a library in another language. It can be -- and often is. Depending on the language, the syntax may not be as convenient as using Prolog directly.
- sklogic 11y agoThat's exactly how I use Prolog - embedded in the other languages. It is especially invaluable inside compilers (alongside with an optimised Datalog). And I had to extend the default unification for implementing some exotic type systems.