Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.lang.prolog / Re: Request for comments: Two types of float of integer division

SubjectAuthor
* Request for comments: Two types of float of integer divisionMild Shock
`* Request for comments: Two types of float of integer divisionMild Shock
 `* Request for comments: Two types of float of integer divisionMild Shock
  `* Request for comments: Two types of float of integer divisionMild Shock
   `* Request for comments: Two types of float of integer divisionMild Shock
    `- Request for comments: Two types of float of integer divisionMild Shock

1
Re: Request for comments: Two types of float of integer division

<b4fe1397-91ae-472c-9365-dbd8e0937f27n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1056:b0:412:26ce:857f with SMTP id f22-20020a05622a105600b0041226ce857fmr137418qte.12.1694282986487;
Sat, 09 Sep 2023 11:09:46 -0700 (PDT)
X-Received: by 2002:a05:6a00:2d23:b0:68c:33a9:e564 with SMTP id
fa35-20020a056a002d2300b0068c33a9e564mr2165560pfb.5.1694282985851; Sat, 09
Sep 2023 11:09:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 9 Sep 2023 11:09:45 -0700 (PDT)
In-Reply-To: <616590d2-4927-4f60-ba91-acef849695a3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <616590d2-4927-4f60-ba91-acef849695a3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b4fe1397-91ae-472c-9365-dbd8e0937f27n@googlegroups.com>
Subject: Re: Request for comments: Two types of float of integer division
From: burse...@gmail.com (Mild Shock)
Injection-Date: Sat, 09 Sep 2023 18:09:46 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2083
 by: Mild Shock - Sat, 9 Sep 2023 18:09 UTC

I am still fiddling around with (is)/2 implementation.
Formerly Jekejeke Prolog had traditionally automatic
bridging and tunneling. This is all going down the drain,

we want to become more GNU Prolog compatible. Novacore
should be as puritanical as possible, namely a Prolog core that
has an upbringing that disapproves the suggar laced world of

formerly Jekejeke Prolog! Funny discovery, not all Prolog
systems throw the same evaluable errors. Here a little
discrepancy between GNU Prolog and SWI-Prolog:

/* GNU Prolog */
?- X is append(1,2).
uncaught exception: error(type_error(evaluable,append/2),(is)/2)
?- X is append([1,2],[3]).
uncaught exception: error(type_error(evaluable,append/2),(is)/2)

/* SWI-Prolog */
?- X is append(1,2).
ERROR: Arithmetic: `append/2' is not a function
?- X is append([1,2],[3]).
ERROR: Type error: `[]' expected, found `[1,2]' (a list)
("x" must hold one character)

Re: Request for comments: Two types of float of integer division

<a6ed877b-5d7d-4404-b41c-ee58c12ba6a0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:63c1:b0:76f:1531:aa32 with SMTP id pw1-20020a05620a63c100b0076f1531aa32mr173080qkn.7.1694283180820;
Sat, 09 Sep 2023 11:13:00 -0700 (PDT)
X-Received: by 2002:a17:902:f38a:b0:1b7:c944:edd4 with SMTP id
f10-20020a170902f38a00b001b7c944edd4mr1844942ple.2.1694283180582; Sat, 09 Sep
2023 11:13:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 9 Sep 2023 11:13:00 -0700 (PDT)
In-Reply-To: <b4fe1397-91ae-472c-9365-dbd8e0937f27n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <616590d2-4927-4f60-ba91-acef849695a3n@googlegroups.com> <b4fe1397-91ae-472c-9365-dbd8e0937f27n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a6ed877b-5d7d-4404-b41c-ee58c12ba6a0n@googlegroups.com>
Subject: Re: Request for comments: Two types of float of integer division
From: burse...@gmail.com (Mild Shock)
Injection-Date: Sat, 09 Sep 2023 18:13:00 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3096
 by: Mild Shock - Sat, 9 Sep 2023 18:13 UTC

My newest take in formerly Jekejeke Prolog and Dogelog
Player, now behaving the same for this test case. This
is a preview, these versions have not yet been officially released:

/* Jekejeke Prolog, 1.6.3 */
?- X is append(1,2).
Error: Argument should have evaluable functor, found append/2.
?- X is append([1,2],[3]).
Error: Argument should have evaluable functor, found append/2.

/* Dogelog Player, 1.1.1, nodeJS */
?- X is append(1,2).
Error: Argument should have evaluable functor, found append/2.
?- X is append([1,2],[3]).
Error: Argument should have evaluable functor, found append/2.

/* Dogelog Player, 1.1.1, PyPy */
?- X is append(1,2).
Error: Argument should have evaluable functor, found append/2.
?- X is append([1,2],[3]).
Error: Argument should have evaluable functor, found append/2.

Mild Shock schrieb am Samstag, 9. September 2023 um 20:09:47 UTC+2:
> I am still fiddling around with (is)/2 implementation.
> Formerly Jekejeke Prolog had traditionally automatic
> bridging and tunneling. This is all going down the drain,
>
> we want to become more GNU Prolog compatible. Novacore
> should be as puritanical as possible, namely a Prolog core that
> has an upbringing that disapproves the suggar laced world of
>
> formerly Jekejeke Prolog! Funny discovery, not all Prolog
> systems throw the same evaluable errors. Here a little
> discrepancy between GNU Prolog and SWI-Prolog:
>
> /* GNU Prolog */
> ?- X is append(1,2).
> uncaught exception: error(type_error(evaluable,append/2),(is)/2)
> ?- X is append([1,2],[3]).
> uncaught exception: error(type_error(evaluable,append/2),(is)/2)
>
> /* SWI-Prolog */
> ?- X is append(1,2).
> ERROR: Arithmetic: `append/2' is not a function
> ?- X is append([1,2],[3]).
> ERROR: Type error: `[]' expected, found `[1,2]' (a list)
> ("x" must hold one character)

Re: Request for comments: Two types of float of integer division

<5848823c-8c71-4d67-8dc0-42a72aaa95acn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5bc6:0:b0:410:a249:bee5 with SMTP id b6-20020ac85bc6000000b00410a249bee5mr120408qtb.9.1694290632334;
Sat, 09 Sep 2023 13:17:12 -0700 (PDT)
X-Received: by 2002:a63:7311:0:b0:564:c506:bcf1 with SMTP id
o17-20020a637311000000b00564c506bcf1mr1201337pgc.4.1694290631532; Sat, 09 Sep
2023 13:17:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 9 Sep 2023 13:17:11 -0700 (PDT)
In-Reply-To: <a6ed877b-5d7d-4404-b41c-ee58c12ba6a0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <616590d2-4927-4f60-ba91-acef849695a3n@googlegroups.com>
<b4fe1397-91ae-472c-9365-dbd8e0937f27n@googlegroups.com> <a6ed877b-5d7d-4404-b41c-ee58c12ba6a0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5848823c-8c71-4d67-8dc0-42a72aaa95acn@googlegroups.com>
Subject: Re: Request for comments: Two types of float of integer division
From: burse...@gmail.com (Mild Shock)
Injection-Date: Sat, 09 Sep 2023 20:17:12 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mild Shock - Sat, 9 Sep 2023 20:17 UTC

I started using this test case:

test :-
between(0,1000000,N),
_ is exp(1+N/1000000),
fail.
test.

To test a new Java foreign function interface. I then
observed that SWI-Prolog stack engine causes
a little overhead:

/* SWI-Prolog, 9.1.14, optimise=false */
?- time(test).
% 2,000,001 inferences, 0.313 CPU in 0.315 seconds
(99% CPU, 6400003 Lips)
true.

/* SWI-Prolog, 9.1.14, optimise=true */
?- time(test).
% 1,000,002 inferences, 0.172 CPU in 0.176 seconds
(98% CPU, 5818193 Lips)
true.

Intrestingly GNU Prolog doesn’t use a stack engine,
just relies on the native stack. Its quite speedy without
any optimisation:

/* GNU Prolog 1.5.0 (64 bits) */
?- test.
(125 ms) yes

Re: Request for comments: Two types of float of integer division

