From: Ken Tilton
Subject: To Hell with Lisp!
Date: 
Message-ID: <478d0118$0$11562$607ed4bc@cv.net>
Prolog has much fewer parentheses. But I digress. An inexcusably small 
sample shows frightening similarities between Norvig's and Graham's 
Prologs. How come? Common starting point? Same problem entails same 
solution? Norvig and Graham, separated at birth?

Other __________________?

kt

ps. What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I 
saw the entry in the FAQ, looking for warm-blooded viewpoints here.)

k

pps. For those of you addicted to gavino-mode:

Subject: Lisp Prologs: Norvig? Graham?
Body: WTF?

k

-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius

From: vanekl
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <f52538af-15b2-4617-bdaa-ba07a5647e56@p69g2000hsa.googlegroups.com>
On Jan 15, 6:51 pm, Ken Tilton <···········@optonline.net> wrote:
> Prolog has much fewer parentheses. But I digress. An inexcusably small
> sample shows frightening similarities between Norvig's and Graham's
> Prologs. How come? Common starting point? Same problem entails same
> solution? Norvig and Graham, separated at birth?
>
> Other __________________?
>
> kt
>
> ps. What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I
> saw the entry in the FAQ, looking for warm-blooded viewpoints here.)
>
> k
>
> pps. For those of you addicted to gavino-mode:
>
> Subject: Lisp Prologs: Norvig? Graham?
> Body: WTF?
>
> k
>
> --http://www.theoryyalgebra.com/
>
> "In the morning, hear the Way;
>   in the evening, die content!"
>                      -- Confucius

If speed is important and you are working with large data sets, don't
rule out exec-ing out a swi-prolog or xsb process and reading the
results of the query back into Lisp. The WAM is more efficient than
Lisp because all it has to do is DFS and unification.


--
The only place where success comes before work is in the dictionary -
Vidal Sassoon
From: Mark Tarver
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <706c9b01-af3f-4b96-8764-7ad267f989c0@i7g2000prf.googlegroups.com>
On 15 Jan, 18:51, Ken Tilton <···········@optonline.net> wrote:
> Prolog has much fewer parentheses. But I digress. An inexcusably small
> sample shows frightening similarities between Norvig's and Graham's
> Prologs. How come? Common starting point? Same problem entails same
> solution? Norvig and Graham, separated at birth?
>
> Other __________________?
>
> kt
>
> ps. What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I
> saw the entry in the FAQ, looking for warm-blooded viewpoints here.)
>
> k
>
> pps. For those of you addicted to gavino-mode:
>
> Subject: Lisp Prologs: Norvig? Graham?
> Body: WTF?
>
> k
>
> --http://www.theoryyalgebra.com/
>
> "In the morning, hear the Way;
>   in the evening, die content!"
>                      -- Confucius

Qi includes a Prolog as part of the distro; the type theory stuff
actually compiles into Prolog.  You would, however, be required to
embrace the true faith of pattern-matching and static type checking.
Brother Harrop will be on hand to administer the necessary
sacraments ;)

AFAIK Norvig covers Prolog compilation in PAIP and I suspect thats why
Graham and he converge.  The approach in Qi uses something different
called the Abstract Unification Machine (AUM) and generates Lisp code
through the following transformations.

1.  Prolog
2.  Extended Mu Expressions
3.  AUM instructions
4.  Lisp

Stages 1-2 generate expressions in an extended lambda (mu) calculus
reminiscent of the intermediate code generated from pattern-matching
FPLs in Peyton-Jones.  Qi generates pretty good Lisp code from
Prolog.

Generally you will not get the same performance from Qi Prolog (or any
Prolog in Lisp) as you will from a good Prolog on its own.  But if
you're happy with 100-600 KLIPs then thats not a bother.  Back in the
dim days of the mid-80s, I remember CProlog clocking at 1 KLIP.

Franz do a very quick Prolog and since you're an Allegro user, their
version would seem the logical choice for you.  I believe (not chasing
this up) that they based their design on Norvig.

Mark
From: Tayssir John Gabbour
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <89c9ddc7-1787-4621-8bf0-37feebd816e8@q39g2000hsf.googlegroups.com>
On Jan 15, 10:11 pm, Mark Tarver <··········@ukonline.co.uk> wrote:
> Franz do a very quick Prolog and since you're an Allegro user, their
> version would seem the logical choice for you.  I believe (not chasing
> this up) that they based their design on Norvig.

Yes:
http://groups.google.com/group/comp.lang.lisp/msg/f9144e74f0939305
  Message-ID: <··················@newssvr29.news.prodigy.net>

Tayssir
From: Ken Tilton
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <478dcbed$0$9165$607ed4bc@cv.net>
Tayssir John Gabbour wrote:
> On Jan 15, 10:11 pm, Mark Tarver <··········@ukonline.co.uk> wrote:
> 
>>Franz do a very quick Prolog and since you're an Allegro user, their
>>version would seem the logical choice for you.

Explained upthread. Still waiting on a response, which has me concerned 
and/or hopeful -- we are outside the envelope on typically speedy Franz 
response. Hopefully this means Foderaro is dashing off a functional 
variant as we speak. Or they think I have lost my mind or am just too 
stupid to help. I'll keep you posted.

kt

-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius
From: Edi Weitz
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <uwsqasvd5.fsf@agharta.de>
On Tue, 15 Jan 2008 13:51:09 -0500, Ken Tilton <···········@optonline.net> wrote:

> What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I
> saw the entry in the FAQ, looking for warm-blooded viewpoints here.)

I don't know what the FAQ (which one, anyway?) says about this, but I
know that Christophe Rhodes has something that's based on Norvig's
Prolog (IIRC) which fixes some bugs and maybe adds features and/or has
performance improvements.  I don't have a URL handy, but Google or the
CL Directory or CLiki should be your friends.  If I needed a Prolog,
I'd start there.

Or maybe not.  Now that I think of it, LispWorks offers a Prolog as
part of their Enterprise Edition.  And so does Franz.  Why don't you
use that one?

Edi.

-- 

European Common Lisp Meeting, Amsterdam, April 19/20, 2008

  http://weitz.de/eclm2008/

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Ken Tilton
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <478cf818$0$9131$607ed4bc@cv.net>
Edi Weitz wrote:
> On Tue, 15 Jan 2008 13:51:09 -0500, Ken Tilton <···········@optonline.net> wrote:
> 
> 
>>What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I
>>saw the entry in the FAQ, looking for warm-blooded viewpoints here.)
> 
> 
> I don't know what the FAQ (which one, anyway?) says about this, but I
> know that Christophe Rhodes has something that's based on Norvig's
> Prolog (IIRC) which fixes some bugs and maybe adds features and/or has
> performance improvements.  I don't have a URL handy, but Google or the
> CL Directory or CLiki should be your friends.  If I needed a Prolog,
> I'd start there.

http://www.cliki.net/Prolog, the PAIPROLOG link? I'll take a look.

> 
> Or maybe not.  Now that I think of it, LispWorks offers a Prolog as
> part of their Enterprise Edition.  And so does Franz.  Why don't you
> use that one?

Waiting on word from them on as to whether I am mistaken in concluding 
that I cannot run a fancy analysis of X to generate a set Y of Prolog 
rules and then solve Y. Their toplevel <- expands into a promising 
run-toplevel-prove (or something) of the quoted body, but the embedded 
prolog expands in place to an amazing amount of internalese. An open 
question is whether eval would work, meaning whether I can do without 
capture in embedded Lisp forms.

I grabbed Norvig's Lisp Prolog and that looks more friendly to the 
functional thing (even the embedded prolog form expands to 
something-prove the quoted body), but then Franz did some sweet things 
embedding Lisp in Prolog -- well, still exploring, maybe Norvig has some 
tricks up its sleeve I have not found. Then again, Bill Clementson found 
ACL Prolog to be lots faster than Norvig's, and I might need that, so it 
would be nice to stick with ACL.

I have Ait-Kaci warming up in the bullpen if NIH sets in. With Luck I 
can kill a month rolling a KennyLog and avoid working on the Algebra 
software, and then redo the Algebra engine around KennyLog, pushing the 
release (PWUAHAHAHAHAHAHAA!) out even further.

kt

ps. Would someone please help anon? :) k

-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius
From: Edi Weitz
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <ulk6qr833.fsf@agharta.de>
On Tue, 15 Jan 2008 18:12:38 -0500, Ken Tilton <···········@optonline.net> wrote:

> http://www.cliki.net/Prolog, the PAIPROLOG link?

That's the one I meant, yes.

> I have Ait-Kaci warming up in the bullpen if NIH sets in. With Luck
> I can kill a month rolling a KennyLog and avoid working on the
> Algebra software, and then redo the Algebra engine around KennyLog,
> pushing the release (PWUAHAHAHAHAHAHAA!) out even further.

Maybe you can incorporate this into you Amsterdam talk?

:)

-- 

European Common Lisp Meeting, Amsterdam, April 19/20, 2008

  http://weitz.de/eclm2008/

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Ken Tilton
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <478d0095$0$9138$607ed4bc@cv.net>
Edi Weitz wrote:
> On Tue, 15 Jan 2008 18:12:38 -0500, Ken Tilton <···········@optonline.net> wrote:
> 
> 
>>http://www.cliki.net/Prolog, the PAIPROLOG link?
> 
> 
> That's the one I meant, yes.
> 
> 
>>I have Ait-Kaci warming up in the bullpen if NIH sets in. With Luck
>>I can kill a month rolling a KennyLog and avoid working on the
>>Algebra software, and then redo the Algebra engine around KennyLog,
>>pushing the release (PWUAHAHAHAHAHAHAA!) out even further.
> 
> 
> Maybe you can incorporate this into you Amsterdam talk?
> 
> :)
> 

Oh, sure, that and the entire history of Cells and my new passion 
Triple-Cells and the C to Lisp translator done using just typedef and 
print (well, Antlr played a small part)... how many hours have been 
allotted to His Kennyness?

Really, it is a crime how much fun I am having with Lisp. Of course 
unlike most of the deadweight around here I actually use it to write 
software... reminds me of the joke that ends, "Lenny, buy a ticket."

kt

-- 
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
  in the evening, die content!"
                     -- Confucius
From: Mark Tarver
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <856ff5b8-09a0-4191-94ff-2fe7cc58f3cb@e25g2000prg.googlegroups.com>
On 15 Jan, 23:50, Ken Tilton <···········@optonline.net> wrote:
> Edi Weitz wrote:
> > On Tue, 15 Jan 2008 18:12:38 -0500, Ken Tilton <···········@optonline.net> wrote:
>
> >>http://www.cliki.net/Prolog, the PAIPROLOG link?
>
> > That's the one I meant, yes.
>
> >>I have Ait-Kaci warming up in the bullpen if NIH sets in. With Luck
> >>I can kill a month rolling a KennyLog and avoid working on the
> >>Algebra software, and then redo the Algebra engine around KennyLog,
> >>pushing the release (PWUAHAHAHAHAHAHAA!) out even further.
>
> > Maybe you can incorporate this into you Amsterdam talk?
>
> > :)
>
> Oh, sure, that and the entire history of Cells and my new passion
> Triple-Cells and the C to Lisp translator done using just typedef and
> print (well, Antlr played a small part)... how many hours have been
> allotted to His Kennyness?
>
> Really, it is a crime how much fun I am having with Lisp. Of course
> unlike most of the deadweight around here I actually use it to write
> software... reminds me of the joke that ends, "Lenny, buy a ticket."
>
> kt
>
> --http://www.theoryyalgebra.com/
>
> "In the morning, hear the Way;
>   in the evening, die content!"
>                      -- Confucius- Hide quoted text -
>
> - Show quoted text -

I would also say that your algebra project would almost certainly be
*much* easier to handle in Qi than in Lisp, even apart from the
embedded Prolog already in Qi.  Qi is fundamantally a rewrite language
and rewrite languages are excellently suited to symbolic manipulation
in maths.

From FPQI chapter 1

"The important advance of Lisp was that it freed the programmer from
having to consider the architecture of the computer. By allowing the
programmer to define algorithms as functions, and abstracting away
from the need to consider allocating or reclaiming memory, Lisp left
the programmer free to work on the problems that interested him. To
give an analogy, Lisp was transparent as regards the architecture of
the machine on which it ran: writing Lisp code was like looking at the
problem through a clear window. Writing in a procedural language like
assembler requires not only thinking about the problem, but also
thinking about the architecture of the underlying machine which is
explicit in assembly language. Looking at a problem through assembler
is like looking at it through a stained or dirty window, or trying to
see to the bottom of a pond on which there is a lot of surface glare
and reflection."

In this case, writing an algebra program in Lisp involves having to
cope with a lot of low-level surface glare that you don't really
need.

The smart move would be to move the project into Qi and import Cells/
Cello for the graphics using Qi as the engine.  Type checking is
optional in Qi, so it can be switched off if it is not desired.

Mark
From: John Thingstad
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <op.t4zr6oduut4oq5@pandora.alfanett.no>
P� Tue, 15 Jan 2008 21:10:30 +0100, skrev Edi Weitz <········@agharta.de>:

> On Tue, 15 Jan 2008 13:51:09 -0500, Ken Tilton  
> <···········@optonline.net> wrote:
>
>> What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I
>> saw the entry in the FAQ, looking for warm-blooded viewpoints here.)
>
> I don't know what the FAQ (which one, anyway?) says about this, but I
> know that Christophe Rhodes has something that's based on Norvig's
> Prolog (IIRC) which fixes some bugs and maybe adds features and/or has
> performance improvements.  I don't have a URL handy, but Google or the
> CL Directory or CLiki should be your friends.  If I needed a Prolog,
> I'd start there.
>

I noticed Norvig's code didn't set the expression to a Preneks Normal Form  
before Scholheimization.
This could cause variable capture for existance and forall quantors. You  
might want to move all and exist quantors to the top level of the  
expression and rename variables when you move them up a scope.

--------------
John Thingstad
From: Aatu Koskensilta
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <nzmjj.281702$VU5.254800@reader1.news.saunalahti.fi>
On 2008-01-15, in comp.lang.lisp, John Thingstad wrote:
> I noticed Norvig's code didn't set the expression to a Preneks Normal Form  
> before Scholheimization.
> This could cause variable capture for existance and forall quantors. 

I presume you intended to write "prenex nromal form", "Skolemization" and
"quantifiers"?

-- 
Aatu Koskensilta (················@xortec.fi)

"Wovon man nicht sprechen kann, daruber muss man schweigen"
 - Ludwig Wittgenstein, Tractatus Logico-Philosophicus
From: John Thingstad
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <op.t407n4sput4oq5@pandora.alfanett.no>
P� Wed, 16 Jan 2008 13:15:15 +0100, skrev Aatu Koskensilta  
<················@xortec.fi>:

> On 2008-01-15, in comp.lang.lisp, John Thingstad wrote:
>> I noticed Norvig's code didn't set the expression to a Preneks Normal  
>> Form
>> before Scholheimization.
>> This could cause variable capture for existance and forall quantors.
>
> I presume you intended to write "prenex nromal form", "Skolemization" and
> "quantifiers"?
>

For the first two, yes. Norwegian spelling. (I used a Norwegian compendium  
in Mathematical Logic.)
For the third no, I ment quantors.


--------------
John Thingstad
From: Aatu Koskensilta
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <eANjj.282340$rF7.167215@reader1.news.saunalahti.fi>
On 2008-01-16, in comp.lang.lisp, John Thingstad wrote:
> For the first two, yes. Norwegian spelling. (I used a Norwegian compendium  
> in Mathematical Logic.)

Skolemization is called "Scholheimization" in Norwegian? How odd.

> For the third no, I ment quantors.

You'll find the usual term in English is "quantifier" in context of logic.

(These linguistic remarks of course have nothing to do with the content of
your original observation, or with Lisp; that's Usenet for you.)

-- 
Aatu Koskensilta (················@xortec.fi)

"Wovon man nicht sprechen kann, daruber muss man schweigen"
 - Ludwig Wittgenstein, Tractatus Logico-Philosophicus
From: Espen Vestre
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <m1ejcge0ic.fsf@gazonk.netfonds.no>
Aatu Koskensilta <················@xortec.fi> writes:

> On 2008-01-16, in comp.lang.lisp, John Thingstad wrote:
>> For the first two, yes. Norwegian spelling. (I used a Norwegian compendium  
>> in Mathematical Logic.)
>
> Skolemization is called "Scholheimization" in Norwegian? How odd.

Of course not. His name was Thoralf Skolem.

>> For the third no, I ment quantors.
>
> You'll find the usual term in English is "quantifier" in context of logic.

"Quantor" is german for the same thing (and the norwegian term is
"kvantor"), it's easy to mix up...
-- 
  (espen)
From: Aatu Koskensilta
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <JtPjj.282463$gb.218579@reader1.news.saunalahti.fi>
On 2008-01-17, in comp.lang.lisp, Espen Vestre wrote:
> "Quantor" is german for the same thing (and the norwegian term is
> "kvantor"), it's easy to mix up...

Quite. In Finnish the term is "kvanttori", and it is not uncommon to observe
a Finn commit the same blunder.

-- 
Aatu Koskensilta (················@xortec.fi)

"Wovon man nicht sprechen kann, daruber muss man schweigen"
 - Ludwig Wittgenstein, Tractatus Logico-Philosophicus
From: John Thingstad
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <op.t43d5rc7ut4oq5@pandora.alfanett.no>
P� Thu, 17 Jan 2008 20:05:15 +0100, skrev Espen Vestre <·····@vestre.net>:

> Aatu Koskensilta <················@xortec.fi> writes:
>
>> On 2008-01-16, in comp.lang.lisp, John Thingstad wrote:
>>> For the first two, yes. Norwegian spelling. (I used a Norwegian  
>>> compendium
>>> in Mathematical Logic.)
>>
>> Skolemization is called "Scholheimization" in Norwegian? How odd.
>
> Of course not. His name was Thoralf Skolem.
>

You are right of cource. I was the second preneks which is Norwegian.

>>> For the third no, I ment quantors.
>>
>> You'll find the usual term in English is "quantifier" in context of  
>> logic.
>
> "Quantor" is german for the same thing (and the norwegian term is
> "kvantor"), it's easy to mix up...

I looked it up and saw that quantor was used in the correct context so I  
figured it was OK.

On quantity:
A quantifier, as its name implies, expresses quantity. Quantifiers can be  
a single word or a phrase and are used with nouns. They can be used with  
both a countable or an uncountable noun to express amount or quantity.

So quantor seemmed more exact. But the dictionary disagrees.

--------------
John Thingstad
From: Aatu Koskensilta
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <2zPjj.282465$gb.35952@reader1.news.saunalahti.fi>
On 2008-01-17, in comp.lang.lisp, John Thingstad wrote:
> So quantor seemmed more exact. But the dictionary disagrees.

"Quantifier" is a technical term, and in this case more idiomatic English.
In logic and mathematics we find many terms and locutions that make
grammarians grind their teeth, and generally the dictionary is not a good
source on standard mathematical usage.

-- 
Aatu Koskensilta (················@xortec.fi)

"Wovon man nicht sprechen kann, daruber muss man schweigen"
 - Ludwig Wittgenstein, Tractatus Logico-Philosophicus
From: anon
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <ir9jj.137633$MJ6.90765@bgtnsc05-news.ops.worldnet.att.net>
Each Language has its pluses and its minuses. There is no perfect 
Language. Period!

Yes, LISP uses parentheses, because it was original designed to use 
only functions. And even though that has been altered in some cases, 
LISP still primary uses functions, which means a lot of parentheses.

But most LISP programmers understand this. And in some cases 
programmers use an LISP editor that help the programmers write LISP. 
Like, inserting a right parentheses when the programmer type a left 
parentheses.

But to go with PROLOG and type all of those Rules and use PROLOG's 
syntax. I think you will feel the same about PROLOG the way you fell 
about LISP in a few months. 

Also, use a PROLOG that is written in PROLOG!

It is better to LEARN and USE one or two languages then to try them 
all and give up because there is no prefect one. And the best way to 
do that is find a job field that you like and see what languages 
they use.  Then learn those languages, even with the minuses at 
least you will have a knowledge to get that type of job.

Also, Please use the correct syntax.  This is, LISP and PROLOG 
are to be capitalize.

In <·························@cv.net>, Ken Tilton <···········@optonline.net> writes:
>Prolog has much fewer parentheses. But I digress. An inexcusably small 
>sample shows frightening similarities between Norvig's and Graham's 
>Prologs. How come? Common starting point? Same problem entails same 
>solution? Norvig and Graham, separated at birth?
>
>Other __________________?
>
>kt
>
>ps. What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I 
>saw the entry in the FAQ, looking for warm-blooded viewpoints here.)
>
>k
>
>pps. For those of you addicted to gavino-mode:
>
>Subject: Lisp Prologs: Norvig? Graham?
>Body: WTF?
>
>k
>
>-- 
>http://www.theoryyalgebra.com/
>
>"In the morning, hear the Way;
>  in the evening, die content!"
>                     -- Confucius
From: Slobodan Blazeski
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <0cb25ad3-6ffa-47e6-af11-b0098d06b6c6@d70g2000hsb.googlegroups.com>
Weird I was looking for a embedded prolog too, Allegro have it but I
prefer portable solution,  beside currently weblocks is broken with
allegro. Grahams prolog implementation from OnLisp could be easily
recoded using some new continuation library like cl-cont or arnesi,
but I don't know how fast and feature complete is.

Anon, lisp is big ball of mud and lispers want to carry the lisp with
them. When lisper likse something from prolog or haskell they want it
implemented as library so they could embeded prolog or whatever when
it's convenient and work with pure lisp for the rest. Take embeded
prolog found in Allegro & LW, or CLOS embedded language for OO
programming , or Pascal Constanza ContextL and AspectL embedded
languages to do context oriented or aspect oriented programming .
One of the reasons that stops me from trying Qi, though I like it from
what I read , is that is not embeded, or is I'm wrong Mark ? (*) I
don't want to program in Qi only I want to
 have lisp code intermixed with embedded language. Like this
(asdf::oos 'asdf:load-op :qi)
and than work with Qi and lisp like this
;;pseudo-code fallows copy pasted from Qi book
>(qi::define return-b
  a -> b
  c -> b )
return-b
>(mapcar #'return-b  '(a b c))

cheers
Slobodan
(*)
I asked this at the correct group
http://groups.google.com/group/Qilang/browse_thread/thread/dfb1427c08f13d8
From: Mark Tarver
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <2fc7dcae-356a-4c46-a18f-d198df20e11f@h11g2000prf.googlegroups.com>
On 15 Jan, 22:35, Slobodan Blazeski <·················@gmail.com>
wrote:
> Weird I was looking for a embedded prolog too, Allegro have it but I
> prefer portable solution,  beside currently weblocks is broken with
> allegro. Grahams prolog implementation from OnLisp could be easily
> recoded using some new continuation library like cl-cont or arnesi,
> but I don't know how fast and feature complete is.
>
> Anon, lisp is big ball of mud and lispers want to carry the lisp with
> them. When lisper likse something from prolog or haskell they want it
> implemented as library so they could embeded prolog or whatever when
> it's convenient and work with pure lisp for the rest. Take embeded
> prolog found in Allegro & LW, or CLOS embedded language for OO
> programming , or Pascal Constanza ContextL and AspectL embedded
> languages to do context oriented or aspect oriented programming .
> One of the reasons that stops me from trying Qi, though I like it from
> what I read , is that is not embeded, or is I'm wrong Mark ? (*) I
> don't want to program in Qi only I want to
>  have lisp code intermixed with embedded language. Like this
> (asdf::oos 'asdf:load-op :qi)
> and than work with Qi and lisp like this
> ;;pseudo-code fallows copy pasted from Qi book>(qi::define return-b
>
>   a -> b
>   c -> b )
> return-b
>
> >(mapcar #'return-b  '(a b c))
>
> cheers
> Slobodan
> (*)
> I asked this at the correct grouphttp://groups.google.com/group/Qilang/browse_thread/thread/dfb1427c08...

I guess you mean by 'embedded', something that can be loaded into the
Lisp environment like a regular library with no or minimal disturbance
to Lisp.

The general approach with Qi is driven by the idea that programming
should nearly always be conducted at the highest level.  Qi was
designed to be in certain respects higher-level than Lisp so the model
I assumed was one where people worked in Qi and then dipped down into
Lisp when they needed to borrow on Lisp resources.  If you follow that
approach then mixing Qi and Lisp is very very easy  All you have to do
is to type 'LOAD' to load a Lisp file rather than 'load' to load a Qi
file.

The model that some people want, and I guess this is the problem, is
they want to work in Lisp and drop (jump?) into Qi.  Its certainly
doable, its just that the default setup is not tailored for that.
Personally I hardly ever write in Lisp unless I want to use macros.
So I've had very little motivation to set things up differently.

I mean, if Qi code is more compact than bread-and-butter Lisp list
handling code and generates Lisp code that is equivalent in
performance to the most painfully hand-optimised Lisp code that a Lisp
hacker can write (see the performance shoot-out in
http://www.lambdassociates.org/studies/study10.htm) then there really
is not a rational motivation for writing large tranches of Lisp code
any more.

However, if I had to set it up in the reverse order,  probably what
I'd do is have some kind of toggle key out of the Qi top level that
would put me into the Lisp top level and would simultaneously reset
the readtable to the default settings and from which I could toggle
back into Qi.  That's not hard to arrange.

Mark
From: Slobodan Blazeski
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <8d67e4a1-f544-4bb8-8189-b1e9ae223a99@v46g2000hsv.googlegroups.com>
On Jan 16, 12:31 am, Mark Tarver <··········@ukonline.co.uk> wrote:
> On 15 Jan, 22:35, Slobodan Blazeski <·················@gmail.com>
> wrote:
>
>
>
> > Weird I was looking for a embedded prolog too, Allegro have it but I
> > prefer portable solution,  beside currently weblocks is broken with
> > allegro. Grahams prolog implementation from OnLisp could be easily
> > recoded using some new continuation library like cl-cont or arnesi,
> > but I don't know how fast and feature complete is.
>
> > Anon, lisp is big ball of mud and lispers want to carry the lisp with
> > them. When lisper likse something from prolog or haskell they want it
> > implemented as library so they could embeded prolog or whatever when
> > it's convenient and work with pure lisp for the rest. Take embeded
> > prolog found in Allegro & LW, or CLOS embedded language for OO
> > programming , or Pascal Constanza ContextL and AspectL embedded
> > languages to do context oriented or aspect oriented programming .
> > One of the reasons that stops me from trying Qi, though I like it from
> > what I read , is that is not embeded, or is I'm wrong Mark ? (*) I
> > don't want to program in Qi only I want to
> >  have lisp code intermixed with embedded language. Like this
> > (asdf::oos 'asdf:load-op :qi)
> > and than work with Qi and lisp like this
> > ;;pseudo-code fallows copy pasted from Qi book>(qi::define return-b
>
> >   a -> b
> >   c -> b )
> > return-b
>
> > >(mapcar #'return-b  '(a b c))
>
> > cheers
> > Slobodan
> > (*)
> > I asked this at the correct grouphttp://groups.google.com/group/Qilang/browse_thread/thread/dfb1427c08...
>
> I guess you mean by 'embedded', something that can be loaded into the
> Lisp environment like a regular library with no or minimal disturbance
> to Lisp.
>
> The general approach with Qi is driven by the idea that programming
> should nearly always be conducted at the highest level.  Qi was
> designed to be in certain respects higher-level than Lisp so the model
> I assumed was one where people worked in Qi and then dipped down into
> Lisp when they needed to borrow on Lisp resources.  If you follow that
> approach then mixing Qi and Lisp is very very easy  All you have to do
> is to type 'LOAD' to load a Lisp file rather than 'load' to load a Qi
> file.
>
> The model that some people want, and I guess this is the problem, is
> they want to work in Lisp and drop (jump?) into Qi.  Its certainly
> doable, its just that the default setup is not tailored for that.
> Personally I hardly ever write in Lisp unless I want to use macros.
> So I've had very little motivation to set things up differently.
>
> I mean, if Qi code is more compact than bread-and-butter Lisp list
> handling code and generates Lisp code that is equivalent in
> performance to the most painfully hand-optimised Lisp code that a Lisp
> hacker can write (see the performance shoot-out inhttp://www.lambdassociates.org/studies/study10.htm) then there really
> is not a rational motivation for writing large tranches of Lisp code
> any more.
>
> However, if I had to set it up in the reverse order,  probably what
> I'd do is have some kind of toggle key out of the Qi top level that
> would put me into the Lisp top level and would simultaneously reset
> the readtable to the default settings and from which I could toggle
> back into Qi.  That's not hard to arrange.
>
> Mark

Yes I'm talking about Qi as library, but not some toogle into Qi top
level but using Qi into lisp *default* toplevel. Like fire my
listener, asdf load Qi and work there with both lisp and Qi.
Can I do that? And can I have Qi functions available into lisp source
files?
Maybe those like me aren't your target audience, but I like to embed
Qi into lisp not vice versa.
I won't comment on whoich language is more concise, you might be
right, but for doing what I'm doing I need libraries that are written
in lisp, and far more often than I want  I need to extend them to do
what I want them to do, sometimes even dropping to manually generated
javascript.
And no author in a right mind won't accept a patch written in Qi. That
will leave me rewriting my code  for each revision of the library,
that you must agree is very bad and time consuming. I don't want to
mention that I won't have anybody to ask why the hell qi patch isn't
working like it sopose to work. Because people who know the library
don't know Qi, and people who understand Qi don't know the library.
Situation with   Common Lisp libraries is far from good, I suspect the
situation Qi libraries is even worse, not to mention very small
community around it.
If Qi has an portable Prolog compiler and from comemrcial
implementations we could see tehre is demand, that could make a nice
selling point for it, IF you also offer Qi embedded in Lisp like I
explained above. Programmers are lazy son of a bitches, they will
whatever tool that does what they want with least effort, and lispers
are worst of all. So if it isn't time consuming to do it why don't you
offer such version, and see what will users prefer: Lisp in Qi or Qi
in Lisp. Later you can decide which one to drop if supporting both is
costly.

One more question: Is it possible code in Qi Erlang like, adding
pattern matching definition without changin the previous:
(fact (x <= 1) 1)
(fact x  (* x (fact (1- x)))
;;somebody found a superfast algo for calculating factoriels for 2^n
so we want to use it
without changing previous definition
(fact (zerop (mod x 2))
   (superfast-factoriel-algo-for-2^n x))

thanks
Slobodan
From: Mark Tarver
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <b89339c0-086f-4d4c-936e-4bd9640b1bbd@x69g2000hsx.googlegroups.com>
> Yes I'm talking about Qi as library, but not some toogle into Qi top
> level but using Qi into lisp *default* toplevel. Like fire my
> listener, asdf load Qi and work there with both lisp and Qi.
> Can I do that? And can I have Qi functions available into lisp source
> files?
> Maybe those like me aren't your target audience, but I like to embed
> Qi into lisp not vice versa.
> I won't comment on whoich language is more concise, you might be
> right, but for doing what I'm doing I need libraries that are written
> in lisp, and far more often than I want  I need to extend them to do
> what I want them to do, sometimes even dropping to manually generated
> javascript.
> Situation with   Common Lisp libraries is far from good, I suspect the
> situation Qi libraries is even worse, not to mention very small
> community around it.

> And no author in a right mind won't accept a patch written in Qi. That
> will leave me rewriting my code  for each revision of the library,
> that you must agree is very bad and time consuming. I don't want to
> mention that I won't have anybody to ask why the hell qi patch isn't
> working like it sopose to work. Because people who know the library
> don't know Qi, and people who understand Qi don't know the library.

Its no big deal to set Qi up that way - about 2 hours work.

Right; I worked in commerce too.  You're bound by managerial pressures
to do with what commercial practice will accept and what your boss and
co-workers will accept - whatever your own personal preferences are.

I generally code either for fun as a form of self-expression or more
rarely for money.    I think this coding looks more like a gritty
commercial thing and not an  arty self-expression thing.

> One more question: Is it possible code in Qi Erlang like, adding
> pattern matching definition without changin the previous:
> (fact (x <= 1) 1)
> (fact x  (* x (fact (1- x)))
> ;;somebody found a superfast algo for calculating factoriels for 2^n
> so we want to use it
> without changing previous definition
> (fact (zerop (mod x 2))
>    (superfast-factoriel-algo-for-2^n x))

No; I avoided this equational style

f(....) = .....
f(....) = .....

because it gets rather prolix when you write functions with many
rules.  For example, for a prenex function you have to write 'prenex'
18 times which is a drag.
Also if you have order sensitivity in a series of equations and you
insert a new one,
you need to specify where the equation is supposed to go.  With any
decent editor you can just paste the new rule into the code and reload/
paste the new code.

Mark
From: Slobodan Blazeski
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <c89c65ab-d8dd-4c6a-999a-264d3a88f7a7@e25g2000prg.googlegroups.com>
On Jan 16, 3:26 pm, Mark Tarver <··········@ukonline.co.uk> wrote:
> > Yes I'm talking about Qi as library, but not some toogle into Qi top
> > level but using Qi into lisp *default* toplevel. Like fire my
> > listener, asdf load Qi and work there with both lisp and Qi.
> > Can I do that? And can I have Qi functions available into lisp source
> > files?
> > Maybe those like me aren't your target audience, but I like to embed
> > Qi into lisp not vice versa.
> > I won't comment on whoich language is more concise, you might be
> > right, but for doing what I'm doing I need libraries that are written
> > in lisp, and far more often than I want  I need to extend them to do
> > what I want them to do, sometimes even dropping to manually generated
> > javascript.
> > Situation with   Common Lisp libraries is far from good, I suspect the
> > situation Qi libraries is even worse, not to mention very small
> > community around it.
> > And no author in a right mind won't accept a patch written in Qi. That
> > will leave me rewriting my code  for each revision of the library,
> > that you must agree is very bad and time consuming. I don't want to
> > mention that I won't have anybody to ask why the hell qi patch isn't
> > working like it sopose to work. Because people who know the library
> > don't know Qi, and people who understand Qi don't know the library.
>
> Its no big deal to set Qi up that way - about 2 hours work.

If it's only 2 hours, please do it, I'm eager to try Qi while keeping
whatever I already wrote and use it in pure lisp. You're writing is
damn good, but whenever I see instructions for building images I just
quit at that point. Seems that asdf (and asdf-install) spoiled me,
that now I don't accept any library that doesn't use asdf. And I doubt
I'm the only one, one thing that I learned in marketing is that for
every single user that complains there is a dozen more who will
silently scrap off your product. What do you have to loose beside
those 2 hours? And you can potentially gain a lot of folks who will be
driven prolog implementation, pattern matching or plain curiosity of a
new library that is both easy and potentially practical.
>
> Right; I worked in commerce too.  You're bound by managerial pressures
> to do with what commercial practice will accept and what your boss and
> co-workers will accept - whatever your own personal preferences are.
>
> I generally code either for fun as a form of self-expression or more
> rarely for money.    I think this coding looks more like a gritty
> commercial thing and not an  arty self-expression thing.
I'm coding to make applications. Sometimes I have more fun exploring
and learning interesthing thongs instead of focusing on my
application, but still I feel what's practical and what's not.
Like Eric Sink once said small ISV should create applications not
platforms.

>
> > One more question: Is it possible code in Qi Erlang like, adding
> > pattern matching definition without changin the previous:
> > (fact (x <= 1) 1)
> > (fact x  (* x (fact (1- x)))
> > ;;somebody found a superfast algo for calculating factoriels for 2^n
> > so we want to use it
> > without changing previous definition
> > (fact (zerop (mod x 2))
> >    (superfast-factoriel-algo-for-2^n x))
>
> No; I avoided this equational style
>
> f(....) = .....
> f(....) = .....
>
> because it gets rather prolix when you write functions with many
> rules.  For example, for a prenex function you have to write 'prenex'
> 18 times which is a drag.
> Also if you have order sensitivity in a series of equations and you
> insert a new one,
> you need to specify where the equation is supposed to go.  With any
> decent editor you can just paste the new rule into the code and reload/
> paste the new code.
>
> Mark
You could be right, but it's speedy to insert like that the new rules.
I'm quite disappointed by SWI prolog listener, maybe it's good design
but I don't know why I can't just enter rules into the listener
instead of stupid reconsult. This is just my first impression of
working with SWI prolog and pie (Visual Prolog interpretere for ISO
prolog) and more likely I'm overlooking something that people with
more braincells thought of before, but it's just me.

cheers
Slobodan
From: gavino
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <de99115f-2e61-4100-b968-17b1cbbb687e@d4g2000prg.googlegroups.com>
On Jan 15, 10:51 am, Ken Tilton <···········@optonline.net> wrote:
> Prolog has much fewer parentheses. But I digress. An inexcusably small
> sample shows frightening similarities between Norvig's and Graham's
> Prologs. How come? Common starting point? Same problem entails same
> solution? Norvig and Graham, separated at birth?
>
> Other __________________?
>
> kt
>
> ps. What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I
> saw the entry in the FAQ, looking for warm-blooded viewpoints here.)
>
> k
>
> pps. For those of you addicted to gavino-mode:
>
> Subject: Lisp Prologs: Norvig? Graham?
> Body: WTF?
>
> k
>
> --http://www.theoryyalgebra.com/
>
> "In the morning, hear the Way;
>   in the evening, die content!"
>                      -- Confucius

bro-ken tit-lawn
From: Paul Tarvydas
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <fmlmnc$7ju$1@aioe.org>
Ken Tilton wrote:

> ps. What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I
> saw the entry in the FAQ, looking for warm-blooded viewpoints here.)

I tried, both, the OnLisp and the PAIP prologs.  For me, the PAIP one turned
out to be easier to debug and extend/optimize.

pt
From: Pascal Costanza
Subject: Re: To Hell with Lisp!
Date: 
Message-ID: <5v7gb9F1l88liU1@mid.individual.net>
Ken Tilton wrote:

> ps. What /is/ the bestest mostest Lisp implementation of Prolog? (Yes, I 
> saw the entry in the FAQ, looking for warm-blooded viewpoints here.)

Based on your usual preferences, you probably want a forward chainer 
(like a Rete network), not a backward chainer (like Prolog).

But I'm just guessing.

Sorry for academic speak... ;)


Pascal

-- 
1st European Lisp Symposium (ELS'08)
http://prog.vub.ac.be/~pcostanza/els08/

My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/