News for hackers. Stuff that matters.
Re:Minikanren – An embedded DSL for logic programming by CJefferson on Monday December 17, 2018 @08:54AM (#18698907)
It is useful for problems where the solution is difficult to find -- any kind of problem with many constraints which conflict, and maybe an optimisation condition. Such problems are very difficult from most programming, when it tends to be way to find what you want (although of course you can always optimise it further).
Re:Minikanren – An embedded DSL for logic programming by weberc2 on Monday December 17, 2018 @09:00AM (#18698933)
This sounds like a layout engine for a GUI toolkit. If you have a bunch of widgets with optional min and max widths and other constraints and you put them all in the same row, the layout engine needs to compute the real size of each widget (also constrained by the width of the parent widget, which is also dynamic and resolved by the layout engine save for the top level window widget) so it can be rendered.
Re:Minikanren – An embedded DSL for logic programming by typon on Monday December 17, 2018 @09:15AM (#18699008)
You can use standard constraint solvers for these kinds of problems. Although, you can use minikanren in such an application, you are missing out on a lot of its power if you do that.

An example where such systems shine is program generation, theorem proving, knowledge databases, program verification and other applications where the search space is huge but the rules are relatively simple.

Re:Minikanren – An embedded DSL for logic programming by simongray on Monday December 17, 2018 @09:12AM (#18698986)
Ok, thanks for answering. I guess what I'm really looking for are some practical use cases that can serve as an example, otherwise it will never cross my mind to use logic programming when I need to decide on technologies.
Re:Minikanren – An embedded DSL for logic programming by Blackthorn on Monday December 17, 2018 @09:50AM (#18699243)
Basically -- anything that you'd use SQL for. SQL is probably the most widely-used logic programming language.
Re:Minikanren – An embedded DSL for logic programming by typon on Monday December 17, 2018 @10:46AM (#18699626)
SQL does way less things than a full-blown logic programming system
Re:Minikanren – An embedded DSL for logic programming by Blackthorn on Monday December 17, 2018 @01:14PM (#18700753)
With common table expressions and windowing, SQL is Turing complete.
Re:Minikanren – An embedded DSL for logic programming by yorwba on Monday December 17, 2018 @02:22PM (#18701348)
Languages of all kinds of paradigms are Turing complete. But we still use different languages for different purposes, because some programs are more convenient to write in a certain paradigm that maps well to their problem domain.

In Prolog for example, you can easily define concatenation of cons-lists as

  concatenate(nil, Ys, Ys).
  concatenate(cons(X, Xs), Ys, cons(X, Zs)) :- concatenate(Xs, Ys, Zs).
and then generate all 4 possible solutions for the query concatenate(X, Y, cons(1, cons(2, cons(3, nil)))).

Of course Prolog has built-in lists that'd allow simply writing append(X, Y, [1, 2, 3]), but the ease of defining certain simple algorithms and then running them backwards is what makes logic programming so useful in my opinion.

If SQL can express an equivalent program equally succinctly, I'd very much like to see how.

Re:Minikanren – An embedded DSL for logic programming by typon on Monday December 17, 2018 @01:55PM (#18701117)
So is LaTeX...but people aren't implementing logic programs in it.
Re:Minikanren – An embedded DSL for logic programming by Blackthorn on Monday December 17, 2018 @02:51PM (#18701580)
The argument is that minikanren does more than SQL. I strongly disagree.
Re:Minikanren – An embedded DSL for logic programming by haolez on Monday December 17, 2018 @05:31PM (#18702866)
Care to elaborate? Genuinely curious.