<f3083699-800d-45c6-b622-cea67bac91fbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:18f0:b0:63d:a43:7b06 with SMTP id ep16-20020a05621418f000b0063d0a437b06mr122081qvb.9.1694290700088;
Sat, 09 Sep 2023 13:18:20 -0700 (PDT)
X-Received: by 2002:a63:9313:0:b0:569:450d:cf3d with SMTP id
b19-20020a639313000000b00569450dcf3dmr1187877pge.6.1694290699603; Sat, 09 Sep
2023 13:18:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 9 Sep 2023 13:18:19 -0700 (PDT)
In-Reply-To: <5848823c-8c71-4d67-8dc0-42a72aaa95acn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <616590d2-4927-4f60-ba91-acef849695a3n@googlegroups.com>
<b4fe1397-91ae-472c-9365-dbd8e0937f27n@googlegroups.com> <a6ed877b-5d7d-4404-b41c-ee58c12ba6a0n@googlegroups.com>
<5848823c-8c71-4d67-8dc0-42a72aaa95acn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f3083699-800d-45c6-b622-cea67bac91fbn@googlegroups.com>
Subject: Re: Request for comments: Two types of float of integer division
From: burse...@gmail.com (Mild Shock)
Injection-Date: Sat, 09 Sep 2023 20:18:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3320
 by: Mild Shock - Sat, 9 Sep 2023 20:18 UTC

The internal call is tail recursive I guess, since the functor is
already checked, and a looked up handle, a function pointer,
causes the evaluation. Recently GNU Prolog has moved to GitHub,

so I can find the source code of GNU Prolog stuff more easily, things
like Load_Math_Expression. But I think the GNU Prolog approach is
only feasible, if you dare to rely on the native stack.

Concerning the new Java foreign function interface. I switched
from handles obtained by method reflection to handles that were
populated via functional interfaces. Its an itch faster, and close

to SWI-Prolog optimised, but only for JDK 8:

/* Jekejeke Prolog, 1.6.3, JDK 8, Functional Interface */
?- time(test).
% Time 171 ms, GC 2 ms, Wall 09/09/2023 22:04
true.

The above uses the native stack like GNU Prolog and no
cycle testing nothing. But I guess it burns CPU since it uses
two pointers to represent a term. I hope I can soon get rid of that.

Another brake could be the varargs array allocation.

Mild Shock schrieb am Samstag, 9. September 2023 um 22:17:13 UTC+2:
> I started using this test case:
>
> test :-
> between(0,1000000,N),
> _ is exp(1+N/1000000),
> fail.
> test.
>
> To test a new Java foreign function interface. I then
> observed that SWI-Prolog stack engine causes
> a little overhead:
>
> /* SWI-Prolog, 9.1.14, optimise=false */
> ?- time(test).
> % 2,000,001 inferences, 0.313 CPU in 0.315 seconds
> (99% CPU, 6400003 Lips)
> true.
>
> /* SWI-Prolog, 9.1.14, optimise=true */
> ?- time(test).
> % 1,000,002 inferences, 0.172 CPU in 0.176 seconds
> (98% CPU, 5818193 Lips)
> true.
>
> Intrestingly GNU Prolog doesn’t use a stack engine,
> just relies on the native stack. Its quite speedy without
> any optimisation:
>
> /* GNU Prolog 1.5.0 (64 bits) */
> ?- test.
> (125 ms) yes

Re: Request for comments: Two types of float of integer division

<02c12d31-31dd-436d-b3ac-26379ccc6522n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5ed6:0:b0:412:7ea:37c9 with SMTP id s22-20020ac85ed6000000b0041207ea37c9mr287934qtx.5.1694382353958;
Sun, 10 Sep 2023 14:45:53 -0700 (PDT)
X-Received: by 2002:a63:921e:0:b0:566:1c6:139b with SMTP id
o30-20020a63921e000000b0056601c6139bmr1726254pgd.8.1694382353486; Sun, 10 Sep
2023 14:45:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sun, 10 Sep 2023 14:45:52 -0700 (PDT)
In-Reply-To: <f3083699-800d-45c6-b622-cea67bac91fbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <616590d2-4927-4f60-ba91-acef849695a3n@googlegroups.com>
<b4fe1397-91ae-472c-9365-dbd8e0937f27n@googlegroups.com> <a6ed877b-5d7d-4404-b41c-ee58c12ba6a0n@googlegroups.com>
<5848823c-8c71-4d67-8dc0-42a72aaa95acn@googlegroups.com> <f3083699-800d-45c6-b622-cea67bac91fbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <02c12d31-31dd-436d-b3ac-26379ccc6522n@googlegroups.com>
Subject: Re: Request for comments: Two types of float of integer division
From: burse...@gmail.com (Mild Shock)
Injection-Date: Sun, 10 Sep 2023 21:45:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4340
 by: Mild Shock - Sun, 10 Sep 2023 21:45 UTC

Ok there is a big confusion in SWI-Prolog discourse, I was
mentioning native stack, and people think I was talking
about native code. Holy cow! Do I speak chinese, or what?

Just look for yourself. Step 1: Go to GNU Prolog GitHub,
Step 2: Lookup the C function Load_Math_Expression
Interesting find, for Dogelog Player on CPython so far:

/* Dogelog Player 1.1.1, CPython */
?- X=1+X, Y is X.
Unknown exception: 'maximum recursion depth exceeded'

What does PyPy do? What does JavaScript do? How do we
handle this exception. Are there more candidates than only (is)/2,
like for example copy_term/2, etc.. This would cover Dogelog

Player. What about formerly Jekejeke Prolog, respectively Java?

Mild Shock schrieb am Samstag, 9. September 2023 um 22:18:21 UTC+2:
> The internal call is tail recursive I guess, since the functor is
> already checked, and a looked up handle, a function pointer,
> causes the evaluation. Recently GNU Prolog has moved to GitHub,
>
> so I can find the source code of GNU Prolog stuff more easily, things
> like Load_Math_Expression. But I think the GNU Prolog approach is
> only feasible, if you dare to rely on the native stack.
>
> Concerning the new Java foreign function interface. I switched
> from handles obtained by method reflection to handles that were
> populated via functional interfaces. Its an itch faster, and close
>
> to SWI-Prolog optimised, but only for JDK 8:
>
> /* Jekejeke Prolog, 1.6.3, JDK 8, Functional Interface */
> ?- time(test).
> % Time 171 ms, GC 2 ms, Wall 09/09/2023 22:04
> true.
>
> The above uses the native stack like GNU Prolog and no
> cycle testing nothing. But I guess it burns CPU since it uses
> two pointers to represent a term. I hope I can soon get rid of that.
>
> Another brake could be the varargs array allocation.
> Mild Shock schrieb am Samstag, 9. September 2023 um 22:17:13 UTC+2:
> > I started using this test case:
> >
> > test :-
> > between(0,1000000,N),
> > _ is exp(1+N/1000000),
> > fail.
> > test.
> >
> > To test a new Java foreign function interface. I then
> > observed that SWI-Prolog stack engine causes
> > a little overhead:
> >
> > /* SWI-Prolog, 9.1.14, optimise=false */
> > ?- time(test).
> > % 2,000,001 inferences, 0.313 CPU in 0.315 seconds
> > (99% CPU, 6400003 Lips)
> > true.
> >
> > /* SWI-Prolog, 9.1.14, optimise=true */
> > ?- time(test).
> > % 1,000,002 inferences, 0.172 CPU in 0.176 seconds
> > (98% CPU, 5818193 Lips)
> > true.
> >
> > Intrestingly GNU Prolog doesn’t use a stack engine,
> > just relies on the native stack. Its quite speedy without
> > any optimisation:
> >
> > /* GNU Prolog 1.5.0 (64 bits) */
> > ?- test.
> > (125 ms) yes

Re: Request for comments: Two types of float of integer division

<9adc813b-8b5b-4e4e-a823-f7d6af5c6e57n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:1914:b0:655:afc1:e9b1 with SMTP id er20-20020a056214191400b00655afc1e9b1mr233104qvb.1.1694467907791;
Mon, 11 Sep 2023 14:31:47 -0700 (PDT)
X-Received: by 2002:a17:902:db05:b0:1c2:c60:839d with SMTP id
m5-20020a170902db0500b001c20c60839dmr4661580plx.8.1694467907498; Mon, 11 Sep
2023 14:31:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Mon, 11 Sep 2023 14:31:47 -0700 (PDT)
In-Reply-To: <02c12d31-31dd-436d-b3ac-26379ccc6522n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <616590d2-4927-4f60-ba91-acef849695a3n@googlegroups.com>
<b4fe1397-91ae-472c-9365-dbd8e0937f27n@googlegroups.com> <a6ed877b-5d7d-4404-b41c-ee58c12ba6a0n@googlegroups.com>
<5848823c-8c71-4d67-8dc0-42a72aaa95acn@googlegroups.com> <f3083699-800d-45c6-b622-cea67bac91fbn@googlegroups.com>
<02c12d31-31dd-436d-b3ac-26379ccc6522n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9adc813b-8b5b-4e4e-a823-f7d6af5c6e57n@googlegroups.com>
Subject: Re: Request for comments: Two types of float of integer division
From: burse...@gmail.com (Mild Shock)
Injection-Date: Mon, 11 Sep 2023 21:31:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5581
 by: Mild Shock - Mon, 11 Sep 2023 21:31 UTC

