2 ms·
IMHO, Prolog is the leading example of a language you learn for the brain-twisting, and not for actual usage. Even moreso than Lisp. Full-blown end-to-end Prol
by lmkg 10y ago
IMHO, Prolog is the leading example of a language you learn for the brain-twisting, and not for actual usage. Even moreso than Lisp.
Full-blown end-to-end Prolog programs in production are vanishingly rare, and for good reason. But much more useful are the Prolog-inspired chunks of code dealing with a separable part of a larger problem. Logic-based programming is an appropriate tool for some problems, and it can be applied even in the context of procedural (of course, it's easier in languages that support DSLs).
As an example, clojure's core.logic seems to be pretty popular and that's basically just a subset of Prolog. Somewhat counter-intuitively, Prolog-inspired DSLs tend to more straightforward because they're missing some of the advanced features that Prolog needs to make it usable. The DSL can rely on the host language to do some of the dirty work for it.
- mondoshawan 10y agoActually, less than you might think. The Android OTA recovery environment is written in prolog, last I remember.