3 ms·
In the sense that Turing-complete languages are all equivalent, yes. But in most imperative and functional languages, you'll end up implementing your own solver
by sterlind 4y ago
In the sense that Turing-complete languages are all equivalent, yes. But in most imperative and functional languages, you'll end up implementing your own solver (as Norvig did), and a DSL to model your problem. Why reinvent the wheel?
- 7thaccount 4y agoI think a lot of folks have figured out it's easier to do these problems using a DSL inside a general purpose language than to try to use something like Prolog to do both. For example, to optimize the grid, you might have a Python app that imports the GUROBI solver module and tells GUROBI to optimize. The advantage is all the file IO, directory, and database stuff gets to be handled with Python (easy easy).
- mzl 4y agoMost constraint programming applications are written in traditional imperative languages using solver libraries like OR-Tools, Gecode, IBM CP Optimizer, and others. This is both because that works best in the larger context of most applications, but also because solver libraries are generally better than the specific solvers integrated into Prolog systems. Sure, it is possible to use Prolog to solve problems using CP, but in my experience that is a vary small part of the total usage.
- btilly 4y agoWhy reinvent the wheel? If you give me a choice between implementing a solver in an imperative language or a website in Prolog, I'll choose writing the solver. Every time. Problems in the context of a programming environment where you're already using other languages. Introducing a specialized one does not necessarily make much sense.
- sterlind 4y agowell of course, but why not write the solver in Prolog and the website in Python? why are people so allergic to mixing languages? if the problem is simple to describe, then sure, write a solver or use a binding. I'm just used to the problems being pretty intense and sophisticated. I've found having a REPL in a symbolic (term-rewriting) language to be invaluable, and can't imagine going back to for-loops and endless maps of symbol tables chugging out text files for debugging.
- btilly 4y agoLet me turn it around. Why would I use an external language instead of a library in my existing language? It really isn't as hard as you indicate.