Is there any use case for the cycle check? It gives an error more earlier.
If one has a resource quota, one would also get an error only a little bit
later, when the stack is to large and some memory is exhausted.

Here is a sketch of a post mortem analysis, even written in 100%
pure Prolog, which gives an error analysis service:

X is Y :-
catch(eval(Y,X), error(foo,_),
(acyclic_term(Y) -> throw(error(bar,_)); throw(error(baz,_)))).

The single error “foo” produced by the internal eval/2 predicate
is changed into either an error “bar” or an error “baz”, to provide the
end-user some more information. Can be also implemented

natively by the builtin is/2, making a cycle test during eval/2
unnecessary, since acyclic_term/1 exists. Or is there a danger
that acyclic_term/1 crashes? It probably uses less stack than eval/2.

Mild Shock schrieb am Sonntag, 10. September 2023 um 23:45:55 UTC+2:
> Ok there is a big confusion in SWI-Prolog discourse, I was
> mentioning native stack, and people think I was talking
> about native code. Holy cow! Do I speak chinese, or what?
>
> Just look for yourself. Step 1: Go to GNU Prolog GitHub,
> Step 2: Lookup the C function Load_Math_Expression
> Interesting find, for Dogelog Player on CPython so far:
>
> /* Dogelog Player 1.1.1, CPython */
> ?- X=1+X, Y is X.
> Unknown exception: 'maximum recursion depth exceeded'
>
> What does PyPy do? What does JavaScript do? How do we
> handle this exception. Are there more candidates than only (is)/2,
> like for example copy_term/2, etc.. This would cover Dogelog
>
> Player. What about formerly Jekejeke Prolog, respectively Java?
> Mild Shock schrieb am Samstag, 9. September 2023 um 22:18:21 UTC+2:
> > The internal call is tail recursive I guess, since the functor is
> > already checked, and a looked up handle, a function pointer,
> > causes the evaluation. Recently GNU Prolog has moved to GitHub,
> >
> > so I can find the source code of GNU Prolog stuff more easily, things
> > like Load_Math_Expression. But I think the GNU Prolog approach is
> > only feasible, if you dare to rely on the native stack.
> >
> > Concerning the new Java foreign function interface. I switched
> > from handles obtained by method reflection to handles that were
> > populated via functional interfaces. Its an itch faster, and close
> >
> > to SWI-Prolog optimised, but only for JDK 8:
> >
> > /* Jekejeke Prolog, 1.6.3, JDK 8, Functional Interface */
> > ?- time(test).
> > % Time 171 ms, GC 2 ms, Wall 09/09/2023 22:04
> > true.
> >
> > The above uses the native stack like GNU Prolog and no
> > cycle testing nothing. But I guess it burns CPU since it uses
> > two pointers to represent a term. I hope I can soon get rid of that.
> >
> > Another brake could be the varargs array allocation.
> > Mild Shock schrieb am Samstag, 9. September 2023 um 22:17:13 UTC+2:
> > > I started using this test case:
> > >
> > > test :-
> > > between(0,1000000,N),
> > > _ is exp(1+N/1000000),
> > > fail.
> > > test.
> > >
> > > To test a new Java foreign function interface. I then
> > > observed that SWI-Prolog stack engine causes
> > > a little overhead:
> > >
> > > /* SWI-Prolog, 9.1.14, optimise=false */
> > > ?- time(test).
> > > % 2,000,001 inferences, 0.313 CPU in 0.315 seconds
> > > (99% CPU, 6400003 Lips)
> > > true.
> > >
> > > /* SWI-Prolog, 9.1.14, optimise=true */
> > > ?- time(test).
> > > % 1,000,002 inferences, 0.172 CPU in 0.176 seconds
> > > (98% CPU, 5818193 Lips)
> > > true.
> > >
> > > Intrestingly GNU Prolog doesn’t use a stack engine,
> > > just relies on the native stack. Its quite speedy without
> > > any optimisation:
> > >
> > > /* GNU Prolog 1.5.0 (64 bits) */
> > > ?- test.
> > > (125 ms) yes

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor