Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Torque is cheap.


devel / comp.lang.prolog / Re: Request for comments, Novacore the sequel to ISO modules

SubjectAuthor
* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|  `- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMild Shock
|`* Request for comments, Novacore the sequel to ISO modulesMild Shock
| `* Request for comments, Novacore the sequel to ISO modulesMild Shock
|  `* Request for comments, Novacore the sequel to ISO modulesMild Shock
|   `- Request for comments, Novacore the sequel to ISO modulesMild Shock
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|  `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|   `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|    `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|     `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|      `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|       `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|        `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|         `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|          `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|           `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|            `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|             `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|              `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               `- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|  `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|   `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|    `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|     `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|      `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|       `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|        `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|         `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|          `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|           `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|            `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|             `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|              `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               `- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|  `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|   `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|    +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|    `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|     `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|      `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|       `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|        `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|         `- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
`- Request for comments, Novacore the sequel to ISO modulesMild Shock

Pages:123
Re: Request for comments, Novacore the sequel to ISO modules

<8d9406d3-08be-4d92-9f7f-37c51c84ac26n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2729&group=comp.lang.prolog#2729

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:271f:b0:6d4:56aa:4385 with SMTP id b31-20020a05620a271f00b006d456aa4385mr30965090qkp.175.1666792934937;
Wed, 26 Oct 2022 07:02:14 -0700 (PDT)
X-Received: by 2002:a05:6870:3128:b0:132:3030:9e59 with SMTP id
v40-20020a056870312800b0013230309e59mr2245715oaa.246.1666792934206; Wed, 26
Oct 2022 07:02:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Wed, 26 Oct 2022 07:02:13 -0700 (PDT)
In-Reply-To: <3485b2a1-1d18-4533-96e0-ef99141ccd5dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com> <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
<dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com> <3485b2a1-1d18-4533-96e0-ef99141ccd5dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8d9406d3-08be-4d92-9f7f-37c51c84ac26n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 26 Oct 2022 14:02:14 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3283
 by: Mostowski Collapse - Wed, 26 Oct 2022 14:02 UTC

BTW the real number quotient is this real number:

1267650600228229401496703205376 /
762385119722780192080867194597 =
1.66274310375991431383116365048...

Was using microsoft calculator desk accessory. But
maybe should do more testing of this new Python
mode trick. Nasty test cases might lure everywhere.

Mostowski Collapse schrieb am Mittwoch, 26. Oktober 2022 um 16:01:01 UTC+2:
> Here is a trick to force Python compatibility mode, I guess
> works for SWI-Prolog 8.5.20 which has improved rational
> number rounding? Thats the incorrectly rounded result:
>
> /* incorrectly rounded of the real number quotient */
> ?- X is 1267650600228229401496703205376 /
> 762385119722780192080867194597.
> X = 1.662743103759914.
> Now do switch on Python compatibility mode, and
> watch the result getting correctly rounded:
>
> /* Use this combo for Python compatibility:
> prefer_rationals=true,
> max_rational_size=0,
> max_rational_size_action=float */
> ?- set_prolog_flag(prefer_rationals, true).
> true.
>
> ?- set_prolog_flag(max_rational_size, 0).
> true.
>
> ?- set_prolog_flag(max_rational_size_action, float).
> true.
>
> /* Correctly rounded of the real number quotient, via
> detour over rational numbers, which are correctly
> rounded since release 8.5.20 of SWI-Prolog? */
> ?- X is 1267650600228229401496703205376 /
> 762385119722780192080867194597.
> X = 1.6627431037599143.

Re: Request for comments, Novacore the sequel to ISO modules

<c51fc6cc-9c06-4f3a-9803-5c04c6e55da2n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2753&group=comp.lang.prolog#2753

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2282:b0:6ef:1b80:ac9b with SMTP id o2-20020a05620a228200b006ef1b80ac9bmr13439079qkh.773.1668464470867;
Mon, 14 Nov 2022 14:21:10 -0800 (PST)
X-Received: by 2002:a05:6808:158f:b0:35a:fc6:75fd with SMTP id
t15-20020a056808158f00b0035a0fc675fdmr6870135oiw.282.1668464470603; Mon, 14
Nov 2022 14:21:10 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Mon, 14 Nov 2022 14:21:10 -0800 (PST)
In-Reply-To: <8d9406d3-08be-4d92-9f7f-37c51c84ac26n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com> <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
<dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com> <3485b2a1-1d18-4533-96e0-ef99141ccd5dn@googlegroups.com>
<8d9406d3-08be-4d92-9f7f-37c51c84ac26n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c51fc6cc-9c06-4f3a-9803-5c04c6e55da2n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 14 Nov 2022 22:21:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2563
 by: Mostowski Collapse - Mon, 14 Nov 2022 22:21 UTC

My latest take on msb/2, in case a Prolog system
doesn't have this built-in. Some hi lo search:

% msb(+Integer, -Integer)
msb(0, N) :- !, N = -1.
msb(X, N) :-
msb(X, 1, N).

% msb(+Integer, +Integer, -Integer)
msb(X, H, N) :-
X < (1<<H), !,
L is H>>1,
msb(X, L, H, N).
msb(X, H, N) :-
J is H<<1,
msb(X, J, N).

% msb(+Integer, +Integer, +Integer, -Integer)
msb(_, L, H, N) :- L+1 =:= H, !,
N = L.
msb(X, L, H, N) :- M is (L+H) >> 1,
X < (1<<M), !,
msb(X, L, M, N).
msb(X, L, H, N) :- M is (L+H) >> 1,
msb(X, M, H, N).

But it is not a replacement for the real thing.
An msb/1 evaluable function still performs better.

Re: Request for comments, Novacore the sequel to ISO modules

<987edaee-956e-49bc-8fb6-156bffe1abaan@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2754&group=comp.lang.prolog#2754

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:4010:b0:35c:e5db:53de with SMTP id cf16-20020a05622a401000b0035ce5db53demr14006493qtb.432.1668465087737;
Mon, 14 Nov 2022 14:31:27 -0800 (PST)
X-Received: by 2002:aca:f082:0:b0:359:af90:2bb7 with SMTP id
o124-20020acaf082000000b00359af902bb7mr6892436oih.23.1668465087451; Mon, 14
Nov 2022 14:31:27 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Mon, 14 Nov 2022 14:31:27 -0800 (PST)
In-Reply-To: <c51fc6cc-9c06-4f3a-9803-5c04c6e55da2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com> <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
<dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com> <3485b2a1-1d18-4533-96e0-ef99141ccd5dn@googlegroups.com>
<8d9406d3-08be-4d92-9f7f-37c51c84ac26n@googlegroups.com> <c51fc6cc-9c06-4f3a-9803-5c04c6e55da2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <987edaee-956e-49bc-8fb6-156bffe1abaan@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 14 Nov 2022 22:31:27 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4425
 by: Mostowski Collapse - Mon, 14 Nov 2022 22:31 UTC

So when will all Prolog system have these basic
evaluable functions and predicates?

msb/1: Return most significant bit of an integer
lsb/1: Return least significant bit of an integer
testbit/2: Succeed if bit of integer is set, otherwise fail.
divmod/4: Succeed with div and mod.

Scryer Prolog doesn't have these built-ins. So emulating
them makes it utterly slow. Using the hi lo approach for msb:

/* Scryer Prolog 0.9.1 WSL2 */
?- member((N,K),[(53,2600),(1024,150),(8192,9)]),
time((between(1,K,_), mp_pi(N, _), fail; true)), fail; true.
% CPU time: 4.240s
% CPU time: 5.621s
% CPU time: 7.718s
% true.

But it seems that bigints are not that fast, with ECLiPSe Prolog
which does not have these built-ins the hi lo isn't that bad:

/* ECLiPSe Prolog 7.1.12 Windows */
?- member((N,K),[(53,2600),(1024,150),(8192,9)]),
time_eclipse((between(1,K,_), mp_pi(N, _), fail; true)), fail; true.
0.904113500000676 sec
1.78132879998884 sec
1.56477859998995 sec

The best is always SWI-Prolog. It picks up trends and provides
functionallity so that the end-user can profit:

/* SWI-Prolog 8.5.20 Windows GMP */
?- member((N,K),[(53,2600),(1024,150),(8192,9)]),
time((between(1,K,_), mp_pi(N, _), fail; true)), fail; true.
% 8,699,603 inferences, 0.875 CPU in 0.879 seconds (100% CPU, 9942403 Lips)
% 7,952,250 inferences, 1.047 CPU in 1.064 seconds (98% CPU, 7596179 Lips)
% 3,771,657 inferences, 0.656 CPU in 0.673 seconds (97% CPU, 5747287 Lips)
true.

Whats wrong with the other Prolog systems, such as Scryer
Prolog and ECLiPSe Prolog that don't provide these built-ins?

Are they in a comatose sleeping beauty sleep?

Mostowski Collapse schrieb am Montag, 14. November 2022 um 23:21:11 UTC+1:
> My latest take on msb/2, in case a Prolog system
> doesn't have this built-in. Some hi lo search:
>
> % msb(+Integer, -Integer)
> msb(0, N) :- !, N = -1.
> msb(X, N) :-
> msb(X, 1, N).
>
> % msb(+Integer, +Integer, -Integer)
> msb(X, H, N) :-
> X < (1<<H), !,
> L is H>>1,
> msb(X, L, H, N).
> msb(X, H, N) :-
> J is H<<1,
> msb(X, J, N).
>
> % msb(+Integer, +Integer, +Integer, -Integer)
> msb(_, L, H, N) :- L+1 =:= H, !,
> N = L.
> msb(X, L, H, N) :- M is (L+H) >> 1,
> X < (1<<M), !,
> msb(X, L, M, N).
> msb(X, L, H, N) :- M is (L+H) >> 1,
> msb(X, M, H, N).
>
> But it is not a replacement for the real thing.
> An msb/1 evaluable function still performs better.

Re: Request for comments, Novacore the sequel to ISO modules

<e61f7e26-4272-4787-85ac-f0c1ab460546n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2757&group=comp.lang.prolog#2757

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:100f:b0:6fa:17e5:b62b with SMTP id z15-20020a05620a100f00b006fa17e5b62bmr1720043qkj.676.1668694130383;
Thu, 17 Nov 2022 06:08:50 -0800 (PST)
X-Received: by 2002:aca:ac43:0:b0:359:fcae:7c3f with SMTP id
v64-20020acaac43000000b00359fcae7c3fmr1269073oie.68.1668694129557; Thu, 17
Nov 2022 06:08:49 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Thu, 17 Nov 2022 06:08:49 -0800 (PST)
In-Reply-To: <987edaee-956e-49bc-8fb6-156bffe1abaan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com> <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
<dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com> <3485b2a1-1d18-4533-96e0-ef99141ccd5dn@googlegroups.com>
<8d9406d3-08be-4d92-9f7f-37c51c84ac26n@googlegroups.com> <c51fc6cc-9c06-4f3a-9803-5c04c6e55da2n@googlegroups.com>
<987edaee-956e-49bc-8fb6-156bffe1abaan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e61f7e26-4272-4787-85ac-f0c1ab460546n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 17 Nov 2022 14:08:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3675
 by: Mostowski Collapse - Thu, 17 Nov 2022 14:08 UTC

The best I can do for Dogelog Player, concerning
msb/1 and the JavaScript platform. Just imagine
the speed if JavaScript would have a real msb/1
or bitlength/1, so that we don't need this nonsense?

function bigint_msb(alpha) {
alpha = alpha.toString(16);
return 31 - Math.clz32(hexvalue(alpha.codePointAt(0))) + (alpha.length - 1)*4;
}

This is a known problem that bigint has no msb/1 or
bitlength/1 in JavaScript as of now. Nevertheless I now
easily beat Scryer Prolog even with Dogelog Player.
Comparing to the hi lo search msb I get these results:

/* Dogelog Player 1.0.3 Windows nodeJS */
?- member((N,K),[(53,2600),(1024,150),(8192,9)]),
time((between(1,K,_), mp_pi(N, _), fail; true)), fail; true.
% Wall 4136 ms, gc 10 ms, 2539128 lips
% Wall 4346 ms, gc 104 ms, 2219962 lips
% Wall 3876 ms, gc 88 ms, 1180529 lips
true.

Also unlike Scryer Prolog, for larger bigints, i.e. 8192
the timing doesn't go up, it rather goes down. Probably some
alternative bigint multiplication methods etc.. kick in for
larger bigints, and they are missing in Scryer Prolog for

the Rust based bigints? They are still in its fancy? Also
Scryer Prolog would fare better if it had a native msb/1.

Mostowski Collapse schrieb am Montag, 14. November 2022 um 23:31:28 UTC+1:
> Scryer Prolog doesn't have these built-ins. So emulating
> them makes it utterly slow. Using the hi lo approach for msb:
>
> /* Scryer Prolog 0.9.1 WSL2 */
> ?- member((N,K),[(53,2600),(1024,150),(8192,9)]),
> time((between(1,K,_), mp_pi(N, _), fail; true)), fail; true.
> % CPU time: 4.240s
> % CPU time: 5.621s
> % CPU time: 7.718s
> % true.

Re: Request for comments, Novacore the sequel to ISO modules

<3f2c91f1-36c4-4d3b-8b6e-d7a338665802n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2758&group=comp.lang.prolog#2758

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5148:0:b0:35c:d017:2fd7 with SMTP id h8-20020ac85148000000b0035cd0172fd7mr2266680qtn.579.1668694892293;
Thu, 17 Nov 2022 06:21:32 -0800 (PST)
X-Received: by 2002:a05:6830:110e:b0:661:c5ac:7324 with SMTP id
w14-20020a056830110e00b00661c5ac7324mr1543133otq.179.1668694891984; Thu, 17
Nov 2022 06:21:31 -0800 (PST)
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: Thu, 17 Nov 2022 06:21:31 -0800 (PST)
In-Reply-To: <e61f7e26-4272-4787-85ac-f0c1ab460546n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com> <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
<dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com> <3485b2a1-1d18-4533-96e0-ef99141ccd5dn@googlegroups.com>
<8d9406d3-08be-4d92-9f7f-37c51c84ac26n@googlegroups.com> <c51fc6cc-9c06-4f3a-9803-5c04c6e55da2n@googlegroups.com>
<987edaee-956e-49bc-8fb6-156bffe1abaan@googlegroups.com> <e61f7e26-4272-4787-85ac-f0c1ab460546n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3f2c91f1-36c4-4d3b-8b6e-d7a338665802n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 17 Nov 2022 14:21:32 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Thu, 17 Nov 2022 14:21 UTC

The effect that computation gets faster for larger bigint
is also seen for Python, when I use the PyPy interpreter.
I guess it has also to do with the effort needed to

promote a smallint to a bigint, either before an operation
or after an operation. Another speculation would be, that
the bigint operations slow down the frequency of my

Dogelog Player garbage collection, since this frequency
is not yet adaptive. But the larger bit test case even
beats Scryer Prolog, now beaten by Python/PyPy:
/* Dogelog Player 1.0.3 Windows PyPy */
?- member((N,K),[(53,2600),(1024,150),(8192,9)]),
time((between(1,K,_), mp_pi(N, _), fail; true)), fail; true.
% Wall 18696 ms, gc 799 ms, 561771 lips
% Wall 12737 ms, gc 730 ms, 757550 lips
% Wall 7126 ms, gc 339 ms, 642182 lips
true.

The 7126 ms (Dogelog Player on PyPy) compared to the
7.718s (Scryer Prolog) is ca. 10% faster. I never though
that Dogelog Prolog on the Python platform could do

that, since Python is rather annonyingly slow.

Mostowski Collapse schrieb am Donnerstag, 17. November 2022 um 15:08:51 UTC+1:
> The best I can do for Dogelog Player, concerning
> msb/1 and the JavaScript platform. Just imagine
> the speed if JavaScript would have a real msb/1
> or bitlength/1, so that we don't need this nonsense?
>
> function bigint_msb(alpha) {
> alpha = alpha.toString(16);
> return 31 - Math.clz32(hexvalue(alpha.codePointAt(0))) + (alpha.length - 1)*4;
> }
>
> This is a known problem that bigint has no msb/1 or
> bitlength/1 in JavaScript as of now. Nevertheless I now
> easily beat Scryer Prolog even with Dogelog Player.
> Comparing to the hi lo search msb I get these results:
>
> /* Dogelog Player 1.0.3 Windows nodeJS */
> ?- member((N,K),[(53,2600),(1024,150),(8192,9)]),
> time((between(1,K,_), mp_pi(N, _), fail; true)), fail; true.
> % Wall 4136 ms, gc 10 ms, 2539128 lips
> % Wall 4346 ms, gc 104 ms, 2219962 lips
> % Wall 3876 ms, gc 88 ms, 1180529 lips
> true.
>
> Also unlike Scryer Prolog, for larger bigints, i.e. 8192
> the timing doesn't go up, it rather goes down. Probably some
> alternative bigint multiplication methods etc.. kick in for
> larger bigints, and they are missing in Scryer Prolog for
>
> the Rust based bigints? They are still in its fancy? Also
> Scryer Prolog would fare better if it had a native msb/1.
> Mostowski Collapse schrieb am Montag, 14. November 2022 um 23:31:28 UTC+1:
> > Scryer Prolog doesn't have these built-ins. So emulating
> > them makes it utterly slow. Using the hi lo approach for msb:
> >
> > /* Scryer Prolog 0.9.1 WSL2 */
> > ?- member((N,K),[(53,2600),(1024,150),(8192,9)]),
> > time((between(1,K,_), mp_pi(N, _), fail; true)), fail; true.
> > % CPU time: 4.240s
> > % CPU time: 5.621s
> > % CPU time: 7.718s
> > % true.

Re: Request for comments, Novacore the sequel to ISO modules

<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2768&group=comp.lang.prolog#2768

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1b0f:b0:3a9:7719:2175 with SMTP id bb15-20020a05622a1b0f00b003a977192175mr3755111qtb.651.1673469929174;
Wed, 11 Jan 2023 12:45:29 -0800 (PST)
X-Received: by 2002:aca:db08:0:b0:363:b708:5480 with SMTP id
s8-20020acadb08000000b00363b7085480mr1929200oig.161.1673469928945; Wed, 11
Jan 2023 12:45:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Wed, 11 Jan 2023 12:45:28 -0800 (PST)
In-Reply-To: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 11 Jan 2023 20:45:29 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2007
 by: Mostowski Collapse - Wed, 11 Jan 2023 20:45 UTC

I guess its time to talk about DOM APIs inside Prolog,
and making them mature and portable. I am planning
to adopt the Tau Prolog DOM API.

But I have two DOM APIs in mind:

- Stateless DOM API: Basically Tau Prolog is a stateless
DOM API. All API calls have all the necessary parameters,
there is nothing implicit right?

- Statefull DOM API: On the other hand so far, in Dogelog
Player, I have used a statefull DOM API. With a notion
of cursor, you can imagine Turtle graphics, only the Turtle

is not a Turtle with location and orientation, but a node
somewhere in a DOM tree.

My plan is to give the Statefull DOM API a new try, but
bootstrapping it from the a Stateless DOM API. Eh voila
I am already banging my head:

DOM API: How get last child efficiently?
https://github.com/tau-prolog/tau-prolog/issues/340

Re: Request for comments, Novacore the sequel to ISO modules

<ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2769&group=comp.lang.prolog#2769

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:9c88:0:b0:4e6:ca24:d339 with SMTP id i8-20020a0c9c88000000b004e6ca24d339mr2581597qvf.115.1673470365247;
Wed, 11 Jan 2023 12:52:45 -0800 (PST)
X-Received: by 2002:a54:4712:0:b0:35e:2d5e:f627 with SMTP id
k18-20020a544712000000b0035e2d5ef627mr5137537oik.246.1673470364929; Wed, 11
Jan 2023 12:52:44 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Wed, 11 Jan 2023 12:52:44 -0800 (PST)
In-Reply-To: <9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com> <9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 11 Jan 2023 20:52:45 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3366
 by: Mostowski Collapse - Wed, 11 Jan 2023 20:52 UTC

Ha Ha ChatGPT is trolling me. You can search last_child
in Tau Prolog current GitHub, not a single find.

https://github.com/tau-prolog/tau-prolog/search?q=last_child

Or try this:

:- use_module(library(dom)).
?- last_child(foo, bar).
uncaught exception: error(existence_error(procedure,last_child/2),top_level/0)

Nevertheless ChatGPT halucinates something perfectly plausible:

Q: How get DOM last child in Tau Prolog programming language.

A: In Tau Prolog, you can use the built-in predicate
"last_child/2" to get the last child of a DOM element.

The predicate takes two arguments:

The DOM element for which you want to get
the last child (the parent element)
A variable that will be bound to the last child element

Example usage:

Copy code
last_child(parent_element, LastChild),
You have to unify the parent element with a variable
that has been initialized as a DOM element .

Please note that my knowledge cut off on Tau-Prolog is
from 2021 and this predicates could be deprecated or
changed so I recommend to check in the documentation
of the library you're using or check the version of
Tau-Prolog you're working with.

LoL

Mostowski Collapse schrieb am Mittwoch, 11. Januar 2023 um 21:45:30 UTC+1:
> I guess its time to talk about DOM APIs inside Prolog,
> and making them mature and portable. I am planning
> to adopt the Tau Prolog DOM API.
>
> But I have two DOM APIs in mind:
>
> - Stateless DOM API: Basically Tau Prolog is a stateless
> DOM API. All API calls have all the necessary parameters,
> there is nothing implicit right?
>
> - Statefull DOM API: On the other hand so far, in Dogelog
> Player, I have used a statefull DOM API. With a notion
> of cursor, you can imagine Turtle graphics, only the Turtle
>
> is not a Turtle with location and orientation, but a node
> somewhere in a DOM tree.
>
> My plan is to give the Statefull DOM API a new try, but
> bootstrapping it from the a Stateless DOM API. Eh voila
> I am already banging my head:
>
> DOM API: How get last child efficiently?
> https://github.com/tau-prolog/tau-prolog/issues/340

Re: Request for comments, Novacore the sequel to ISO modules

<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2770&group=comp.lang.prolog#2770

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7114:0:b0:3a5:50fa:1a32 with SMTP id z20-20020ac87114000000b003a550fa1a32mr3633348qto.11.1673475872881;
Wed, 11 Jan 2023 14:24:32 -0800 (PST)
X-Received: by 2002:a05:6870:4e03:b0:151:c737:4c10 with SMTP id
pl3-20020a0568704e0300b00151c7374c10mr2525404oab.257.1673475872685; Wed, 11
Jan 2023 14:24:32 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Wed, 11 Jan 2023 14:24:32 -0800 (PST)
In-Reply-To: <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 11 Jan 2023 22:24:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1485
 by: Mostowski Collapse - Wed, 11 Jan 2023 22:24 UTC

Looks like Ciao Prolog Playground totally
forgot about some library(dom)? Nada?

Is it more harder to make library(dom) for
a WASM based Prolog than a JavaScript based

Prolog? What about SWI-Prolog WASM?

Re: Request for comments, Novacore the sequel to ISO modules

<610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2773&group=comp.lang.prolog#2773

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:5f0b:b0:4c6:eced:ba49 with SMTP id lx11-20020a0562145f0b00b004c6ecedba49mr5948752qvb.102.1673603805893;
Fri, 13 Jan 2023 01:56:45 -0800 (PST)
X-Received: by 2002:a54:4712:0:b0:35e:2d5e:f627 with SMTP id
k18-20020a544712000000b0035e2d5ef627mr5492902oik.246.1673603805569; Fri, 13
Jan 2023 01:56:45 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Fri, 13 Jan 2023 01:56:45 -0800 (PST)
In-Reply-To: <969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 13 Jan 2023 09:56:45 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2156
 by: Mostowski Collapse - Fri, 13 Jan 2023 09:56 UTC

