Hi Ovid,
On 5/24/06, Ovid <[EMAIL PROTECTED]> wrote:
As an aside for those who, like me, wanted to see support for logic 
programming:  the only significant disappoinment I have with Perl6 is also, 
oddly enough, accompanied by a sigh of relief.  Perl6 will easily support 
imperative, functional and OO syntax.  But what about logic programming?  Perl6 
rules might help, but there will be no support for things that Prolog and 
Mercury do naturally.

The "sigh of relief" stems from my realization that logic programming in Perl6 
would probably be implemented incorrectly because the easiest way to implement it is 
usually wrong, though this can be very tough to see at first.  It's my understanding that 
logic programming wasn't incorporated due to the desire to not delay the initial release 
of Perl6 (I could be wrong).  However, after having done a fair amount of work with logic 
programming, I realize that one of the greatest implementation mistakes with it is that 
results tend to be bags and not sets (SQL shares this problem).  Thus, when one naturally 
wants all of the answers to a query, one often gets duplicate results and this is almost 
always wrong. (See http://use.perl.org/~Ovid/journal/28378 for an SQL example of this 
problem).
I re-read your journal entry and comments (I had read it back when you
first had posted it), and I'm curious about what obstacles that you
think need to be overcome for Perl6 to support logic programming.

Just to let you know, I only used Prolog for a month during a course
called "Programming Languages: Principles and Paradigms", so I don't
have a strong background in it. From what I remember, everything is
about binding in Prolog: if the given data can bind to the predicate
(I think that's what it's called in Prolog) in some way, then the
predicate returns successfully. Why can't grammars (in the sense of
Perl6) be used for this kind of stuff (and here I'm asking about what
Mercury and Prolog can do naturally)? Is it that so much more needs to
be added to Perl6 grammars/rules for them to be as powerful and
versatile as predicates in logic programming, and that these additions
cannot be reconciled with the rest of the Perl6 language? I'm
interested in everyone's opinions.

David

Reply via email to