DEV Community

Discussion on: The Programming Language That Changed My Life!

Collapse
 
combinatorylogic profile image
combinatorylogic • Edited

Prolog can help a lot with solving everyday problems. Just keep in mind that you can embed Prolog into pretty much any language (with a different degree of clumsiness, of course). See Clojure core.logic or MiniKanren for multiple Scheme implementations for example.

A standalone Prolog is a weird beast with few real world applications. An embedded Prolog is a power tool applicable everywhere.

For example, I often use elements of Prolog to implement code analysis passes and optimisations in compilers, and this way it's often an order of magnitude shorter than any ad hoc solution. I use Prolog to encode decision making systems and to explain their decisions (or generate a code from them). I use Prolog with a CLP(FD) to do all sorts of constraint solving problems, from making time tables to scheduling multi-cycle operations in a high level hardware synthesis.

Once you start thinking in Prolog, all problems start to look like nails suitable for this hammer.