An other can of worms format/2, related to DOM generation.
The Prolog community could standardisize it voluntarily
without the need of the ISO body. Just have a common place,

where somebody puts up a kind of specification document.
Something like a format/2 Prolog Enhancement Proposals (PEP).
Why look into format/2 ? Because Tau Prolog suggests funny stuff:

add_item(Item, Count) :-
...
format(Stream, "~a (~d)", [Item, Count]),
...

Web development with Tau Prolog - Riazaa
https://biblioteca.sistedes.es/submissions/descargas/2022/PROLE/2022-PROLE-006.pdf

Mostlikely the above is not a very optimal idea, since
there are so many other issues in DOM text generation,
like XML Escape or URL Encoding. But nevertheless

worth investigating as a means for DOM text generation.

Re: Request for comments, Novacore the sequel to ISO modules

<e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2774&group=comp.lang.prolog#2774

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:9065:0:b0:531:b375:2cd5 with SMTP id o92-20020a0c9065000000b00531b3752cd5mr2638633qvo.121.1673603891291;
Fri, 13 Jan 2023 01:58:11 -0800 (PST)
X-Received: by 2002:a05:6870:3495:b0:144:3aaa:d701 with SMTP id
n21-20020a056870349500b001443aaad701mr7028002oah.68.1673603890955; Fri, 13
Jan 2023 01:58:10 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Fri, 13 Jan 2023 01:58:10 -0800 (PST)
In-Reply-To: <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com> <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 13 Jan 2023 09:58:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3196
 by: Mostowski Collapse - Fri, 13 Jan 2023 09:58 UTC

A middle ground could be to standardisized only float formatting.
So that there are some primitives that do float formatting,
and various string interpolations and portraying could be

bootstrapped from it. I find some rudimentaries here from ROK:

float_codes(Float, Codes, Format) :-
% like number_codes/2 but only for floats
http://www.cs.otago.ac.nz/staffpriv/ok/pllib.htm

So the standardisation would takle what the ‘%’ operator can
do in Python, when the left argument is a string and the right
argument is a float. But there is much to be demanded, what

if the right argument is an integer, especially a bigint and not
a smallint, a bigint that cannot be converted to float. So ROKs
take is a little outdated, since is not bigint aware.

Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:56:46 UTC+1:
> An other can of worms format/2, related to DOM generation.
> The Prolog community could standardisize it voluntarily
> without the need of the ISO body. Just have a common place,
>
> where somebody puts up a kind of specification document.
> Something like a format/2 Prolog Enhancement Proposals (PEP).
> Why look into format/2 ? Because Tau Prolog suggests funny stuff:
>
> add_item(Item, Count) :-
> ...
> format(Stream, "~a (~d)", [Item, Count]),
> ...
>
> Web development with Tau Prolog - Riazaa
> https://biblioteca.sistedes.es/submissions/descargas/2022/PROLE/2022-PROLE-006.pdf
>
> Mostlikely the above is not a very optimal idea, since
> there are so many other issues in DOM text generation,
> like XML Escape or URL Encoding. But nevertheless
>
> worth investigating as a means for DOM text generation.

Re: Request for comments, Novacore the sequel to ISO modules

<7a67de55-c689-4072-94c8-27d060d2a2c4n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2775&group=comp.lang.prolog#2775

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7114:0:b0:3a5:50fa:1a32 with SMTP id z20-20020ac87114000000b003a550fa1a32mr3885639qto.11.1673603961799;
Fri, 13 Jan 2023 01:59:21 -0800 (PST)
X-Received: by 2002:a54:4789:0:b0:35e:ad52:65b6 with SMTP id
o9-20020a544789000000b0035ead5265b6mr3745483oic.33.1673603961489; Fri, 13 Jan
2023 01:59:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Fri, 13 Jan 2023 01:59:21 -0800 (PST)
In-Reply-To: <e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com> <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
<e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7a67de55-c689-4072-94c8-27d060d2a2c4n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 13 Jan 2023 09:59:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3962
 by: Mostowski Collapse - Fri, 13 Jan 2023 09:59 UTC

SWI-Prolog is currently bigint aware:

?- format("abc ~2f def", [123123123123123123123]).
abc 123123123123123123123.00 def

?- format("abc ~2f def", [123123123123123123123.0]).
abc 123123123123123126272.00 def

Trealla Prolog doesn’t tolerate integer:

?- format("abc ~2f def", [123123123123123123123]).
error(type_error(float,123123123123123123123),format/2).

Scryer Prolog does sometimes nonsense for float:

?- format("abc ~2f def", [123123123123123123123.0]).
abc 1.23 def true.

Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:58:12 UTC+1:
> A middle ground could be to standardisized only float formatting.
> So that there are some primitives that do float formatting,
> and various string interpolations and portraying could be
>
> bootstrapped from it. I find some rudimentaries here from ROK:
>
> float_codes(Float, Codes, Format) :-
> % like number_codes/2 but only for floats
> http://www.cs.otago.ac.nz/staffpriv/ok/pllib.htm
>
> So the standardisation would takle what the ‘%’ operator can
> do in Python, when the left argument is a string and the right
> argument is a float. But there is much to be demanded, what
>
> if the right argument is an integer, especially a bigint and not
> a smallint, a bigint that cannot be converted to float. So ROKs
> take is a little outdated, since is not bigint aware.
> Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:56:46 UTC+1:
> > An other can of worms format/2, related to DOM generation.
> > The Prolog community could standardisize it voluntarily
> > without the need of the ISO body. Just have a common place,
> >
> > where somebody puts up a kind of specification document.
> > Something like a format/2 Prolog Enhancement Proposals (PEP).
> > Why look into format/2 ? Because Tau Prolog suggests funny stuff:
> >
> > add_item(Item, Count) :-
> > ...
> > format(Stream, "~a (~d)", [Item, Count]),
> > ...
> >
> > Web development with Tau Prolog - Riazaa
> > https://biblioteca.sistedes.es/submissions/descargas/2022/PROLE/2022-PROLE-006.pdf
> >
> > Mostlikely the above is not a very optimal idea, since
> > there are so many other issues in DOM text generation,
> > like XML Escape or URL Encoding. But nevertheless
> >
> > worth investigating as a means for DOM text generation.

Re: Request for comments, Novacore the sequel to ISO modules

<fef27c3b-7633-449c-a518-9eea644b573cn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2776&group=comp.lang.prolog#2776

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1b0f:b0:3a9:7719:2175 with SMTP id bb15-20020a05622a1b0f00b003a977192175mr4054676qtb.651.1673604061939;
Fri, 13 Jan 2023 02:01:01 -0800 (PST)
X-Received: by 2002:a05:6870:b006:b0:150:6fae:f651 with SMTP id
y6-20020a056870b00600b001506faef651mr5420772oae.122.1673604061655; Fri, 13
Jan 2023 02:01:01 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Fri, 13 Jan 2023 02:01:01 -0800 (PST)
In-Reply-To: <e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com> <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
<e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fef27c3b-7633-449c-a518-9eea644b573cn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 13 Jan 2023 10:01:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4113
 by: Mostowski Collapse - Fri, 13 Jan 2023 10:01 UTC

My conclusion, to reach the level of SWI-Prolog,
a number_codes with a format parameters is needed, and
not a float_codes that is restricted to floats.

With a number_codes that also accepts integers, it will go
smooth to also format integers, as SWI-Prolog does.
On my side I started defining a new built-in:

atom_number(-Atom, +Atom, +Integer, +Number)

The above built-in takes a slightly different turn, not codes
but atom is the currency for number conversion. The
input atom is ‘f’ or ‘e’, and the input integer is the requested

precision. But it is currently too stupid for bigint, working on it.

Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:58:12 UTC+1:
> A middle ground could be to standardisized only float formatting.
> So that there are some primitives that do float formatting,
> and various string interpolations and portraying could be
>
> bootstrapped from it. I find some rudimentaries here from ROK:
>
> float_codes(Float, Codes, Format) :-
> % like number_codes/2 but only for floats
> http://www.cs.otago.ac.nz/staffpriv/ok/pllib.htm
>
> So the standardisation would takle what the ‘%’ operator can
> do in Python, when the left argument is a string and the right
> argument is a float. But there is much to be demanded, what
>
> if the right argument is an integer, especially a bigint and not
> a smallint, a bigint that cannot be converted to float. So ROKs
> take is a little outdated, since is not bigint aware.
> Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:56:46 UTC+1:
> > An other can of worms format/2, related to DOM generation.
> > The Prolog community could standardisize it voluntarily
> > without the need of the ISO body. Just have a common place,
> >
> > where somebody puts up a kind of specification document.
> > Something like a format/2 Prolog Enhancement Proposals (PEP).
> > Why look into format/2 ? Because Tau Prolog suggests funny stuff:
> >
> > add_item(Item, Count) :-
> > ...
> > format(Stream, "~a (~d)", [Item, Count]),
> > ...
> >
> > Web development with Tau Prolog - Riazaa
> > https://biblioteca.sistedes.es/submissions/descargas/2022/PROLE/2022-PROLE-006.pdf
> >
> > Mostlikely the above is not a very optimal idea, since
> > there are so many other issues in DOM text generation,
> > like XML Escape or URL Encoding. But nevertheless
> >
> > worth investigating as a means for DOM text generation.

Re: Request for comments, Novacore the sequel to ISO modules

<40172868-986f-4ea8-9542-2ea883a2d953n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2777&group=comp.lang.prolog#2777

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:1aa3:b0:706:1b9c:854c with SMTP id bl35-20020a05620a1aa300b007061b9c854cmr100177qkb.55.1673614167310;
Fri, 13 Jan 2023 04:49:27 -0800 (PST)
X-Received: by 2002:a05:6870:d0ca:b0:15e:db89:4614 with SMTP id
k10-20020a056870d0ca00b0015edb894614mr299170oaa.4.1673614166873; Fri, 13 Jan
2023 04:49:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Fri, 13 Jan 2023 04:49:26 -0800 (PST)
In-Reply-To: <fef27c3b-7633-449c-a518-9eea644b573cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com> <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
<e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com> <fef27c3b-7633-449c-a518-9eea644b573cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <40172868-986f-4ea8-9542-2ea883a2d953n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 13 Jan 2023 12:49:27 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4779
 by: Mostowski Collapse - Fri, 13 Jan 2023 12:49 UTC

PEPs are probably anyway a dead end. Best would be if Prolog
systems were designed around a Novacore. So atom_number/4
would probably fit into a **Novacore**, but format/[2,3] not.

format/[2,3] would have a pure Prolog implementation, that
can be shared across Prolog systems. Same for locales, a pure
Prolog implementation, or some Semantic Net from ChatGPT.

LoL

Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 11:01:03 UTC+1:
> My conclusion, to reach the level of SWI-Prolog,
> a number_codes with a format parameters is needed, and
> not a float_codes that is restricted to floats.
>
> With a number_codes that also accepts integers, it will go
> smooth to also format integers, as SWI-Prolog does.
> On my side I started defining a new built-in:
>
> atom_number(-Atom, +Atom, +Integer, +Number)
>
> The above built-in takes a slightly different turn, not codes
> but atom is the currency for number conversion. The
> input atom is ‘f’ or ‘e’, and the input integer is the requested
>
> precision. But it is currently too stupid for bigint, working on it.
> Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:58:12 UTC+1:
> > A middle ground could be to standardisized only float formatting.
> > So that there are some primitives that do float formatting,
> > and various string interpolations and portraying could be
> >
> > bootstrapped from it. I find some rudimentaries here from ROK:
> >
> > float_codes(Float, Codes, Format) :-
> > % like number_codes/2 but only for floats
> > http://www.cs.otago.ac.nz/staffpriv/ok/pllib.htm
> >
> > So the standardisation would takle what the ‘%’ operator can
> > do in Python, when the left argument is a string and the right
> > argument is a float. But there is much to be demanded, what
> >
> > if the right argument is an integer, especially a bigint and not
> > a smallint, a bigint that cannot be converted to float. So ROKs
> > take is a little outdated, since is not bigint aware.
> > Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:56:46 UTC+1:
> > > An other can of worms format/2, related to DOM generation.
> > > The Prolog community could standardisize it voluntarily
> > > without the need of the ISO body. Just have a common place,
> > >
> > > where somebody puts up a kind of specification document.
> > > Something like a format/2 Prolog Enhancement Proposals (PEP).
> > > Why look into format/2 ? Because Tau Prolog suggests funny stuff:
> > >
> > > add_item(Item, Count) :-
> > > ...
> > > format(Stream, "~a (~d)", [Item, Count]),
> > > ...
> > >
> > > Web development with Tau Prolog - Riazaa
> > > https://biblioteca.sistedes.es/submissions/descargas/2022/PROLE/2022-PROLE-006.pdf
> > >
> > > Mostlikely the above is not a very optimal idea, since
> > > there are so many other issues in DOM text generation,
> > > like XML Escape or URL Encoding. But nevertheless
> > >
> > > worth investigating as a means for DOM text generation.

Re: Request for comments, Novacore the sequel to ISO modules

<dfa4c273-615a-45cb-b6d2-fdcbb2fbfae3n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2781&group=comp.lang.prolog#2781

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2b42:b0:706:5745:924f with SMTP id dp2-20020a05620a2b4200b007065745924fmr19227qkb.214.1673910189145;
Mon, 16 Jan 2023 15:03:09 -0800 (PST)
X-Received: by 2002:a05:6870:b520:b0:15f:2440:e0fe with SMTP id
v32-20020a056870b52000b0015f2440e0femr84863oap.196.1673910188826; Mon, 16 Jan
2023 15:03:08 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Mon, 16 Jan 2023 15:03:08 -0800 (PST)
In-Reply-To: <40172868-986f-4ea8-9542-2ea883a2d953n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com> <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
<e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com> <fef27c3b-7633-449c-a518-9eea644b573cn@googlegroups.com>
<40172868-986f-4ea8-9542-2ea883a2d953n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dfa4c273-615a-45cb-b6d2-fdcbb2fbfae3n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 16 Jan 2023 23:03:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6270
 by: Mostowski Collapse - Mon, 16 Jan 2023 23:03 UTC

Thats a defect of Markus Triskas library(format).
The defect is found in Scryer Prolog:

?- format("foo ~w bar ~w baz", [p(A,B),q(B,C)]), nl.
foo p(A,B) bar q(B,C) baz

?- format("foo ~w bar", [p(A,B)]), format(" ~w baz", [q(B,C)]), nl.
foo p(A,B) bar q(A,B) baz

One should be able to chop up format/[2,3]. Other
Prolog systems are able to do that. Either with small
variable gensym or with large variable gensym:

/* Trealla, Jekejeke etc.. --> small variable gensym */
?- format('foo ~w bar ~w baz', [p(A,B),q(B,C)]), nl.
foo p(_0, _1) bar q(_1, _2) baz

?- format('foo ~w bar', [p(A,B)]), format(' ~w baz', [q(B,C)]), nl.
foo p(_0, _1) bar q(_1, _2) baz

/* SWI-Prolog, Dogelog etc.. --> large variable gensym */
?- format('foo ~w bar ~w baz', [p(A,B),q(B,C)]), nl.
foo p(_23041, _23042) bar q(_23042, _23043) baz

?- format('foo ~w bar', [p(A,B)]), format(' ~w baz', [q(B,C)]), nl.
foo p(_25699, _25700) bar q(_25700, _25701) baz

I don't know whether Trealla and Jekejeke use the
same gensym strategy, but phenotype is similar.
Same for the genotype of SWI-Prolog and Dogelog,

mostlikely not the same realization under the hood,
but similar outcome again.

Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 13:49:28 UTC+1:
> PEPs are probably anyway a dead end. Best would be if Prolog
> systems were designed around a Novacore. So atom_number/4
> would probably fit into a **Novacore**, but format/[2,3] not.
>
> format/[2,3] would have a pure Prolog implementation, that
> can be shared across Prolog systems. Same for locales, a pure
> Prolog implementation, or some Semantic Net from ChatGPT.
>
> LoL
> Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 11:01:03 UTC+1:
> > My conclusion, to reach the level of SWI-Prolog,
> > a number_codes with a format parameters is needed, and
> > not a float_codes that is restricted to floats.
> >
> > With a number_codes that also accepts integers, it will go
> > smooth to also format integers, as SWI-Prolog does.
> > On my side I started defining a new built-in:
> >
> > atom_number(-Atom, +Atom, +Integer, +Number)
> >
> > The above built-in takes a slightly different turn, not codes
> > but atom is the currency for number conversion. The
> > input atom is ‘f’ or ‘e’, and the input integer is the requested
> >
> > precision. But it is currently too stupid for bigint, working on it.
> > Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:58:12 UTC+1:
> > > A middle ground could be to standardisized only float formatting.
> > > So that there are some primitives that do float formatting,
> > > and various string interpolations and portraying could be
> > >
> > > bootstrapped from it. I find some rudimentaries here from ROK:
> > >
> > > float_codes(Float, Codes, Format) :-
> > > % like number_codes/2 but only for floats
> > > http://www.cs.otago.ac.nz/staffpriv/ok/pllib.htm
> > >
> > > So the standardisation would takle what the ‘%’ operator can
> > > do in Python, when the left argument is a string and the right
> > > argument is a float. But there is much to be demanded, what
> > >
> > > if the right argument is an integer, especially a bigint and not
> > > a smallint, a bigint that cannot be converted to float. So ROKs
> > > take is a little outdated, since is not bigint aware.
> > > Mostowski Collapse schrieb am Freitag, 13. Januar 2023 um 10:56:46 UTC+1:
> > > > An other can of worms format/2, related to DOM generation.
> > > > The Prolog community could standardisize it voluntarily
> > > > without the need of the ISO body. Just have a common place,
> > > >
> > > > where somebody puts up a kind of specification document.
> > > > Something like a format/2 Prolog Enhancement Proposals (PEP).
> > > > Why look into format/2 ? Because Tau Prolog suggests funny stuff:
> > > >
> > > > add_item(Item, Count) :-
> > > > ...
> > > > format(Stream, "~a (~d)", [Item, Count]),
> > > > ...
> > > >
> > > > Web development with Tau Prolog - Riazaa
> > > > https://biblioteca.sistedes.es/submissions/descargas/2022/PROLE/2022-PROLE-006.pdf
> > > >
> > > > Mostlikely the above is not a very optimal idea, since
> > > > there are so many other issues in DOM text generation,
> > > > like XML Escape or URL Encoding. But nevertheless
> > > >
> > > > worth investigating as a means for DOM text generation.

Re: Request for comments, Novacore the sequel to ISO modules

<6e56e583-c6b3-4ba9-b795-55e72b41733fn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2782&group=comp.lang.prolog#2782

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:1278:b0:705:74fe:b39a with SMTP id b24-20020a05620a127800b0070574feb39amr25870qkl.616.1673910425331;
Mon, 16 Jan 2023 15:07:05 -0800 (PST)
X-Received: by 2002:a4a:d501:0:b0:4f2:390f:c9bc with SMTP id
m1-20020a4ad501000000b004f2390fc9bcmr47981oos.80.1673910424934; Mon, 16 Jan
2023 15:07:04 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Mon, 16 Jan 2023 15:07:04 -0800 (PST)
In-Reply-To: <dfa4c273-615a-45cb-b6d2-fdcbb2fbfae3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com> <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
<e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com> <fef27c3b-7633-449c-a518-9eea644b573cn@googlegroups.com>
<40172868-986f-4ea8-9542-2ea883a2d953n@googlegroups.com> <dfa4c273-615a-45cb-b6d2-fdcbb2fbfae3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6e56e583-c6b3-4ba9-b795-55e72b41733fn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 16 Jan 2023 23:07:05 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3210
 by: Mostowski Collapse - Mon, 16 Jan 2023 23:07 UTC

It seems that Tau Prolog has a hickup somewhere:

?- format("foo ~w bar ~w baz", [p(A,B),q(B,C)]), nl.
uncaught exception: error(instantiation_error,fabricate_var_name/3)

https://github.com/tau-prolog/tau-prolog/issues/342

Mostowski Collapse schrieb am Dienstag, 17. Januar 2023 um 00:03:10 UTC+1:
> Thats a defect of Markus Triskas library(format).
> The defect is found in Scryer Prolog:
>
> ?- format("foo ~w bar ~w baz", [p(A,B),q(B,C)]), nl.
> foo p(A,B) bar q(B,C) baz
>
> ?- format("foo ~w bar", [p(A,B)]), format(" ~w baz", [q(B,C)]), nl.
> foo p(A,B) bar q(A,B) baz
>
> One should be able to chop up format/[2,3]. Other
> Prolog systems are able to do that. Either with small
> variable gensym or with large variable gensym:
>
> /* Trealla, Jekejeke etc.. --> small variable gensym */
> ?- format('foo ~w bar ~w baz', [p(A,B),q(B,C)]), nl.
> foo p(_0, _1) bar q(_1, _2) baz
>
> ?- format('foo ~w bar', [p(A,B)]), format(' ~w baz', [q(B,C)]), nl.
> foo p(_0, _1) bar q(_1, _2) baz
>
> /* SWI-Prolog, Dogelog etc.. --> large variable gensym */
> ?- format('foo ~w bar ~w baz', [p(A,B),q(B,C)]), nl.
> foo p(_23041, _23042) bar q(_23042, _23043) baz
>
> ?- format('foo ~w bar', [p(A,B)]), format(' ~w baz', [q(B,C)]), nl.
> foo p(_25699, _25700) bar q(_25700, _25701) baz
>
> I don't know whether Trealla and Jekejeke use the
> same gensym strategy, but phenotype is similar.
> Same for the genotype of SWI-Prolog and Dogelog,
>
> mostlikely not the same realization under the hood,
> but similar outcome again.

Re: Request for comments, Novacore the sequel to ISO modules

<4ee4536f-fd89-4f12-8f59-3692a68813c5n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2783&group=comp.lang.prolog#2783

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:260b:b0:706:86d0:c745 with SMTP id z11-20020a05620a260b00b0070686d0c745mr63572qko.114.1673945364598;
Tue, 17 Jan 2023 00:49:24 -0800 (PST)
X-Received: by 2002:a05:6870:2f0f:b0:15f:28b0:4436 with SMTP id
qj15-20020a0568702f0f00b0015f28b04436mr234791oab.257.1673945364320; Tue, 17
Jan 2023 00:49:24 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Tue, 17 Jan 2023 00:49:24 -0800 (PST)
In-Reply-To: <6e56e583-c6b3-4ba9-b795-55e72b41733fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com> <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
<e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com> <fef27c3b-7633-449c-a518-9eea644b573cn@googlegroups.com>
<40172868-986f-4ea8-9542-2ea883a2d953n@googlegroups.com> <dfa4c273-615a-45cb-b6d2-fdcbb2fbfae3n@googlegroups.com>
<6e56e583-c6b3-4ba9-b795-55e72b41733fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4ee4536f-fd89-4f12-8f59-3692a68813c5n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 17 Jan 2023 08:49:24 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4058
 by: Mostowski Collapse - Tue, 17 Jan 2023 08:49 UTC

Interesting find, hooking into Java printf gives:

?- catch(printf('abc %s def', []), error(E,_), true).
Error: Unknown template: representation_error('Format specifier ''%s''')
/* java.util.MissingFormatArgumentException extends IllegalFormatException */
?- catch(printf('abc %s def', [p,q]), error(E,_), true).
abc p def

So too many arguments are tolerated. On the other
hand SWI-Prolog does check too many arguments:

?- catch(format('abc ~w def', []), error(E,_), true).
E = format('not enough arguments').

?- catch(format('abc ~w def', [p,q]), error(E,_), true).
E = format('too many arguments').

Oki Doki

Mostowski Collapse schrieb am Dienstag, 17. Januar 2023 um 00:07:06 UTC+1:
> It seems that Tau Prolog has a hickup somewhere:
> ?- format("foo ~w bar ~w baz", [p(A,B),q(B,C)]), nl.
> uncaught exception: error(instantiation_error,fabricate_var_name/3)
>
> https://github.com/tau-prolog/tau-prolog/issues/342
> Mostowski Collapse schrieb am Dienstag, 17. Januar 2023 um 00:03:10 UTC+1:
> > Thats a defect of Markus Triskas library(format).
> > The defect is found in Scryer Prolog:
> >
> > ?- format("foo ~w bar ~w baz", [p(A,B),q(B,C)]), nl.
> > foo p(A,B) bar q(B,C) baz
> >
> > ?- format("foo ~w bar", [p(A,B)]), format(" ~w baz", [q(B,C)]), nl.
> > foo p(A,B) bar q(A,B) baz
> >
> > One should be able to chop up format/[2,3]. Other
> > Prolog systems are able to do that. Either with small
> > variable gensym or with large variable gensym:
> >
> > /* Trealla, Jekejeke etc.. --> small variable gensym */
> > ?- format('foo ~w bar ~w baz', [p(A,B),q(B,C)]), nl.
> > foo p(_0, _1) bar q(_1, _2) baz
> >
> > ?- format('foo ~w bar', [p(A,B)]), format(' ~w baz', [q(B,C)]), nl.
> > foo p(_0, _1) bar q(_1, _2) baz
> >
> > /* SWI-Prolog, Dogelog etc.. --> large variable gensym */
> > ?- format('foo ~w bar ~w baz', [p(A,B),q(B,C)]), nl.
> > foo p(_23041, _23042) bar q(_23042, _23043) baz
> >
> > ?- format('foo ~w bar', [p(A,B)]), format(' ~w baz', [q(B,C)]), nl.
> > foo p(_25699, _25700) bar q(_25700, _25701) baz
> >
> > I don't know whether Trealla and Jekejeke use the
> > same gensym strategy, but phenotype is similar.
> > Same for the genotype of SWI-Prolog and Dogelog,
> >
> > mostlikely not the same realization under the hood,
> > but similar outcome again.

Re: Request for comments, Novacore the sequel to ISO modules

<d9517520-e3c4-4827-8b6d-68b2cd1cd8a3n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2784&group=comp.lang.prolog#2784

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:1203:b0:6ff:7cbe:36df with SMTP id u3-20020a05620a120300b006ff7cbe36dfmr165300qkj.659.1673954576177;
Tue, 17 Jan 2023 03:22:56 -0800 (PST)
X-Received: by 2002:a05:6870:cb93:b0:155:ca1b:3eb1 with SMTP id
ov19-20020a056870cb9300b00155ca1b3eb1mr193641oab.136.1673954575870; Tue, 17
Jan 2023 03:22:55 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Tue, 17 Jan 2023 03:22:55 -0800 (PST)
In-Reply-To: <4ee4536f-fd89-4f12-8f59-3692a68813c5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<9696a178-bb42-4c35-a9ce-7337a36f5f00n@googlegroups.com> <ca73fba3-ca22-4ee5-b173-0c28e67f7632n@googlegroups.com>
<969b364e-1447-467b-91cd-880a9cc965f4n@googlegroups.com> <610f1d5f-8525-4b24-8a5b-0dcf58289ca4n@googlegroups.com>
<e30dd165-2d32-4e20-9efb-a012675b6055n@googlegroups.com> <fef27c3b-7633-449c-a518-9eea644b573cn@googlegroups.com>
<40172868-986f-4ea8-9542-2ea883a2d953n@googlegroups.com> <dfa4c273-615a-45cb-b6d2-fdcbb2fbfae3n@googlegroups.com>
<6e56e583-c6b3-4ba9-b795-55e72b41733fn@googlegroups.com> <4ee4536f-fd89-4f12-8f59-3692a68813c5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d9517520-e3c4-4827-8b6d-68b2cd1cd8a3n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 17 Jan 2023 11:22:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5374
 by: Mostowski Collapse - Tue, 17 Jan 2023 11:22 UTC

Interesting find, Ciao Prologs does sometimes boxing:

/* Ciao Prolog 1.22.0 */
?- format('abc ~w def', [p]). %%% no-boxing exception [_]
abc p def

?- format('abc ~w def', p).
abc p def

I guess this makes the format/2 predicate a little brittle,
when used to print lists. One cannot distinguish [p] and
p in the output, not sure whether is a tolerable flaw?

It is tolerable in as far as there exists a work around. The
work around is to avoid boxing when there is only
one item to print:

?- format('abc ~w def', [[p]]).
abc [p] def

?- format('abc ~w def', [p]).
abc p def

So when you are Pavlov’s dog and have learned to use
and enjoy Ciao Prologs feature, because of some positive
feedback where it works, you have to unlearn this feature

nevertheless, which needs the administration of electric
shocks to the programmer.

Mostowski Collapse schrieb am Dienstag, 17. Januar 2023 um 09:49:25 UTC+1:
> Interesting find, hooking into Java printf gives:
>
> ?- catch(printf('abc %s def', []), error(E,_), true).
> Error: Unknown template: representation_error('Format specifier ''%s''')
> /* java.util.MissingFormatArgumentException extends IllegalFormatException */
> ?- catch(printf('abc %s def', [p,q]), error(E,_), true).
> abc p def
>
> So too many arguments are tolerated. On the other
> hand SWI-Prolog does check too many arguments:
>
> ?- catch(format('abc ~w def', []), error(E,_), true).
> E = format('not enough arguments').
>
> ?- catch(format('abc ~w def', [p,q]), error(E,_), true).
> E = format('too many arguments').
>
> Oki Doki
> Mostowski Collapse schrieb am Dienstag, 17. Januar 2023 um 00:07:06 UTC+1:
> > It seems that Tau Prolog has a hickup somewhere:
> > ?- format("foo ~w bar ~w baz", [p(A,B),q(B,C)]), nl.
> > uncaught exception: error(instantiation_error,fabricate_var_name/3)
> >
> > https://github.com/tau-prolog/tau-prolog/issues/342
> > Mostowski Collapse schrieb am Dienstag, 17. Januar 2023 um 00:03:10 UTC+1:
> > > Thats a defect of Markus Triskas library(format).
> > > The defect is found in Scryer Prolog:
> > >
> > > ?- format("foo ~w bar ~w baz", [p(A,B),q(B,C)]), nl.
> > > foo p(A,B) bar q(B,C) baz
> > >
> > > ?- format("foo ~w bar", [p(A,B)]), format(" ~w baz", [q(B,C)]), nl.
> > > foo p(A,B) bar q(A,B) baz
> > >
> > > One should be able to chop up format/[2,3]. Other
> > > Prolog systems are able to do that. Either with small
> > > variable gensym or with large variable gensym:
> > >
> > > /* Trealla, Jekejeke etc.. --> small variable gensym */
> > > ?- format('foo ~w bar ~w baz', [p(A,B),q(B,C)]), nl.
> > > foo p(_0, _1) bar q(_1, _2) baz
> > >
> > > ?- format('foo ~w bar', [p(A,B)]), format(' ~w baz', [q(B,C)]), nl.
> > > foo p(_0, _1) bar q(_1, _2) baz
> > >
> > > /* SWI-Prolog, Dogelog etc.. --> large variable gensym */
> > > ?- format('foo ~w bar ~w baz', [p(A,B),q(B,C)]), nl.
> > > foo p(_23041, _23042) bar q(_23042, _23043) baz
> > >
> > > ?- format('foo ~w bar', [p(A,B)]), format(' ~w baz', [q(B,C)]), nl.
> > > foo p(_25699, _25700) bar q(_25700, _25701) baz
> > >
> > > I don't know whether Trealla and Jekejeke use the
> > > same gensym strategy, but phenotype is similar.
> > > Same for the genotype of SWI-Prolog and Dogelog,
> > >
> > > mostlikely not the same realization under the hood,
> > > but similar outcome again.

Re: Request for comments, Novacore the sequel to ISO modules

<ff5d9b5c-dea5-4834-8213-abf174ef3ebbn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2968&group=comp.lang.prolog#2968

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:8e7:b0:66d:86be:254f with SMTP id dr7-20020a05621408e700b0066d86be254fmr115768qvb.7.1700420069741;
Sun, 19 Nov 2023 10:54:29 -0800 (PST)
X-Received: by 2002:a17:903:11c7:b0:1cc:3de5:d8a0 with SMTP id
q7-20020a17090311c700b001cc3de5d8a0mr1756738plh.11.1700420069491; Sun, 19 Nov
2023 10:54:29 -0800 (PST)
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, 19 Nov 2023 10:54:28 -0800 (PST)
In-Reply-To: <db8a6771-3e54-485b-b391-310658dd6f52n@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: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ff5d9b5c-dea5-4834-8213-abf174ef3ebbn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Sun, 19 Nov 2023 18:54:29 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1751
 by: Mild Shock - Sun, 19 Nov 2023 18:54 UTC

We are now exploring file systems with novacore.
And here and then we have a couple of primitives
and then do some bootstrapping. It currently lands

in library(random) until we find a better place:

% directory_member(+Atom, -Atom)
directory_member(F, N) :-
directory_files(F, L),
member(N, L).

% ensure_directory(+Atom)
ensure_directory(F) :-
file_exists(F),
file_property(F, type(directory)),
!.
ensure_directory(F) :-
make_directory(F).

Guess what, finding semantic and support of
directory_files/2, file_exists/1 and file_property/2
is already non trivial.

Re: Request for comments, Novacore the sequel to ISO modules

<ujdlp0$1ndl7$1@solani.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2969&group=comp.lang.prolog#2969

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.prolog
Subject: Re: Request for comments, Novacore the sequel to ISO modules
Date: Sun, 19 Nov 2023 19:56:32 +0100
Message-ID: <ujdlp0$1ndl7$1@solani.org>
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<d9588b9c-edcc-4f8b-85d2-7487b5556798n@googlegroups.com>
<07e4e441-f981-4034-998b-c665ee434501n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Nov 2023 18:56:32 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1816231"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
Cancel-Lock: sha1:wN0OMZbZdIjYcPIHubNNEH3tIf8=
X-User-ID: eJwNyscBwDAIBLCVOJrNOJiy/wiJ3jJxeB11c7W13cTtxShCbSx4kIdmhe9oNaE3/yBvLr+gSuYOvKgjWgT7AGjVFek=
In-Reply-To: <07e4e441-f981-4034-998b-c665ee434501n@googlegroups.com>
 by: Mild Shock - Sun, 19 Nov 2023 18:56 UTC

We are now exploring file systems with novacore.
And here and then we have a couple of primitives
and then do some bootstrapping. It currently lands

in library(random) until we find a better place:

% directory_member(+Atom, -Atom)
directory_member(F, N) :-
directory_files(F, L),
member(N, L).

% ensure_directory(+Atom)
ensure_directory(F) :-
file_exists(F),
file_property(F, type(directory)),
!.
ensure_directory(F) :-
make_directory(F).

Guess what, finding semantic and support of
directory_files/2, file_exists/1 and file_property/2
is already non trivial.

Re: Request for comments, Novacore the sequel to ISO modules

<ujdltr$1ndl7$2@solani.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2970&group=comp.lang.prolog#2970

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.prolog
Subject: Re: Request for comments, Novacore the sequel to ISO modules
Date: Sun, 19 Nov 2023 19:59:07 +0100
Message-ID: <ujdltr$1ndl7$2@solani.org>
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<d9588b9c-edcc-4f8b-85d2-7487b5556798n@googlegroups.com>
<07e4e441-f981-4034-998b-c665ee434501n@googlegroups.com>
<ujdlp0$1ndl7$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 19 Nov 2023 18:59:07 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1816231"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
Cancel-Lock: sha1:TPZ6y6r+tOxWdWqc4zn7Wjj5fKQ=
X-User-ID: eJwNi8ERwDAIw2ZyCnYyDpCw/wjl9NNJ/hEsGZ3mPVSrcT6vsxbgD9LLSI/alWBfTnUxW7wcfTtgy0TtgukHZLsV7w==
In-Reply-To: <ujdlp0$1ndl7$1@solani.org>
 by: Mild Shock - Sun, 19 Nov 2023 18:59 UTC

LogNonsenseTalk with its brainwash is totally
useless. This here is already wrong:

file_exists(File) :-
absolute_file_name(File, ExpandedPath),
{exists_file(ExpandedPath)}.

https://github.com/LogtalkDotOrg/logtalk3/blob/master/library/os/os.lgt

Becaue for example exists_file/1 in SWI-Prolog
means exists regular file. But file_exists/1

should mean exists file of any type. Just
lookup what GNU Prolog provides. In OS lingua

file means often regular, directory, etc..

Mild Shock schrieb:
> We are now exploring file systems with novacore.
> And here and then we have a couple of primitives
> and then do some bootstrapping. It currently lands
>
> in library(random) until we find a better place:
>
> % directory_member(+Atom, -Atom)
> directory_member(F, N) :-
>    directory_files(F, L),
>    member(N, L).
>
> % ensure_directory(+Atom)
> ensure_directory(F) :-
>    file_exists(F),
>    file_property(F, type(directory)),
>    !.
> ensure_directory(F) :-
>    make_directory(F).
>
> Guess what, finding semantic and support of
> directory_files/2, file_exists/1 and file_property/2
> is already non trivial.
>

Re: Request for comments, Novacore the sequel to ISO modules

<ujdm2s$1ndl7$3@solani.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2971&group=comp.lang.prolog#2971

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.prolog
Subject: Re: Request for comments, Novacore the sequel to ISO modules
Date: Sun, 19 Nov 2023 20:01:48 +0100
Message-ID: <ujdm2s$1ndl7$3@solani.org>
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<d9588b9c-edcc-4f8b-85d2-7487b5556798n@googlegroups.com>
<07e4e441-f981-4034-998b-c665ee434501n@googlegroups.com>
<ujdlp0$1ndl7$1@solani.org> <ujdltr$1ndl7$2@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 19 Nov 2023 19:01:48 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1816231"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
Cancel-Lock: sha1:xEq4TXTq6dIohoKT4zXT+RHwvcs=
X-User-ID: eJwNx8EBwCAIA8CVQEiEcVRg/xHa+x2MyredoGMwAolYqZ1ZXvbMZefku3rChIxZnHu61K2JPwVmL3G1q90fMNQU3w==
In-Reply-To: <ujdltr$1ndl7$2@solani.org>
 by: Mild Shock - Sun, 19 Nov 2023 19:01 UTC

You see the OS jargon meaning in directory_member/2
which is bootstrapped from directory_files/2.

directory_files/2 should of course list any files
inside the directory, regular, directory, etc..

not only regular files. So "files" means any
file of type regular, directory, etc..

Mild Shock schrieb:
>
> LogNonsenseTalk with its brainwash is totally
> useless. This here is already wrong:
>
> file_exists(File) :-
>     absolute_file_name(File, ExpandedPath),
>     {exists_file(ExpandedPath)}.
>
> https://github.com/LogtalkDotOrg/logtalk3/blob/master/library/os/os.lgt
>
> Becaue for example exists_file/1 in SWI-Prolog
> means exists regular file. But file_exists/1
>
> should mean exists file of any type. Just
> lookup what GNU Prolog provides. In OS lingua
>
> file means often regular, directory, etc..
>
> Mild Shock schrieb:
>> We are now exploring file systems with novacore.
>> And here and then we have a couple of primitives
>> and then do some bootstrapping. It currently lands
>>
>> in library(random) until we find a better place:
>>
>> % directory_member(+Atom, -Atom)
>> directory_member(F, N) :-
>>     directory_files(F, L),
>>     member(N, L).
>>
>> % ensure_directory(+Atom)
>> ensure_directory(F) :-
>>     file_exists(F),
>>     file_property(F, type(directory)),
>>     !.
>> ensure_directory(F) :-
>>     make_directory(F).
>>
>> Guess what, finding semantic and support of
>> directory_files/2, file_exists/1 and file_property/2
>> is already non trivial.
>>
>

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor