Hacker News new | ask | show | jobs
by gowld 1283 days ago
GHC for Haskell for example has a graph-reduction runtime, and a lot of effort goes into optimizing that to use referential transparency and laziness effectively.

Prolog is similar (even more so) an example of a high-level declarative language with an optimizing runtime, but (I guess) isn't as optimized. Prolog runtime could incorporate a SAT or SMT solver internally, without changind the language, right?

1 comments

Not really because of the cut operator. It can be optimized with tricks like tabling, but changing the evaluation order is generally unsafe. I think a larger aspect is that a SAT/SMT solver introduces an even more confusing black box than Prolog's evaluation strategy. You can reason about the performance of Prolog programs in ways that you just can't with SAT/SMT solvers.