<story><title>Picat: A Logic-Based, Multi-Paradigm, Programming Language</title><url>http://picat-lang.org/</url></story><parent_chain></parent_chain><comment><author>afaz</author><text>Picat is a pragmatic mix of several programming paradigms, and it supports both directional and non-directional computing.&lt;p&gt;Pattern-matching is directional. Consider the following predicate definitions:&lt;p&gt;p([a,b|_]) =&amp;gt; true.&lt;p&gt;q([X,X]) =&amp;gt; true.&lt;p&gt;A call p(L) succeeds only when L has at least two elements and the first two elements are a and b, respectively. A call q(L) succeeds only when L has exactly two identical elements.&lt;p&gt;Functions are directional. In Prolog, the length(L,N) predicate can be used to compute the length of L and can also be used to create a list of a given length N. In Picat, you need to use function new_list(N) to create a list, and use function len(L) to compute the length of L.&lt;p&gt;Loops are directional. Unlike in ECLiPSe-CLP where it is possible to iterate over a list that is to be created, in Picat the collection of every iterator must be fixed.&lt;p&gt;Unification is non-directional. A call X = Y is like an equality constraint over terms. Built-ins predicates, such as member(X,L) and append(L1,L2,L3), are defined by using unification, and can be used in the same way as in Prolog.&lt;p&gt;Constraints are non-directional. While a unification X = Y has a unique solution when it succeeds, a system of constraints may have multiple solutions. Picat provides a built-in, called solve, that calls the imported solver to search for a satisfactory or an optimal solution.</text></comment>
<story><title>Picat: A Logic-Based, Multi-Paradigm, Programming Language</title><url>http://picat-lang.org/</url></story><parent_chain></parent_chain><comment><author>YeGoblynQueenne</author><text>That looks nice. List comprehensions, higher-order functions and arrays in a logic-based language with CLP and planning facilities sounds great. In terms of looks, I&amp;#x27;m not sure why but it reminds me of a cross between Python and Prolog.&lt;p&gt;There&amp;#x27;s a few things that look a bit strange though. e.g.:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  perms([]) = [[]].
  perms(Lst) = [[E|P] : E in Lst, P in perms(Lst.delete(E))].
&lt;/code&gt;&lt;/pre&gt;
So, &amp;quot;|&amp;quot; is a cons operator, but can&amp;#x27;t be used to take a list apart by recursively separating its head from its tail? That&amp;#x27;s a bit strange.&lt;p&gt;Also:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  Compared with Prolog, Picat is arguably more expressive and   
  scalable: it is not rare to find problems for which Picat 
  requires an order of magnitude fewer lines of code to 
  describe than Prolog and Picat can be significantly faster 
  than Prolog because pattern-matching facilitates indexing of 
  rules. 
&lt;/code&gt;&lt;/pre&gt;
That&amp;#x27;s just ... no :) [Because modern Prologs index all predicats, including rules, by pattern mathing and there&amp;#x27;s nothing more expressive than FOL so].</text></comment>