Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Maybe it's time to break that. -- Larry Wall in <199710311718.JAA19082@wall.org>


devel / comp.lang.prolog / Re: The Programming Language Wars have just begun

SubjectAuthor
* The Programming Language Wars have just begunMostowski Collapse
`* The Programming Language Wars have just begunMostowski Collapse
 `* The Programming Language Wars have just begunMostowski Collapse
  `* The Programming Language Wars have just begunMostowski Collapse
   `* The Programming Language Wars have just begunMostowski Collapse
    `- The Programming Language Wars have just begunMostowski Collapse

1
Re: The Programming Language Wars have just begun

<625b4b43-5486-4382-8e5f-6bf014b28210n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9895&group=comp.lang.prolog#9895

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:29c2:b0:444:9d4f:4ed0 with SMTP id gh2-20020a05621429c200b004449d4f4ed0mr10211725qvb.90.1649927432146;
Thu, 14 Apr 2022 02:10:32 -0700 (PDT)
X-Received: by 2002:a25:ba0c:0:b0:61a:79a6:fd0 with SMTP id
t12-20020a25ba0c000000b0061a79a60fd0mr1057042ybg.45.1649927431974; Thu, 14
Apr 2022 02:10:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 14 Apr 2022 02:10:31 -0700 (PDT)
In-Reply-To: <sc76ik$7ug$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sbqffa$pj2$1@solani.org> <c69d6e13-9d2c-4f47-8878-69f8183d6cf0n@googlegroups.com>
<85d04318-2b0c-4da9-9c80-467e798fbf13n@googlegroups.com> <sc760j$7jg$1@solani.org>
<sc76ik$7ug$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <625b4b43-5486-4382-8e5f-6bf014b28210n@googlegroups.com>
Subject: Re: The Programming Language Wars have just begun
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 14 Apr 2022 09:10:32 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 72
 by: Mostowski Collapse - Thu, 14 Apr 2022 09:10 UTC

Unexpectedly, we could bring change_arg/3 from
Dogelog Player to formerly Jekejeke Prolog.

We have found change_arg/3 quite useful for the
realization of built-ins such as findall/3, etc.. in the
Dogelog Player. Bringing it to formerly Jekejeke Prolog
opens up new roads of compatibility and portability
between the two Prolog systems. We could already
explore the compliance test suite.

See also:

change_arg/2 for a two Pointer Prolog System
https://twitter.com/dogelogch/status/1514530478371622914

change_arg/2 for a two Pointer Prolog System
https://www.facebook.com/groups/dogelog

Mostowski Collapse schrieb am Donnerstag, 8. Juli 2021 um 17:45:26 UTC+2:
> In case you are interested in imperfections
> of the ISO core standard. Maybe this can be
> read off from Dogelog, imperfections
>
> that even affect a lean language. You might
> read off imperfections from which predicates
> got implemented and are not in the ISO
>
> core standard. Since I have only implemented
> the absolute minimum right now, this might
> be an indicative what was overlooked
>
> in the ISO core standard. But there are only
> like 3-5 predicates which are not from the ISO
> core standard, but found in Dogelog:
> - consult/1 (from everywhere)
> - listing/1 (from everywhere)
> - '$MARK'/1 and friends (from BIM ProLog, Bruynooghe)
> - change_arg/3 (from BinProlog, Tarau)
> - What else?
>
> '$MARK'/1 and friends allow a more reflective
> implementation of the Prolog system. One can
> write an ISO core standard conforming
>
> call/1 in Prolog itself. change_arg/3 is
> used to inplement findall/3. But '$MARK'/1 and
> change_arg/3 are highly implementation specific,
>
> so that the ISO core standard doesn't have
> such things is somehow justified.
>
> Mostowski Collapse schrieb:
> > Dogelog is lean, currently it doesn't have (@<)/2,
> > sort/2, thread_create/2, etc..
> >
> > For more information:
> >
> > "The Dogelog Runtime is a small and fast ISO core
> > standard Prolog system that runs in a browser or on
> > node.js. The Dogelog Runtime supports old browsers
> > with common JavaScript and new browsers with
> > module JavaScript."
> > https://github.com/jburse/dogelog-moon
> >
> > Julio Di Egidio schrieb:
> >> IMO, Prolog is an amazing idea with amazing potential,
> > but should be refocused and rewritten from scratch: as a low-level
> > "logical" language with the leanest possible spec
> > and VM, and the smallest possible runtime, so that it
> > easily runs everywhere: expert systems and stuff like
> > that... Prolog 2.0, maybe.
> >

Re: The Programming Language Wars have just begun

<a9cc9f0b-a8a7-4081-a33c-b17968a6b36an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9896&group=comp.lang.prolog#9896

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:29cb:b0:699:fee3:265a with SMTP id s11-20020a05620a29cb00b00699fee3265amr1025380qkp.513.1649927760511;
Thu, 14 Apr 2022 02:16:00 -0700 (PDT)
X-Received: by 2002:a81:234b:0:b0:2eb:718b:c824 with SMTP id
j72-20020a81234b000000b002eb718bc824mr1149130ywj.520.1649927760243; Thu, 14
Apr 2022 02:16:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 14 Apr 2022 02:16:00 -0700 (PDT)
In-Reply-To: <625b4b43-5486-4382-8e5f-6bf014b28210n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sbqffa$pj2$1@solani.org> <c69d6e13-9d2c-4f47-8878-69f8183d6cf0n@googlegroups.com>
<85d04318-2b0c-4da9-9c80-467e798fbf13n@googlegroups.com> <sc760j$7jg$1@solani.org>
<sc76ik$7ug$1@solani.org> <625b4b43-5486-4382-8e5f-6bf014b28210n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a9cc9f0b-a8a7-4081-a33c-b17968a6b36an@googlegroups.com>
Subject: Re: The Programming Language Wars have just begun
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 14 Apr 2022 09:16:00 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 91
 by: Mostowski Collapse - Thu, 14 Apr 2022 09:16 UTC

We had to change the internal reference counting (*)
API of Jekejeke Prolog a little bit. But regression
testing showed so far no performanc epenality, its

rather that we gained some little performance of
ca. 4%. Need to do more regression testing. Did
not yet test the attributed variables which have also

reference counting.

(*)
In practice this reference counting and smart
pointering is a horrible bottle neck, which is also
felt in the poor performance of CPython.

The outlook for JDK 8 and JDK 16 is different.
We only saw ca. 4% for JDK 8, for JDK 16 its not
that high. It could be also an other effect..

Mostowski Collapse schrieb am Donnerstag, 14. April 2022 um 11:10:32 UTC+2:
> Unexpectedly, we could bring change_arg/3 from
> Dogelog Player to formerly Jekejeke Prolog.
>
> We have found change_arg/3 quite useful for the
> realization of built-ins such as findall/3, etc.. in the
> Dogelog Player. Bringing it to formerly Jekejeke Prolog
> opens up new roads of compatibility and portability
> between the two Prolog systems. We could already
> explore the compliance test suite.
>
> See also:
>
> change_arg/2 for a two Pointer Prolog System
> https://twitter.com/dogelogch/status/1514530478371622914
>
> change_arg/2 for a two Pointer Prolog System
> https://www.facebook.com/groups/dogelog
> Mostowski Collapse schrieb am Donnerstag, 8. Juli 2021 um 17:45:26 UTC+2:
> > In case you are interested in imperfections
> > of the ISO core standard. Maybe this can be
> > read off from Dogelog, imperfections
> >
> > that even affect a lean language. You might
> > read off imperfections from which predicates
> > got implemented and are not in the ISO
> >
> > core standard. Since I have only implemented
> > the absolute minimum right now, this might
> > be an indicative what was overlooked
> >
> > in the ISO core standard. But there are only
> > like 3-5 predicates which are not from the ISO
> > core standard, but found in Dogelog:
> > - consult/1 (from everywhere)
> > - listing/1 (from everywhere)
> > - '$MARK'/1 and friends (from BIM ProLog, Bruynooghe)
> > - change_arg/3 (from BinProlog, Tarau)
> > - What else?
> >
> > '$MARK'/1 and friends allow a more reflective
> > implementation of the Prolog system. One can
> > write an ISO core standard conforming
> >
> > call/1 in Prolog itself. change_arg/3 is
> > used to inplement findall/3. But '$MARK'/1 and
> > change_arg/3 are highly implementation specific,
> >
> > so that the ISO core standard doesn't have
> > such things is somehow justified.
> >
> > Mostowski Collapse schrieb:
> > > Dogelog is lean, currently it doesn't have (@<)/2,
> > > sort/2, thread_create/2, etc..
> > >
> > > For more information:
> > >
> > > "The Dogelog Runtime is a small and fast ISO core
> > > standard Prolog system that runs in a browser or on
> > > node.js. The Dogelog Runtime supports old browsers
> > > with common JavaScript and new browsers with
> > > module JavaScript."
> > > https://github.com/jburse/dogelog-moon
> > >
> > > Julio Di Egidio schrieb:
> > >> IMO, Prolog is an amazing idea with amazing potential,
> > > but should be refocused and rewritten from scratch: as a low-level
> > > "logical" language with the leanest possible spec
> > > and VM, and the smallest possible runtime, so that it
> > > easily runs everywhere: expert systems and stuff like
> > > that... Prolog 2.0, maybe.
> > >

Re: The Programming Language Wars have just begun

<ff2a44a2-4daa-41ee-a701-31b25264de14n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9914&group=comp.lang.prolog#9914

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:d84:b0:449:7065:54a with SMTP id e4-20020a0562140d8400b004497065054amr5524636qve.52.1650490249639;
Wed, 20 Apr 2022 14:30:49 -0700 (PDT)
X-Received: by 2002:a81:53c1:0:b0:2eb:29e6:dd47 with SMTP id
h184-20020a8153c1000000b002eb29e6dd47mr23415909ywb.377.1650490249488; Wed, 20
Apr 2022 14:30:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 20 Apr 2022 14:30:49 -0700 (PDT)
In-Reply-To: <a9cc9f0b-a8a7-4081-a33c-b17968a6b36an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sbqffa$pj2$1@solani.org> <c69d6e13-9d2c-4f47-8878-69f8183d6cf0n@googlegroups.com>
<85d04318-2b0c-4da9-9c80-467e798fbf13n@googlegroups.com> <sc760j$7jg$1@solani.org>
<sc76ik$7ug$1@solani.org> <625b4b43-5486-4382-8e5f-6bf014b28210n@googlegroups.com>
<a9cc9f0b-a8a7-4081-a33c-b17968a6b36an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ff2a44a2-4daa-41ee-a701-31b25264de14n@googlegroups.com>
Subject: Re: The Programming Language Wars have just begun
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 20 Apr 2022 21:30:49 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 24
 by: Mostowski Collapse - Wed, 20 Apr 2022 21:30 UTC

About change_arg/3 and the call_nth/2 use case. Its also available in

SICStus Prolog, by another predicate name I guess!!! Of course it needs
intimate knowledge how compounds are allocated, deallocated or otherwise
manipulated by the Prolog system. The use case of call_nth/2 is

quite tame, since we do only update with an atomic, in particular
with an integer, and not with a compound value of some sort,
ground or not ground. But you gain quite some speed:

You get near metal speed!!!

count the number of calls of a clause
https://stackoverflow.com/a/11400256/17524790

In formerly Jekejeke Prolog the trick with the extra variable
doesn't work, i.e. State=count(0,_), but functor(State, count, 1)
works, and in Dogelog Player, current version State=count(0)

can be used. I don't know what would work in Scryer Prolog.
Also there are rumors that there are Coq and Isabelle/HOL
libraries that allow reasoning about the construct, since it mimics

aspects of RAM machines, which do have formalizations.

Re: The Programming Language Wars have just begun

<1e3de3cb-5dad-4f4d-ae57-418525919f77n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9915&group=comp.lang.prolog#9915

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:8e0b:0:b0:435:1779:7b22 with SMTP id v11-20020a0c8e0b000000b0043517797b22mr18546181qvb.63.1650536814945;
Thu, 21 Apr 2022 03:26:54 -0700 (PDT)
X-Received: by 2002:a81:ff12:0:b0:2db:2d8a:9769 with SMTP id
k18-20020a81ff12000000b002db2d8a9769mr24723518ywn.172.1650536814794; Thu, 21
Apr 2022 03:26:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 21 Apr 2022 03:26:54 -0700 (PDT)
In-Reply-To: <ff2a44a2-4daa-41ee-a701-31b25264de14n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sbqffa$pj2$1@solani.org> <c69d6e13-9d2c-4f47-8878-69f8183d6cf0n@googlegroups.com>
<85d04318-2b0c-4da9-9c80-467e798fbf13n@googlegroups.com> <sc760j$7jg$1@solani.org>
<sc76ik$7ug$1@solani.org> <625b4b43-5486-4382-8e5f-6bf014b28210n@googlegroups.com>
<a9cc9f0b-a8a7-4081-a33c-b17968a6b36an@googlegroups.com> <ff2a44a2-4daa-41ee-a701-31b25264de14n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1e3de3cb-5dad-4f4d-ae57-418525919f77n@googlegroups.com>
Subject: Re: The Programming Language Wars have just begun
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 21 Apr 2022 10:26:54 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 41
 by: Mostowski Collapse - Thu, 21 Apr 2022 10:26 UTC

If you don't think about introducing change_arg/3 in your Prolog system
head start first, and start implementing call_nth/2 and all other stuff instead
first, you are doing something wrong.

Also that change_arg/3 isn't widely available is not correct, since
recently I have it in formerly Jekejeke Prolog. So the list is bigger:

- SWI-Prolog (corresponds to nb_linkarg/3, right?)
- YAP (corresponds to nb_linkarg/3, right?)
- GNU Prolog (possibly setarg/4 with 4-th argument false)
- SICStus Prolog (didn't check yet which one is change_arg/3 exactly)
- ECLiPSe Prolog (didn't check yet which one is change_arg/3 exactly)
- Formerly Jekejeke Prolog (by its name)
- Dogelog Player (by its name)
- BinProlog from Paul Tarau (by its name)
- ... What else?

Mostowski Collapse schrieb am Mittwoch, 20. April 2022 um 23:30:50 UTC+2:
> About change_arg/3 and the call_nth/2 use case. Its also available in
>
> SICStus Prolog, by another predicate name I guess!!! Of course it needs
> intimate knowledge how compounds are allocated, deallocated or otherwise
> manipulated by the Prolog system. The use case of call_nth/2 is
>
> quite tame, since we do only update with an atomic, in particular
> with an integer, and not with a compound value of some sort,
> ground or not ground. But you gain quite some speed:
>
> You get near metal speed!!!
>
> count the number of calls of a clause
> https://stackoverflow.com/a/11400256/17524790
>
> In formerly Jekejeke Prolog the trick with the extra variable
> doesn't work, i.e. State=count(0,_), but functor(State, count, 1)
> works, and in Dogelog Player, current version State=count(0)
>
> can be used. I don't know what would work in Scryer Prolog.
> Also there are rumors that there are Coq and Isabelle/HOL
> libraries that allow reasoning about the construct, since it mimics
>
> aspects of RAM machines, which do have formalizations.

Re: The Programming Language Wars have just begun

<fa4f518f-7f52-4bf3-8815-4a4de0a8ba17n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9916&group=comp.lang.prolog#9916

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:29e6:b0:44a:2d0f:bf63 with SMTP id jv6-20020a05621429e600b0044a2d0fbf63mr247313qvb.93.1650555139553;
Thu, 21 Apr 2022 08:32:19 -0700 (PDT)
X-Received: by 2002:a81:c09:0:b0:2e5:728f:b0d4 with SMTP id
9-20020a810c09000000b002e5728fb0d4mr242142ywm.230.1650555139319; Thu, 21 Apr
2022 08:32:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 21 Apr 2022 08:32:19 -0700 (PDT)
In-Reply-To: <1e3de3cb-5dad-4f4d-ae57-418525919f77n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sbqffa$pj2$1@solani.org> <c69d6e13-9d2c-4f47-8878-69f8183d6cf0n@googlegroups.com>
<85d04318-2b0c-4da9-9c80-467e798fbf13n@googlegroups.com> <sc760j$7jg$1@solani.org>
<sc76ik$7ug$1@solani.org> <625b4b43-5486-4382-8e5f-6bf014b28210n@googlegroups.com>
<a9cc9f0b-a8a7-4081-a33c-b17968a6b36an@googlegroups.com> <ff2a44a2-4daa-41ee-a701-31b25264de14n@googlegroups.com>
<1e3de3cb-5dad-4f4d-ae57-418525919f77n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fa4f518f-7f52-4bf3-8815-4a4de0a8ba17n@googlegroups.com>
Subject: Re: The Programming Language Wars have just begun
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 21 Apr 2022 15:32:19 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 45
 by: Mostowski Collapse - Thu, 21 Apr 2022 15:32 UTC

Oops, yes my bad. It could be that SICStus Prolog and ECLiPSe Prolog do
not have some change_arg/3 equivalent. Was also making an experiment with:

call_nth2(Goal_0, C) :-
State = v(0),
Goal_0,
arg(1, State, C1),
C2 is C1+1,
nb_linkarg(1, State, C2),
% setarg(1, State, C2, false), % for GNU Prolog
C = C2.

And then I got:

/* SWI-Prolog */
?- time((between(1,1000000,_),
call_nth2(call_nth2((X=a;X=b),N), M), fail; true)).
% 10,000,003 inferences, 0.859 CPU in 0.847 seconds
(101% CPU, 11636367 Lips)
true.

/* GNU Prolog */
?- ((between(1,1000000,_),
call_nth2(call_nth2((X=a;X=b),N), M), fail; true)).
(1578 ms) yes

Was I allowed to use nb_linkarg/3? If this is allowed, then SWI-Prolog
ranks top in speed.

Mostowski Collapse schrieb am Donnerstag, 21. April 2022 um 12:26:55 UTC+2:
> If you don't think about introducing change_arg/3 in your Prolog system
> head start first, and start implementing call_nth/2 and all other stuff instead
> first, you are doing something wrong.
>
> Also that change_arg/3 isn't widely available is not correct, since
> recently I have it in formerly Jekejeke Prolog. So the list is bigger:
>
> - SWI-Prolog (corresponds to nb_linkarg/3, right?)
> - YAP (corresponds to nb_linkarg/3, right?)
> - GNU Prolog (possibly setarg/4 with 4-th argument false)
> - SICStus Prolog (didn't check yet which one is change_arg/3 exactly)
> - ECLiPSe Prolog (didn't check yet which one is change_arg/3 exactly)
> - Formerly Jekejeke Prolog (by its name)
> - Dogelog Player (by its name)
> - BinProlog from Paul Tarau (by its name)
> - ... What else?

Re: The Programming Language Wars have just begun

<27aea5f9-3e17-4b15-83fe-090d8f04623dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9917&group=comp.lang.prolog#9917

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7f54:0:b0:2f1:f48c:c73a with SMTP id g20-20020ac87f54000000b002f1f48cc73amr16857199qtk.265.1650555256585;
Thu, 21 Apr 2022 08:34:16 -0700 (PDT)
X-Received: by 2002:a0d:fc45:0:b0:2eb:65c0:26f with SMTP id
m66-20020a0dfc45000000b002eb65c0026fmr285976ywf.22.1650555256358; Thu, 21 Apr
2022 08:34:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 21 Apr 2022 08:34:16 -0700 (PDT)
In-Reply-To: <fa4f518f-7f52-4bf3-8815-4a4de0a8ba17n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <sbqffa$pj2$1@solani.org> <c69d6e13-9d2c-4f47-8878-69f8183d6cf0n@googlegroups.com>
<85d04318-2b0c-4da9-9c80-467e798fbf13n@googlegroups.com> <sc760j$7jg$1@solani.org>
<sc76ik$7ug$1@solani.org> <625b4b43-5486-4382-8e5f-6bf014b28210n@googlegroups.com>
<a9cc9f0b-a8a7-4081-a33c-b17968a6b36an@googlegroups.com> <ff2a44a2-4daa-41ee-a701-31b25264de14n@googlegroups.com>
<1e3de3cb-5dad-4f4d-ae57-418525919f77n@googlegroups.com> <fa4f518f-7f52-4bf3-8815-4a4de0a8ba17n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <27aea5f9-3e17-4b15-83fe-090d8f04623dn@googlegroups.com>
Subject: Re: The Programming Language Wars have just begun
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 21 Apr 2022 15:34:16 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 67
 by: Mostowski Collapse - Thu, 21 Apr 2022 15:34 UTC

Same speed as ECLiPSe Prolog which doesn't
need setup_call_cleanup/3, solution from SO:

/* ECLiPSe Prolog */
[eclipse 5]: between(1,1000000,_), call_nth(call_nth((X=a;X=b), N), M), fail; true.
X = X
N = N
M = M
Yes (0.84s cpu)

But 10 times faster than SICStus Prolog, which needs setup_call_cleanup/3,
solution also from SO, which gives quite a speed damping:

/* SICStus Prolog */
?- statistics(walltime, A), (between(1,1000000,_), call_nth(call_nth((X=a;X=b), N), M), fail; true),
statistics(walltime, B).
A = [408655,137987],
B = [416794,8139] ?

By SO solution I mean:
https://stackoverflow.com/a/11400256/17524790

Mostowski Collapse schrieb am Donnerstag, 21. April 2022 um 17:32:20 UTC+2:
> Oops, yes my bad. It could be that SICStus Prolog and ECLiPSe Prolog do
> not have some change_arg/3 equivalent. Was also making an experiment with:
>
> call_nth2(Goal_0, C) :-
> State = v(0),
> Goal_0,
> arg(1, State, C1),
> C2 is C1+1,
> nb_linkarg(1, State, C2),
> % setarg(1, State, C2, false), % for GNU Prolog
> C = C2.
>
> And then I got:
>
> /* SWI-Prolog */
> ?- time((between(1,1000000,_),
> call_nth2(call_nth2((X=a;X=b),N), M), fail; true)).
> % 10,000,003 inferences, 0.859 CPU in 0.847 seconds
> (101% CPU, 11636367 Lips)
> true.
>
> /* GNU Prolog */
> ?- ((between(1,1000000,_),
> call_nth2(call_nth2((X=a;X=b),N), M), fail; true)).
> (1578 ms) yes
>
> Was I allowed to use nb_linkarg/3? If this is allowed, then SWI-Prolog
> ranks top in speed.
> Mostowski Collapse schrieb am Donnerstag, 21. April 2022 um 12:26:55 UTC+2:
> > If you don't think about introducing change_arg/3 in your Prolog system
> > head start first, and start implementing call_nth/2 and all other stuff instead
> > first, you are doing something wrong.
> >
> > Also that change_arg/3 isn't widely available is not correct, since
> > recently I have it in formerly Jekejeke Prolog. So the list is bigger:
> >
> > - SWI-Prolog (corresponds to nb_linkarg/3, right?)
> > - YAP (corresponds to nb_linkarg/3, right?)
> > - GNU Prolog (possibly setarg/4 with 4-th argument false)
> > - SICStus Prolog (didn't check yet which one is change_arg/3 exactly)
> > - ECLiPSe Prolog (didn't check yet which one is change_arg/3 exactly)
> > - Formerly Jekejeke Prolog (by its name)
> > - Dogelog Player (by its name)
> > - BinProlog from Paul Tarau (by its name)
> > - ... What else?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor