News for hackers. Stuff that matters.
Re:Prolog Coding Horror by fleur-de-lotus on Monday May 18, 2026 @02:17AM (#48176139)
Not used. Quote about prolog: The elegant solution is not efficient. The efficient solution is not elegant.
Re:Prolog Coding Horror by Antibabelic on Monday May 18, 2026 @03:48AM (#48176613)
Prolog is an elegant abstraction. One of the points of abstractions is that they let us concentrate our optimization efforts in one place. Prolog benefits from many decades of research into how to make it work fast. When your problem does require a Prolog-shaped solution the most sensible thing to do is to use a highly optimized Prolog system instead of reinventing a naive algorithm yourself. Your "inelegant" solution will not be faster.

(This is also the problem with "I'll just quickly implement a Prolog-like DSL when I need it". Sometimes not a bad idea, but you have to be realistic. Your "lightweight" Prolog will be worse in every way compared to serious Prolog implementations).

Re:Prolog Coding Horror by taneq on Monday May 18, 2026 @03:31AM (#48176506)
I feel like an inefficient solution is inelegant by definition.
Re:Prolog Coding Horror by Smaug123 on Monday May 18, 2026 @04:06AM (#48176700)
Nah - for example, AIXI is so inefficient that it's literally uncomputable, but it is beautiful.
Re:Prolog Coding Horror by zingar on Monday May 18, 2026 @04:09AM (#48176708)
That sounds intuitively right but breaks down when you ask “inefficient at what?”. Are you efficient with CPU cycles or efficient with human working memory?
Re:Prolog Coding Horror by Antibabelic on Monday May 18, 2026 @03:40AM (#48176564)
Richard O'Keefe in The Craft of Prolog: "Elegance is not optional".