Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

All the simple programs have been written.


devel / comp.lang.prolog / Re: Request for comments, async ISO core standard I/O

SubjectAuthor
* Request for comments, async ISO core standard I/OMostowski Collapse
+* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|`* Re: Request for comments, async ISO core standard I/OMostowski Collapse
| `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|  `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|   `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|    `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     +* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     |+* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     ||`- Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     |+* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     ||`* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     || `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     ||  `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     ||   `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     ||    `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     ||     `- Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     |`* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     | `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     |  `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     |   `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     |    `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     |     `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     |      `- Re: Request for comments, async ISO core standard I/OMostowski Collapse
|     `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|      `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       +* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       |`* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       | `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       |  `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       |   `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       |    `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       |     `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       |      `- Re: Request for comments, async ISO core standard I/OMostowski Collapse
|       `* Re: Request for comments, async ISO core standard I/OMostowski Collapse
|        `- Re: Request for comments, async ISO core standard I/OMostowski Collapse
+* Re: Request for comments, async ISO core standard I/OMild Shock
|`- Re: Request for comments, async ISO core standard I/OMild Shock
+- Re: Request for comments, async ISO core standard I/OMild Shock
`* Re: Request for comments, async ISO core standard I/OMild Shock
 `* Re: Request for comments, async ISO core standard I/OMild Shock
  `* Re: Request for comments, async ISO core standard I/OMild Shock
   `- Re: Request for comments, async ISO core standard I/OMild Shock

Pages:12
Re: Request for comments, async ISO core standard I/O

<30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:14cd:b0:344:6cfa:42f9 with SMTP id u13-20020a05622a14cd00b003446cfa42f9mr23434853qtx.147.1661346649168;
Wed, 24 Aug 2022 06:10:49 -0700 (PDT)
X-Received: by 2002:a25:7750:0:b0:692:fb4a:50e3 with SMTP id
s77-20020a257750000000b00692fb4a50e3mr28736328ybc.431.1661346648724; Wed, 24
Aug 2022 06:10:48 -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, 24 Aug 2022 06:10:48 -0700 (PDT)
In-Reply-To: <de49e8f1-1409-40b2-b60b-94aab4492e72n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 24 Aug 2022 13:10:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3879
 by: Mostowski Collapse - Wed, 24 Aug 2022 13:10 UTC

If you would like to be TPTP compatible (versus v8.1.0.0),
you would need to ban this:

$ target/release/scryer-prolog -v
"v0.9.0-181-g8e9302ea"
$ target/release/scryer-prolog
?- X = hörgerät.
X = hörgerät.

So Scryer Prolog is now somewhere between TPTP
and a Prolog Unicode, neither fish nor fowl,
I cannot parse this, doesn't work in Scryer Prolog:

$ cat text.pl
text("«The Logos of Cybele is the idea that the Great Mother creates\n\
and kills everything. It is not eternity (Apollo) or the circle\n\
(Dionysus), but something that acts in her way with blind\n\
and absolute power. A form of progress: bottom-up growth.\n\
We are experiencing the final attack of Cybele, of the Great Risen\n\
Mother, with feminism, artificial intelligence, globalization,\n\
democracy, liberalism, and so on»").

I get this error:

$ target/release/scryer-prolog
?- ['text.pl'].
error(syntax_error(missing_quote),read_term/3:0).
false.

Works fine in SWI-Prolog:

?- text(X), write(X), nl, fail; true.
«The Logos of Cybele is the idea that the Great Mother creates
and kills everything. It is not eternity (Apollo) or the circle
(Dionysus), but something that acts in her way with blind
and absolute power. A form of progress: bottom-up growth.
We are experiencing the final attack of Cybele, of the Great Risen
Mother, with feminism, artificial intelligence, globalization,
democracy, liberalism, and so on»
true.

Mostowski Collapse schrieb am Mittwoch, 24. August 2022 um 15:08:40 UTC+2:
> Mostowski Collapse schrieb am Donnerstag, 11. August 2022 um 17:27:36 UTC+2:
> > Thats just your humanly ape brain acceptance curve:
> > - Resistance
> > - Denial
> > - Exploration
> > - Commitment
> If you are a slow thinker, you pass these quadrants slowly,
> maybe you never reach the end. Here is an example of a
> slow thinker, Ulrich Neumerkel, concerning Unicode:
>
> bla bla bla TPTP and bla bla bla WG21/N3146
> https://www.tptp.org/TPTP/SyntaxBNF.html#lower_alpha
> https://github.com/mthom/scryer-prolog/issues/1515#issuecomment-1225242783
> https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3146.html
>
> LoL

Re: Request for comments, async ISO core standard I/O

<166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:a88a:0:b0:474:7f16:f272 with SMTP id x10-20020a0ca88a000000b004747f16f272mr24097162qva.4.1661348294705;
Wed, 24 Aug 2022 06:38:14 -0700 (PDT)
X-Received: by 2002:a81:6f87:0:b0:33d:a780:e08a with SMTP id
k129-20020a816f87000000b0033da780e08amr2228922ywc.38.1661348294380; Wed, 24
Aug 2022 06:38: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, 24 Aug 2022 06:38:14 -0700 (PDT)
In-Reply-To: <30228514-d7f4-457f-9ed9-6b8b16617718n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 24 Aug 2022 13:38:14 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2111
 by: Mostowski Collapse - Wed, 24 Aug 2022 13:38 UTC

Holy Cow, Logtalk is the converse of Ciao Prolog.
Its kind of the inverted image of the library(lists)
of Ciao Prolog. What Logtalk has:

subtract([], _, []).
subtract([Head| Tail], List, Rest) :-
( memberchk(Head, List) ->
subtract(Tail, List, Rest)
; Rest = [Head| Tail2],
subtract(Tail, List, Tail2)
).

is not in Ciao Prolog. And vice versa, like
union/3, interaction/3, etc.. is missing from lists.
So if Ciao Prolog would load Logtalk it

would have everything?

Re: Request for comments, async ISO core standard I/O

<bcdd135e-3149-4a3e-8235-d2c0b283a7b0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5f47:0:b0:344:9fa7:18b5 with SMTP id y7-20020ac85f47000000b003449fa718b5mr366176qta.627.1661364074679;
Wed, 24 Aug 2022 11:01:14 -0700 (PDT)
X-Received: by 2002:a25:8744:0:b0:695:a01b:f0fd with SMTP id
e4-20020a258744000000b00695a01bf0fdmr279000ybn.570.1661364074434; Wed, 24 Aug
2022 11:01:14 -0700 (PDT)
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, 24 Aug 2022 11:01:14 -0700 (PDT)
In-Reply-To: <30228514-d7f4-457f-9ed9-6b8b16617718n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bcdd135e-3149-4a3e-8235-d2c0b283a7b0n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 24 Aug 2022 18:01:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4973
 by: Mostowski Collapse - Wed, 24 Aug 2022 18:01 UTC

Slow thinking can lead to constant pain. Like here:

And, indeed, in the case of an atom the escaping is not necessary:
?- write('foo"bar').
foo"bar true.
https://github.com/mthom/scryer-prolog/issues/1552#issuecomment-1207677642

What does "not necessary" mean. Thats nonsense.

Wouldn't it be a better and less confusing explanation that write/1
must behave as putatom/1, and everything else would be a bug,
since it has quoted(false)?

At least this is what the ISO core standard tells me:

- ISO/IEC 13211-1:1995(E), Page 100

So basically write/1 will behave, concerning atoms
as if (in DEC-10 Dialect):

[...]
write(X) :- atom(X), name(X,L), putlist(L).
[...]

putlist([X|Y]) :- put(X), putlist(Y).
putlist([]).

Mostowski Collapse schrieb am Mittwoch, 24. August 2022 um 15:10:50 UTC+2:
> If you would like to be TPTP compatible (versus v8.1.0.0),
> you would need to ban this:
>
> $ target/release/scryer-prolog -v
> "v0.9.0-181-g8e9302ea"
> $ target/release/scryer-prolog
> ?- X = hörgerät.
> X = hörgerät.
>
> So Scryer Prolog is now somewhere between TPTP
> and a Prolog Unicode, neither fish nor fowl,
> I cannot parse this, doesn't work in Scryer Prolog:
>
> $ cat text.pl
> text("«The Logos of Cybele is the idea that the Great Mother creates\n\
> and kills everything. It is not eternity (Apollo) or the circle\n\
> (Dionysus), but something that acts in her way with blind\n\
> and absolute power. A form of progress: bottom-up growth.\n\
> We are experiencing the final attack of Cybele, of the Great Risen\n\
> Mother, with feminism, artificial intelligence, globalization,\n\
> democracy, liberalism, and so on»").
>
> I get this error:
>
> $ target/release/scryer-prolog
> ?- ['text.pl'].
> error(syntax_error(missing_quote),read_term/3:0).
> false.
>
> Works fine in SWI-Prolog:
>
> ?- text(X), write(X), nl, fail; true.
> «The Logos of Cybele is the idea that the Great Mother creates
> and kills everything. It is not eternity (Apollo) or the circle
> (Dionysus), but something that acts in her way with blind
> and absolute power. A form of progress: bottom-up growth.
> We are experiencing the final attack of Cybele, of the Great Risen
> Mother, with feminism, artificial intelligence, globalization,
> democracy, liberalism, and so on»
> true.
> Mostowski Collapse schrieb am Mittwoch, 24. August 2022 um 15:08:40 UTC+2:
> > Mostowski Collapse schrieb am Donnerstag, 11. August 2022 um 17:27:36 UTC+2:
> > > Thats just your humanly ape brain acceptance curve:
> > > - Resistance
> > > - Denial
> > > - Exploration
> > > - Commitment
> > If you are a slow thinker, you pass these quadrants slowly,
> > maybe you never reach the end. Here is an example of a
> > slow thinker, Ulrich Neumerkel, concerning Unicode:
> >
> > bla bla bla TPTP and bla bla bla WG21/N3146
> > https://www.tptp.org/TPTP/SyntaxBNF.html#lower_alpha
> > https://github.com/mthom/scryer-prolog/issues/1515#issuecomment-1225242783
> > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3146.html
> >
> > LoL

Re: Request for comments, async ISO core standard I/O

<dde0630c-4522-453c-b828-003008bea160n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2844:b0:6b8:5f52:a6b5 with SMTP id h4-20020a05620a284400b006b85f52a6b5mr318268qkp.351.1661364144150;
Wed, 24 Aug 2022 11:02:24 -0700 (PDT)
X-Received: by 2002:a05:6902:10c:b0:671:68b7:ab41 with SMTP id
o12-20020a056902010c00b0067168b7ab41mr284917ybh.608.1661364143853; Wed, 24
Aug 2022 11:02:23 -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: Wed, 24 Aug 2022 11:02:23 -0700 (PDT)
In-Reply-To: <bcdd135e-3149-4a3e-8235-d2c0b283a7b0n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
<bcdd135e-3149-4a3e-8235-d2c0b283a7b0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dde0630c-4522-453c-b828-003008bea160n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 24 Aug 2022 18:02:24 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Wed, 24 Aug 2022 18:02 UTC

Also, I don't find a putatom/1 in DEC-10 Manual from year 1982 here:

Department of Artificial Intelligence. University of Edinburgh
DECsystem-10 PROLOG USER'S MANUAL - 10 November 1982
https://userweb.fct.unl.pt/~lmp/publications/online-papers/DECsystem-10%20PROLOG%20USER%27S%20MANUAL.pdf

Where do you have an evidence, for the year 1978?

Mostowski Collapse schrieb am Mittwoch, 24. August 2022 um 20:01:15 UTC+2:
> Slow thinking can lead to constant pain. Like here:
>
> And, indeed, in the case of an atom the escaping is not necessary:
> ?- write('foo"bar').
> foo"bar true.
> https://github.com/mthom/scryer-prolog/issues/1552#issuecomment-1207677642
>
> What does "not necessary" mean. Thats nonsense.
>
> Wouldn't it be a better and less confusing explanation that write/1
> must behave as putatom/1, and everything else would be a bug,
> since it has quoted(false)?
>
> At least this is what the ISO core standard tells me:
>
> - ISO/IEC 13211-1:1995(E), Page 100
>
> So basically write/1 will behave, concerning atoms
> as if (in DEC-10 Dialect):
>
> [...]
> write(X) :- atom(X), name(X,L), putlist(L).
> [...]
>
> putlist([X|Y]) :- put(X), putlist(Y).
> putlist([]).

Re: Request for comments, async ISO core standard I/O

<b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:1925:b0:6bb:8781:e356 with SMTP id bj37-20020a05620a192500b006bb8781e356mr576770qkb.627.1661368728829;
Wed, 24 Aug 2022 12:18:48 -0700 (PDT)
X-Received: by 2002:a25:3ca:0:b0:696:3653:d1b with SMTP id 193-20020a2503ca000000b0069636530d1bmr559145ybd.175.1661368728338;
Wed, 24 Aug 2022 12:18:48 -0700 (PDT)
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, 24 Aug 2022 12:18:48 -0700 (PDT)
In-Reply-To: <166fdad7-1a4e-42d1-8b99-6675db8b7442n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
<166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 24 Aug 2022 19:18:48 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3632
 by: Mostowski Collapse - Wed, 24 Aug 2022 19:18 UTC

Slow thinking can lead to constant pain! LoL

Logtalk is writing nonsense:
Union, intersection, ... are set operations. Subtract is not.
https://github.com/LogtalkDotOrg/logtalk3/issues/150#issuecomment-1226084264

Then correcting it to:
Union, intersection, ... are set operations. Subtract is not a set only operation.

Ha Ha, when you have no clue how Prolog works. Union and
Intersection are also "not a set only operation", what ever that
means. They are in the same category like Subtract.

Come on guys, its not so difficult! sets.lgt has also subtract:

subtract(Set, [], Set) :- !.
subtract([], _, []) :- !.
subtract([Head1| Tail1], [Head2| Tail2], Difference) :-
compare(Order, Head1, Head2),
subtract(Order, Head1, Tail1, Head2, Tail2, Difference).

subtract(=, _, Tail1, _, Tail2, Difference) :-
subtract(Tail1, Tail2, Difference).
subtract(<, Head1, Tail1, Head2, Tail2, [Head1| Difference]) :-
subtract(Tail1, [Head2| Tail2], Difference).
subtract(>, Head1, Tail1, _, Tail2, Difference) :-
subtract([Head1| Tail1], Tail2, Difference).

In SWI-Prolog its clearer since there is no name overloading:

https://www.swi-prolog.org/pldoc/doc_for?object=ord_subtract/3

P.S.: Mathematically we would write P \ Q for the set difference.

https://mathworld.wolfram.com/SetDifference.html

Mostowski Collapse schrieb am Mittwoch, 24. August 2022 um 15:38:15 UTC+2:
> Holy Cow, Logtalk is the converse of Ciao Prolog.
> Its kind of the inverted image of the library(lists)
> of Ciao Prolog. What Logtalk has:
>
> subtract([], _, []).
> subtract([Head| Tail], List, Rest) :-
> ( memberchk(Head, List) ->
> subtract(Tail, List, Rest)
> ; Rest = [Head| Tail2],
> subtract(Tail, List, Tail2)
> ).
>
> is not in Ciao Prolog. And vice versa, like
> union/3, interaction/3, etc.. is missing from lists.
> So if Ciao Prolog would load Logtalk it
>
> would have everything?

Re: Request for comments, async ISO core standard I/O

<8e2bd0c4-0976-48f1-917f-dda7c99bc840n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:20a8:b0:477:1882:3e7 with SMTP id 8-20020a05621420a800b00477188203e7mr38571218qvd.44.1662326398791;
Sun, 04 Sep 2022 14:19:58 -0700 (PDT)
X-Received: by 2002:a25:511:0:b0:6a8:d3a4:5ce3 with SMTP id
17-20020a250511000000b006a8d3a45ce3mr5003742ybf.245.1662326398524; Sun, 04
Sep 2022 14:19:58 -0700 (PDT)
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: Sun, 4 Sep 2022 14:19:58 -0700 (PDT)
In-Reply-To: <b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
<166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com> <b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8e2bd0c4-0976-48f1-917f-dda7c99bc840n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 04 Sep 2022 21:19:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1876
 by: Mostowski Collapse - Sun, 4 Sep 2022 21:19 UTC

These are some ultra cute graphics!

Cooperative Multitasking Visualized - Tau Prolog, 2022
http://tau-prolog.org/files/prole2022/#/4/4

Noice!

Re: Request for comments, async ISO core standard I/O

<8bc2353f-611a-4cee-a0ac-e63e43d4fcf5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:17a8:b0:6ce:99f0:7626 with SMTP id ay40-20020a05620a17a800b006ce99f07626mr1714310qkb.194.1663276200392;
Thu, 15 Sep 2022 14:10:00 -0700 (PDT)
X-Received: by 2002:a25:2d4b:0:b0:6b0:cc1:8cc with SMTP id s11-20020a252d4b000000b006b00cc108ccmr1540020ybe.570.1663276200110;
Thu, 15 Sep 2022 14:10:00 -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: Thu, 15 Sep 2022 14:09:59 -0700 (PDT)
In-Reply-To: <8e2bd0c4-0976-48f1-917f-dda7c99bc840n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
<166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com> <b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@googlegroups.com>
<8e2bd0c4-0976-48f1-917f-dda7c99bc840n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8bc2353f-611a-4cee-a0ac-e63e43d4fcf5n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 15 Sep 2022 21:10:00 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2685
 by: Mostowski Collapse - Thu, 15 Sep 2022 21:09 UTC

Why not load small JavaScript snippets synchronously
in the browser? This one works for me. At least
some local testing works already, its not yet deployed:

let parent = "";
let cache = {};

/**
* Load a JavaScript text synchronously.
*
* @param url The url.
*/
function cludge(url) {
/* resolve and check */
if (parent !== "")
url = new URL(url, parent).href;
let map = cache[url];
if (map !== undefined)
return map;
map = {};
cache[url] = map;

/* load and execute */
let back = parent;
try {
parent = url;
let request = new XMLHttpRequest();
request.open('GET', url, false);
request.send();
let fun = new Function("exports", "require", request.responseText);
fun(map, cludge);
} finally {
parent = back;
}
return map;
}

Have Fun!

Re: Request for comments, async ISO core standard I/O

<tg0hgd$6n2t$1@solani.org>

  copy mid

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

  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 (Mostowski Collapse)
Newsgroups: comp.lang.prolog
Subject: Re: Request for comments, async ISO core standard I/O
Date: Fri, 16 Sep 2022 02:54:39 +0200
Message-ID: <tg0hgd$6n2t$1@solani.org>
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com>
<96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com>
<a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com>
<6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com>
<30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
<166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com>
<b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@googlegroups.com>
<8e2bd0c4-0976-48f1-917f-dda7c99bc840n@googlegroups.com>
<8bc2353f-611a-4cee-a0ac-e63e43d4fcf5n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 16 Sep 2022 00:54:37 -0000 (UTC)
Injection-Info: solani.org;
logging-data="220253"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.13
Cancel-Lock: sha1:cVlXAU162VJGJrZLV69Bc+v1a/w=
In-Reply-To: <8bc2353f-611a-4cee-a0ac-e63e43d4fcf5n@googlegroups.com>
X-User-ID: eJwNyMEBwCAIA8CVBEnEcSTK/iO09zxMGrWCYKDRrMwOq+XN0EonfG497mMV1n1upYQWMJWUj1fj1D83V9QHVhcWLQ==
 by: Mostowski Collapse - Fri, 16 Sep 2022 00:54 UTC

On second though, I will not use this piece
of code, rather should work more consequently
in keeping the overal code async and the examples

async as well, so that it wont happen, that the browser
blocks. From GUI viewpoint its not so trivial
to make it async compatible. There are few tricks

needed. If there is only one action button this
works to avoid that multiple Prolog interpreter
calls are spawned:

async function main_async() {
document.getElementById("launch").disabled = true;
try {
async bla bla
} finally {
document.getElementById("launch").disabled = false;
}
}

document.getElementById("launch")
.addEventListener("click", main_async);

But if there are multiple action buttons,
more work is needed.

Mostowski Collapse schrieb:
> Why not load small JavaScript snippets synchronously
> in the browser? This one works for me. At least
> some local testing works already, its not yet deployed:
>
> let parent = "";
> let cache = {};
>
> /**
> * Load a JavaScript text synchronously.
> *
> * @param url The url.
> */
> function cludge(url) {
> /* resolve and check */
> if (parent !== "")
> url = new URL(url, parent).href;
> let map = cache[url];
> if (map !== undefined)
> return map;
> map = {};
> cache[url] = map;
>
> /* load and execute */
> let back = parent;
> try {
> parent = url;
> let request = new XMLHttpRequest();
> request.open('GET', url, false);
> request.send();
> let fun = new Function("exports", "require", request.responseText);
> fun(map, cludge);
> } finally {
> parent = back;
> }
> return map;
> }
>
> Have Fun!
>

Re: Request for comments, async ISO core standard I/O

<66785d81-f3d4-4c6b-abc8-3a6c8d2d1f68n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2601:b0:6bc:70bb:c56b with SMTP id z1-20020a05620a260100b006bc70bbc56bmr1487445qko.416.1665085385398;
Thu, 06 Oct 2022 12:43:05 -0700 (PDT)
X-Received: by 2002:a05:6870:3398:b0:113:7f43:d0e9 with SMTP id
w24-20020a056870339800b001137f43d0e9mr755453oae.33.1665085385137; Thu, 06 Oct
2022 12:43:05 -0700 (PDT)
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: Thu, 6 Oct 2022 12:43:04 -0700 (PDT)
In-Reply-To: <tg0hgd$6n2t$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
<166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com> <b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@googlegroups.com>
<8e2bd0c4-0976-48f1-917f-dda7c99bc840n@googlegroups.com> <8bc2353f-611a-4cee-a0ac-e63e43d4fcf5n@googlegroups.com>
<tg0hgd$6n2t$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <66785d81-f3d4-4c6b-abc8-3a6c8d2d1f68n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 06 Oct 2022 19:43:05 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2338
 by: Mostowski Collapse - Thu, 6 Oct 2022 19:43 UTC

How would the world look like, if Paul Tarau would
not have written a paper about Prolog engines years
ago, but about Prolog promisses? Is there even such

a paper already? SWI-Prolog with its await/2 is quite
advanced, they have promise objects passing created
by (:=)/2 and then can be passed to await/2. In Dogelog

player promisses are still opaque, not visible in Prolog
sphere as it is actually the case in SWI-Prolog WASM.
But the idea of enginess still sticks to the mind!

Re: Request for comments, async ISO core standard I/O

<ec09b0a4-6dd5-4cfb-8979-1641c4dd12a6n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:21e6:b0:4af:a811:6c69 with SMTP id p6-20020a05621421e600b004afa8116c69mr1680072qvj.40.1665085610321;
Thu, 06 Oct 2022 12:46:50 -0700 (PDT)
X-Received: by 2002:a05:6870:e616:b0:11c:bfaf:e69e with SMTP id
q22-20020a056870e61600b0011cbfafe69emr752291oag.196.1665085610011; Thu, 06
Oct 2022 12:46:50 -0700 (PDT)
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: Thu, 6 Oct 2022 12:46:49 -0700 (PDT)
In-Reply-To: <66785d81-f3d4-4c6b-abc8-3a6c8d2d1f68n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
<166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com> <b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@googlegroups.com>
<8e2bd0c4-0976-48f1-917f-dda7c99bc840n@googlegroups.com> <8bc2353f-611a-4cee-a0ac-e63e43d4fcf5n@googlegroups.com>
<tg0hgd$6n2t$1@solani.org> <66785d81-f3d4-4c6b-abc8-3a6c8d2d1f68n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec09b0a4-6dd5-4cfb-8979-1641c4dd12a6n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 06 Oct 2022 19:46:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3345
 by: Mostowski Collapse - Thu, 6 Oct 2022 19:46 UTC

Recent version of Dogelog uses import(), this is a JavaScript
function which returns a promise. Behind this promise
is loading and evaluating JavaScript code, and I could

show how to transpile WordNet to JavaScript, and then load
it via import(). Its quite fast! But can we make it parallel
without going into engines? Maybe use this syntax

for parallel import. A list wrapped into a singleton list. Or use
some flag to control it, since a default parallel behaviour
could be too dangerous?

/* Parallel Variant Syntax of Multi-Consult ? */
?- [['foo.p', 'bar.p', 'baz.p']].

Of course engines or what Tau Prolog did with tasks and
promises, could also lead to a parallel load. Maybe can get
away with a cheaper solution, not bring tasks to Dogelog

player, only juggle with import() ?

Mostowski Collapse schrieb am Donnerstag, 6. Oktober 2022 um 21:43:06 UTC+2:
> How would the world look like, if Paul Tarau would
> not have written a paper about Prolog engines years
> ago, but about Prolog promisses? Is there even such
>
> a paper already? SWI-Prolog with its await/2 is quite
> advanced, they have promise objects passing created
> by (:=)/2 and then can be passed to await/2. In Dogelog
>
> player promisses are still opaque, not visible in Prolog
> sphere as it is actually the case in SWI-Prolog WASM.
> But the idea of enginess still sticks to the mind!

Re: Request for comments, async ISO core standard I/O

<2a4d1895-0692-4b1d-a274-700e4875e017n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5fcd:0:b0:35c:d514:eb86 with SMTP id k13-20020ac85fcd000000b0035cd514eb86mr1637908qta.616.1665085727091;
Thu, 06 Oct 2022 12:48:47 -0700 (PDT)
X-Received: by 2002:a05:6871:68b:b0:132:9af1:62fb with SMTP id
l11-20020a056871068b00b001329af162fbmr6422085oao.23.1665085726838; Thu, 06
Oct 2022 12:48:46 -0700 (PDT)
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: Thu, 6 Oct 2022 12:48:46 -0700 (PDT)
In-Reply-To: <ec09b0a4-6dd5-4cfb-8979-1641c4dd12a6n@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: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<f0f034db-50f8-46af-a371-6cfd8bae2908n@googlegroups.com> <96f858a4-3ce3-456d-bbf4-46b2adc950f5n@googlegroups.com>
<b2966bcc-e675-42c9-9d9b-5cbd2030a6f9n@googlegroups.com> <a028d3b8-ee06-43b4-8d2b-22f30bcfaa67n@googlegroups.com>
<174b4947-28ea-4f59-a2d9-f09b148270c0n@googlegroups.com> <6d1511ba-f0c5-4df9-be0e-ffa66d02ab2fn@googlegroups.com>
<de49e8f1-1409-40b2-b60b-94aab4492e72n@googlegroups.com> <30228514-d7f4-457f-9ed9-6b8b16617718n@googlegroups.com>
<166fdad7-1a4e-42d1-8b99-6675db8b7442n@googlegroups.com> <b8cb57a7-2a98-48fd-ab7a-9d75ade2e009n@googlegroups.com>
<8e2bd0c4-0976-48f1-917f-dda7c99bc840n@googlegroups.com> <8bc2353f-611a-4cee-a0ac-e63e43d4fcf5n@googlegroups.com>
<tg0hgd$6n2t$1@solani.org> <66785d81-f3d4-4c6b-abc8-3a6c8d2d1f68n@googlegroups.com>
<ec09b0a4-6dd5-4cfb-8979-1641c4dd12a6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2a4d1895-0692-4b1d-a274-700e4875e017n@googlegroups.com>
Subject: Re: Request for comments, async ISO core standard I/O
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 06 Oct 2022 19:48:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4298
 by: Mostowski Collapse - Thu, 6 Oct 2022 19:48 UTC

So what was rummaging in my brain. Why did I get repelled
by the idea of engines. I don’t know, or maybe I know?
Does SWI-Prolog have only this here, namely:

await(+Promise, -Result)
execution of await/2 completes when the Promise resolves
and Result is unified with the value passed to the
Promise.then() method.
https://www.swi-prolog.org/pldoc/doc_for?object=await/2

How about a new await_all/2, that takes a promise list?
What could be done with await_all/2? BTW: JavaScript
has more in stock than only await_all/2 which would correspond

to Promise.all(), there are like 1-2 other multi-waiters.

Mostowski Collapse schrieb am Donnerstag, 6. Oktober 2022 um 21:46:51 UTC+2:
> Recent version of Dogelog uses import(), this is a JavaScript
> function which returns a promise. Behind this promise
> is loading and evaluating JavaScript code, and I could
>
> show how to transpile WordNet to JavaScript, and then load
> it via import(). Its quite fast! But can we make it parallel
> without going into engines? Maybe use this syntax
>
> for parallel import. A list wrapped into a singleton list. Or use
> some flag to control it, since a default parallel behaviour
> could be too dangerous?
>
> /* Parallel Variant Syntax of Multi-Consult ? */
> ?- [['foo.p', 'bar.p', 'baz.p']].
>
> Of course engines or what Tau Prolog did with tasks and
> promises, could also lead to a parallel load. Maybe can get
> away with a cheaper solution, not bring tasks to Dogelog
>
> player, only juggle with import() ?
> Mostowski Collapse schrieb am Donnerstag, 6. Oktober 2022 um 21:43:06 UTC+2:
> > How would the world look like, if Paul Tarau would
> > not have written a paper about Prolog engines years
> > ago, but about Prolog promisses? Is there even such
> >
> > a paper already? SWI-Prolog with its await/2 is quite
> > advanced, they have promise objects passing created
> > by (:=)/2 and then can be passed to await/2. In Dogelog
> >
> > player promisses are still opaque, not visible in Prolog
> > sphere as it is actually the case in SWI-Prolog WASM.
> > But the idea of enginess still sticks to the mind!

Re: Request for comments, async ISO core standard I/O

<ur771d$f2lp$1@solani.org>

  copy mid

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

  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, async ISO core standard I/O
Date: Thu, 22 Feb 2024 11:18:20 +0100
Message-ID: <ur771d$f2lp$1@solani.org>
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 22 Feb 2024 10:18:21 -0000 (UTC)
Injection-Info: solani.org;
logging-data="494265"; 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.18.1
Cancel-Lock: sha1:vdCM8dG7//PlnUGv9nPcxjVYgGM=
X-User-ID: eJwNysERwDAIA7CVSoJNGYeasP8IzVN3wqZR4QQdg7nyB4ehQ31QvcpTARuOsT32U1qr1cjKauVNLaMdeZf/YkUWfw==
In-Reply-To: <1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
 by: Mild Shock - Thu, 22 Feb 2024 10:18 UTC

Now asyncifying I/O of Dogelog Player for Python.
I guess we got our head around the equivalents
of our Java Surrogate async/await constructs

"Promise" and "Coroutine". The key utilities among
asyncio are asyncio.to_thread an asyncio.run_coroutine_threadsafe,
which seem toe especially made for the two use cases.

Namely what was our Java Surrogate "Promise" wrapper,
now looks like here, what a wonderful code gem:

async def console_promise(buf, stream):
try:
res = await asyncio.to_thread(blocking_readline, stream.data)
stream.buf = res
stream.pos = 0
except IOError as err:
register_signal(buf, map_stream_error(err))

def blocking_readline(data):
return data.readline()

And what was our Java Surrogate "Coroutine" wrapper,
now looks like here, what a wonderful code gem again:

def test_sys_http_server_on(args):
[...]
obj.func = lambda req, res: baby_come_back(
launch_async(clause, buf, [req, res]), loop)

def baby_come_back(coro, loop):
future = asyncio.run_coroutine_threadsafe(coro, loop)
return future.result()

LoL

Re: Request for comments, async ISO core standard I/O

<ur77gq$f2u5$1@solani.org>

  copy mid

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

  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, async ISO core standard I/O
Date: Thu, 22 Feb 2024 11:26:34 +0100
Message-ID: <ur77gq$f2u5$1@solani.org>
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
<ur771d$f2lp$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 10:26:34 -0000 (UTC)
Injection-Info: solani.org;
logging-data="494533"; 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.18.1
Cancel-Lock: sha1:vi39p/hgobKvu08wYYMnJXLMrxA=
In-Reply-To: <ur771d$f2lp$1@solani.org>
X-User-ID: eJwFwYEBwCAIA7CXyixIz0GR/09Y4iss7mZ40Mdn2WZWRx5ZJ1dKfsroYnLUgB1CbfaAd1VzST6k8FV8+AEn6RRD
 by: Mild Shock - Thu, 22 Feb 2024 10:26 UTC

But its much more complicated than what we did
for JDK 21. Also starting the HTTP server in a separate
thread is extremly frightening:

def test_http_server_listen(args):
[...]
thread = threading.Thread(target=blocking_forever, args=(obj,))
thread.start()

def blocking_forever(obj):
obj.serve_forever()

Its extremly frightening since the Thread docu warns us:

Thread-based parallelism
In CPython, due to the Global Interpreter Lock,
only one thread can execute Python code at once
https://docs.python.org/3/library/threading.html

global interpreter lock
Also, the GIL is always released when doing I/O.
Past efforts to create a “free-threaded” interpreter
have not been successful
https://docs.python.org/3/glossary.html#term-global-interpreter-lock

But still, our use of asyncio.to_thread and
asyncio.run_coroutine_threadsafe capitalizes on
that the GIL is nevertheless released during I/O,

and we don't see much issue here.

Mild Shock schrieb:
> Now asyncifying I/O of Dogelog Player for Python.
> I guess we got our head around the equivalents
> of our Java Surrogate async/await constructs
>
> "Promise" and "Coroutine". The key utilities among
> asyncio are asyncio.to_thread an asyncio.run_coroutine_threadsafe,
> which seem toe especially made for the two use cases.
>
> Namely what was our Java Surrogate "Promise" wrapper,
> now looks like here, what a wonderful code gem:
>
>
> async def console_promise(buf, stream):
>     try:
>         res = await asyncio.to_thread(blocking_readline, stream.data)
>         stream.buf = res
>         stream.pos = 0
>     except IOError as err:
>         register_signal(buf, map_stream_error(err))
>
>
> def blocking_readline(data):
>     return data.readline()
>
>
> And what was our Java Surrogate "Coroutine" wrapper,
> now looks like here, what a wonderful code gem again:
>
> def test_sys_http_server_on(args):
>    [...]
>     obj.func = lambda req, res: baby_come_back(
>             launch_async(clause, buf, [req, res]), loop)
>
>
> def baby_come_back(coro, loop):
>     future = asyncio.run_coroutine_threadsafe(coro, loop)
>     return future.result()
>
> LoL

Re: Request for comments, async ISO core standard I/O

<us790t$veer$1@solani.org>

  copy mid

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

  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, async ISO core standard I/O
Date: Tue, 5 Mar 2024 15:08:31 +0100
Message-ID: <us790t$veer$1@solani.org>
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 5 Mar 2024 14:08:29 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1030619"; 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.18.1
Cancel-Lock: sha1:4ixx8LDHM8fm5ebgG0HdZye9KtQ=
In-Reply-To: <1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
X-User-ID: eJwFwQkBwDAIBDBLlB85DDj/EpaY+PMJdXM1GBq1Z1iYMHya+Gt+FnXjMpoFZIdSRlISOzaolvrAJML3A25GFZ0=
 by: Mild Shock - Tue, 5 Mar 2024 14:08 UTC

Ha Ha, now Scyer Prolog wants also
byte friendly compact strings:

2. introduce a compact internal representation for lists of bytes,
which appear to Prolog programs as lists of characters.
https://github.com/mthom/scryer-prolog/blob/master/src/lib/crypto.pl#L867C2-L868C63

But they motivated it by security concerns,
whereas my concern was to get rid of ISO-ism
making a distinction between text and byte streams,

on the Prolog API levels. It would be all codes.

Mostowski Collapse schrieb:
> - UTF-16 native strings: Does work well with the envisioned
> "latin1" payload, the range 0..255 is encoded in one 16-bit word,
> which is two bytes, but most programming language already
> implement clever strings:
>
> JEP 254: Compact Strings
> We propose to change the internal representation of the String class
> from a UTF-16 char array to a byte array plus an encoding-flag field.
> The new String class will store characters encoded either as ISO-8859-1/
> Latin-1 (one byte per character), or as UTF-16 (two bytes per character),
> based upon the contents of the string. The encoding flag will indicate
> which encoding is used.
> https://openjdk.org/jeps/254

Re: Request for comments, async ISO core standard I/O

<ut2p4d$1dovh$1@solani.org>

  copy mid

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

  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, async ISO core standard I/O
Date: Sat, 16 Mar 2024 01:29:02 +0100
Message-ID: <ut2p4d$1dovh$1@solani.org>
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 16 Mar 2024 00:29:01 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1500145"; 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.18.1
Cancel-Lock: sha1:ziw9PFaHeVjLcfE0MBTRDj8gCds=
X-User-ID: eJwVzMkRACEMA8GUbLAEhIOv/ENYtqbfg0llLCNo6L86XQu6xASZ2DuqY8yrLnaYxW3wcL8d5z5egzHzLYRSH2t2Flk=
In-Reply-To: <1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
 by: Mild Shock - Sat, 16 Mar 2024 00:29 UTC

Now I have rewritten the Tic-Tac-Toe example
to be 100% Prolog. Originally the Tic-Tac-Toe example
was conceived as a first stab in exploring the

foreign function interface (FFI) of Dogelog Player
inside the browser to register JavaScript functions
that do all kind of stuff with the DOM and events.

But now I have library(markup) for DOM generation
and library(react) for events. So I rewrote Tic-Tac-Toe
using these utilities, reducing the amount of

JavaScript logic to zero. Tic-Tac-Toe is now 100% Prolog.

Re: Request for comments, async ISO core standard I/O

<ut2pol$1dp85$1@solani.org>

  copy mid

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

  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, async ISO core standard I/O
Date: Sat, 16 Mar 2024 01:39:50 +0100
Message-ID: <ut2pol$1dp85$1@solani.org>
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
<ut2p4d$1dovh$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 16 Mar 2024 00:39:49 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1500421"; 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.18.1
Cancel-Lock: sha1:TmhoiOEv2SxMIfSqDKWxKKp3RyU=
In-Reply-To: <ut2p4d$1dovh$1@solani.org>
X-User-ID: eJwVzMERwCAMA7CVCLFNGKcXzP4jtD39xVSoF0SB9yfsZ4GQ7JznnlSBx97kOhannGbXLAewO+KOiG/pwngBQucUvQ==
 by: Mild Shock - Sat, 16 Mar 2024 00:39 UTC

What also went down the drain abusing consult_async()
to do the game intialization, instead I am now using
perform_async(). So the code went from dangerous.

await consult_async(":- ensure_loaded('browser.p').");

dangerous because of possible file name quoting issues.
To this where the file name is a string object and doesn't
need to be Prolog encoded, because we don't invoke a Prolog

text encoded query but a Prolog term:

await perform_async(new Compound("ensure_loaded", ["browser.p"]));

In has far we should make some Hydration experiment.
What is Hydration. Its a new buzzword around the partially
obsolete design, to have first the HTML body in a broswer

doument and then at the end of the HTML body some scripts:

r/webdev - What is Hydration?
https://www.reddit.com/r/webdev/comments/xqd4i8/what_is_hydration/

The bundle end of HTML body design has usually takes
time time(html)+time(bundle). A better deisgn is unsing
async loading and the quasi-parallelism of the browser,

and load the bundle in the head if possible. The load time
is then around max(time(bundle), time(html))). which might
give better user experience. We should try the same

for our examples, load Dogelog Player in the head. But
the Prolog text loader is not yet task safe. So this might
involve some more work until we can try it.

Also we might nevertheless want to do a little hydration
when the HTML body is read, like wiring event handlers.

Mild Shock schrieb:
> Now I have rewritten the Tic-Tac-Toe example
> to be 100% Prolog. Originally the Tic-Tac-Toe example
> was conceived as a first stab in exploring the
>
> foreign function interface (FFI) of Dogelog Player
> inside the browser to register JavaScript functions
> that do all kind of stuff with the DOM and events.
>
> But now I have library(markup) for DOM generation
> and library(react) for events. So I rewrote Tic-Tac-Toe
> using these utilities, reducing the amount of
>
> JavaScript logic to zero. Tic-Tac-Toe is now 100% Prolog.

Re: Request for comments, async ISO core standard I/O

<ut2q9c$1dpfo$1@solani.org>

  copy mid

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

  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, async ISO core standard I/O
Date: Sat, 16 Mar 2024 01:48:44 +0100
Message-ID: <ut2q9c$1dpfo$1@solani.org>
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
<ut2p4d$1dovh$1@solani.org> <ut2pol$1dp85$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 16 Mar 2024 00:48:44 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1500664"; 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.18.1
Cancel-Lock: sha1:LFdkjaFyH8jlIphRsE6vx6FJdf0=
X-User-ID: eJwFwQkBACAIA8BKgjA0jjzrH8E73xBUGBzmdIpRGsGumUVWxyE1FD71Xh0N85W207vuAJO6dRCWd+To/YEEFjc=
In-Reply-To: <ut2pol$1dp85$1@solani.org>
 by: Mild Shock - Sat, 16 Mar 2024 00:48 UTC

Note because of the await in front of the
perform_async() our loading doesn't create a task yet.
It will change the current load sequence. It will

only allow that tasks create before the await get
their share of work. We would need to add one of our
create_task utilities, or use the async option of a

script tag, as recommened here for MathJax v3:

/* put this in the head */
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>

The async option of a script tag is described as:

"For module scripts, if the async attribute is
present then the scripts and all their dependencies
will be fetched in parallel to parsing and evaluated
as soon as they are available."
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#async

Mild Shock schrieb:
>
> What also went down the drain abusing consult_async()
> to do the game intialization, instead I am now using
> perform_async(). So the code went from dangerous.
>
>     await consult_async(":- ensure_loaded('browser.p').");
>
> dangerous because of possible file name quoting issues.
> To this where the file name is a string object and doesn't
> need to be Prolog encoded, because we don't invoke a Prolog
>
> text encoded query but a Prolog term:
>
>     await perform_async(new Compound("ensure_loaded", ["browser.p"]));
>
> In has far we should make some Hydration experiment.
> What is Hydration. Its a new buzzword around the partially
> obsolete design, to have first the HTML body in a broswer
>
> doument and then at the end of the HTML body some scripts:
>
> r/webdev - What is Hydration?
> https://www.reddit.com/r/webdev/comments/xqd4i8/what_is_hydration/
>
> The bundle end of HTML body design has usually takes
> time time(html)+time(bundle). A better deisgn is unsing
> async loading and the quasi-parallelism of the browser,
>
> and load the bundle in the head if possible. The load time
> is then around max(time(bundle), time(html))). which might
> give better user experience. We should try the same
>
> for our examples, load Dogelog Player in the head. But
> the Prolog text loader is not yet task safe. So this might
> involve some more work until we can try it.
>
> Also we might nevertheless want to do a little hydration
> when the HTML body is read, like wiring event handlers.
>
> Mild Shock schrieb:
>> Now I have rewritten the Tic-Tac-Toe example
>> to be 100% Prolog. Originally the Tic-Tac-Toe example
>> was conceived as a first stab in exploring the
>>
>> foreign function interface (FFI) of Dogelog Player
>> inside the browser to register JavaScript functions
>> that do all kind of stuff with the DOM and events.
>>
>> But now I have library(markup) for DOM generation
>> and library(react) for events. So I rewrote Tic-Tac-Toe
>> using these utilities, reducing the amount of
>>
>> JavaScript logic to zero. Tic-Tac-Toe is now 100% Prolog.
>

Re: Request for comments, async ISO core standard I/O

<ut2qhj$1dpfo$2@solani.org>

  copy mid

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

  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, async ISO core standard I/O
Date: Sat, 16 Mar 2024 01:53:08 +0100
Message-ID: <ut2qhj$1dpfo$2@solani.org>
References: <7e154664-d8d9-46f2-ade4-9b9a7712a2den@googlegroups.com>
<1f804201-3aa6-4fbc-b1c3-f3887b304675n@googlegroups.com>
<ut2p4d$1dovh$1@solani.org> <ut2pol$1dp85$1@solani.org>
<ut2q9c$1dpfo$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 16 Mar 2024 00:53:07 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1500664"; 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.18.1
Cancel-Lock: sha1:DK81ityHPubQoL5UvHiOwJwquo8=
X-User-ID: eJwVyskRACEIBMCUdsDhCEdB8w9B99lVTTVY+TDa4OExBzPj6y1zroWxEKb4uV+QigAlSlL7oF73TkrGdN/eegFA2RTn
In-Reply-To: <ut2q9c$1dpfo$1@solani.org>
 by: Mild Shock - Sat, 16 Mar 2024 00:53 UTC

Corr. Typo

It will NOT change the current load sequence.

Mild Shock schrieb:
>
> Note because of the await in front of the
> perform_async() our loading doesn't create a task yet.
> It will change the current load sequence. It will
>
> only allow that tasks create before the await get
> their share of work. We would need to add one of our
> create_task utilities, or use the async option of a
>
> script tag, as recommened here for MathJax v3:
>
> /* put this in the head */
> <script type="text/javascript" id="MathJax-script" async
>   src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
> </script>
>
> The async option of a script tag is described as:
>
> "For module scripts, if the async attribute is
> present then the scripts and all their dependencies
> will be fetched in parallel to parsing and evaluated
> as soon as they are available."
> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#async
>
> Mild Shock schrieb:
>>
>> What also went down the drain abusing consult_async()
>> to do the game intialization, instead I am now using
>> perform_async(). So the code went from dangerous.
>>
>>      await consult_async(":- ensure_loaded('browser.p').");
>>
>> dangerous because of possible file name quoting issues.
>> To this where the file name is a string object and doesn't
>> need to be Prolog encoded, because we don't invoke a Prolog
>>
>> text encoded query but a Prolog term:
>>
>>      await perform_async(new Compound("ensure_loaded", ["browser.p"]));
>>
>> In has far we should make some Hydration experiment.
>> What is Hydration. Its a new buzzword around the partially
>> obsolete design, to have first the HTML body in a broswer
>>
>> doument and then at the end of the HTML body some scripts:
>>
>> r/webdev - What is Hydration?
>> https://www.reddit.com/r/webdev/comments/xqd4i8/what_is_hydration/
>>
>> The bundle end of HTML body design has usually takes
>> time time(html)+time(bundle). A better deisgn is unsing
>> async loading and the quasi-parallelism of the browser,
>>
>> and load the bundle in the head if possible. The load time
>> is then around max(time(bundle), time(html))). which might
>> give better user experience. We should try the same
>>
>> for our examples, load Dogelog Player in the head. But
>> the Prolog text loader is not yet task safe. So this might
>> involve some more work until we can try it.
>>
>> Also we might nevertheless want to do a little hydration
>> when the HTML body is read, like wiring event handlers.
>>
>> Mild Shock schrieb:
>>> Now I have rewritten the Tic-Tac-Toe example
>>> to be 100% Prolog. Originally the Tic-Tac-Toe example
>>> was conceived as a first stab in exploring the
>>>
>>> foreign function interface (FFI) of Dogelog Player
>>> inside the browser to register JavaScript functions
>>> that do all kind of stuff with the DOM and events.
>>>
>>> But now I have library(markup) for DOM generation
>>> and library(react) for events. So I rewrote Tic-Tac-Toe
>>> using these utilities, reducing the amount of
>>>
>>> JavaScript logic to zero. Tic-Tac-Toe is now 100% Prolog.
>>
>

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor